gfx/skia/trunk/include/utils/SkProxyCanvas.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1
michael@0 2 /*
michael@0 3 * Copyright 2011 Google Inc.
michael@0 4 *
michael@0 5 * Use of this source code is governed by a BSD-style license that can be
michael@0 6 * found in the LICENSE file.
michael@0 7 */
michael@0 8 #ifndef SkProxyCanvas_DEFINED
michael@0 9 #define SkProxyCanvas_DEFINED
michael@0 10
michael@0 11 #include "SkCanvas.h"
michael@0 12
michael@0 13 /** This class overrides all virtual methods on SkCanvas, and redirects them
michael@0 14 to a "proxy", another SkCanvas instance. It can be the basis for
michael@0 15 intercepting (and possibly modifying) calls to a canvas.
michael@0 16
michael@0 17 There must be a proxy installed before the proxycanvas can be used (i.e.
michael@0 18 before its virtual methods can be called).
michael@0 19 */
michael@0 20 class SK_API SkProxyCanvas : public SkCanvas {
michael@0 21 public:
michael@0 22 SkProxyCanvas() : fProxy(NULL) {}
michael@0 23 SkProxyCanvas(SkCanvas* proxy);
michael@0 24 virtual ~SkProxyCanvas();
michael@0 25
michael@0 26 SkCanvas* getProxy() const { return fProxy; }
michael@0 27 void setProxy(SkCanvas* proxy);
michael@0 28
michael@0 29 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
michael@0 30 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
michael@0 31 const SkPaint& paint) SK_OVERRIDE;
michael@0 32 virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
michael@0 33 virtual void drawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
michael@0 34 virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
michael@0 35 virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
michael@0 36 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
michael@0 37 const SkPaint* paint = NULL) SK_OVERRIDE;
michael@0 38 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
michael@0 39 const SkRect& dst, const SkPaint* paint,
michael@0 40 DrawBitmapRectFlags flags) SK_OVERRIDE;
michael@0 41 virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m,
michael@0 42 const SkPaint* paint = NULL) SK_OVERRIDE;
michael@0 43 virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
michael@0 44 const SkPaint* paint = NULL) SK_OVERRIDE;
michael@0 45 virtual void drawText(const void* text, size_t byteLength, SkScalar x,
michael@0 46 SkScalar y, const SkPaint& paint) SK_OVERRIDE;
michael@0 47 virtual void drawPosText(const void* text, size_t byteLength,
michael@0 48 const SkPoint pos[], const SkPaint& paint) SK_OVERRIDE;
michael@0 49 virtual void drawPosTextH(const void* text, size_t byteLength,
michael@0 50 const SkScalar xpos[], SkScalar constY,
michael@0 51 const SkPaint& paint) SK_OVERRIDE;
michael@0 52 virtual void drawTextOnPath(const void* text, size_t byteLength,
michael@0 53 const SkPath& path, const SkMatrix* matrix,
michael@0 54 const SkPaint& paint) SK_OVERRIDE;
michael@0 55 virtual void drawPicture(SkPicture&) SK_OVERRIDE;
michael@0 56 virtual void drawVertices(VertexMode vmode, int vertexCount,
michael@0 57 const SkPoint vertices[], const SkPoint texs[],
michael@0 58 const SkColor colors[], SkXfermode* xmode,
michael@0 59 const uint16_t indices[], int indexCount,
michael@0 60 const SkPaint& paint) SK_OVERRIDE;
michael@0 61 virtual void drawData(const void* data, size_t length) SK_OVERRIDE;
michael@0 62
michael@0 63 virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
michael@0 64 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
michael@0 65 virtual void endCommentGroup() SK_OVERRIDE;
michael@0 66
michael@0 67 virtual SkBounder* setBounder(SkBounder* bounder) SK_OVERRIDE;
michael@0 68 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE;
michael@0 69
michael@0 70 protected:
michael@0 71 virtual void willSave(SaveFlags) SK_OVERRIDE;
michael@0 72 virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
michael@0 73 virtual void willRestore() SK_OVERRIDE;
michael@0 74
michael@0 75 virtual void didTranslate(SkScalar, SkScalar) SK_OVERRIDE;
michael@0 76 virtual void didScale(SkScalar, SkScalar) SK_OVERRIDE;
michael@0 77 virtual void didRotate(SkScalar) SK_OVERRIDE;
michael@0 78 virtual void didSkew(SkScalar, SkScalar) SK_OVERRIDE;
michael@0 79 virtual void didConcat(const SkMatrix&) SK_OVERRIDE;
michael@0 80 virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
michael@0 81
michael@0 82 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
michael@0 83
michael@0 84 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
michael@0 85 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
michael@0 86 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
michael@0 87 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
michael@0 88
michael@0 89 private:
michael@0 90 SkCanvas* fProxy;
michael@0 91
michael@0 92 typedef SkCanvas INHERITED;
michael@0 93 };
michael@0 94
michael@0 95 #endif

mercurial