gfx/skia/trunk/include/utils/SkLuaCanvas.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 * Copyright 2013 Google Inc.
michael@0 3 *
michael@0 4 * Use of this source code is governed by a BSD-style license that can be
michael@0 5 * found in the LICENSE file.
michael@0 6 */
michael@0 7
michael@0 8 #ifndef SkLuaCanvas_DEFINED
michael@0 9 #define SkLuaCanvas_DEFINED
michael@0 10
michael@0 11 #include "SkCanvas.h"
michael@0 12 #include "SkString.h"
michael@0 13
michael@0 14 struct lua_State;
michael@0 15
michael@0 16 class SkLuaCanvas : public SkCanvas {
michael@0 17 public:
michael@0 18 void pushThis();
michael@0 19
michael@0 20 SkLuaCanvas(int width, int height, lua_State*, const char function[]);
michael@0 21 virtual ~SkLuaCanvas();
michael@0 22
michael@0 23 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
michael@0 24 virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
michael@0 25 const SkPaint& paint) SK_OVERRIDE;
michael@0 26 virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
michael@0 27 virtual void drawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
michael@0 28 virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
michael@0 29 virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
michael@0 30 virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
michael@0 31 const SkPaint* paint) SK_OVERRIDE;
michael@0 32 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
michael@0 33 const SkRect& dst, const SkPaint* paint,
michael@0 34 DrawBitmapRectFlags flags) SK_OVERRIDE;
michael@0 35 virtual void drawBitmapMatrix(const SkBitmap& bitmap, const SkMatrix& m,
michael@0 36 const SkPaint* paint) SK_OVERRIDE;
michael@0 37 virtual void drawSprite(const SkBitmap& bitmap, int left, int top,
michael@0 38 const SkPaint* paint) SK_OVERRIDE;
michael@0 39 virtual void drawText(const void* text, size_t byteLength, SkScalar x,
michael@0 40 SkScalar y, const SkPaint& paint) SK_OVERRIDE;
michael@0 41 virtual void drawPosText(const void* text, size_t byteLength,
michael@0 42 const SkPoint pos[], const SkPaint& paint) SK_OVERRIDE;
michael@0 43 virtual void drawPosTextH(const void* text, size_t byteLength,
michael@0 44 const SkScalar xpos[], SkScalar constY,
michael@0 45 const SkPaint& paint) SK_OVERRIDE;
michael@0 46 virtual void drawTextOnPath(const void* text, size_t byteLength,
michael@0 47 const SkPath& path, const SkMatrix* matrix,
michael@0 48 const SkPaint& paint) SK_OVERRIDE;
michael@0 49 virtual void drawPicture(SkPicture&) SK_OVERRIDE;
michael@0 50 virtual void drawVertices(VertexMode vmode, int vertexCount,
michael@0 51 const SkPoint vertices[], const SkPoint texs[],
michael@0 52 const SkColor colors[], SkXfermode* xmode,
michael@0 53 const uint16_t indices[], int indexCount,
michael@0 54 const SkPaint& paint) SK_OVERRIDE;
michael@0 55 virtual void drawData(const void* data, size_t length) SK_OVERRIDE;
michael@0 56
michael@0 57 protected:
michael@0 58 virtual void willSave(SaveFlags) SK_OVERRIDE;
michael@0 59 virtual SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) SK_OVERRIDE;
michael@0 60 virtual void willRestore() SK_OVERRIDE;
michael@0 61
michael@0 62 virtual void didTranslate(SkScalar, SkScalar) SK_OVERRIDE;
michael@0 63 virtual void didScale(SkScalar, SkScalar) SK_OVERRIDE;
michael@0 64 virtual void didRotate(SkScalar) SK_OVERRIDE;
michael@0 65 virtual void didSkew(SkScalar, SkScalar) SK_OVERRIDE;
michael@0 66 virtual void didConcat(const SkMatrix&) SK_OVERRIDE;
michael@0 67 virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
michael@0 68
michael@0 69 virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
michael@0 70
michael@0 71 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
michael@0 72 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
michael@0 73 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
michael@0 74 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
michael@0 75
michael@0 76 private:
michael@0 77 lua_State* fL;
michael@0 78 SkString fFunc;
michael@0 79
michael@0 80 void sendverb(const char verb[]);
michael@0 81
michael@0 82 typedef SkCanvas INHERITED;
michael@0 83 };
michael@0 84
michael@0 85 #endif

mercurial