gfx/skia/trunk/src/utils/SkCanvasStack.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 2013 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
michael@0 9 #ifndef SkCanvasStack_DEFINED
michael@0 10 #define SkCanvasStack_DEFINED
michael@0 11
michael@0 12 #include "SkNWayCanvas.h"
michael@0 13 #include "SkTArray.h"
michael@0 14
michael@0 15 class SkCanvasStack : public SkNWayCanvas {
michael@0 16 public:
michael@0 17 SkCanvasStack(int width, int height);
michael@0 18 virtual ~SkCanvasStack();
michael@0 19
michael@0 20 void pushCanvas(SkCanvas* canvas, const SkIPoint& origin);
michael@0 21 virtual void removeAll() SK_OVERRIDE;
michael@0 22
michael@0 23 /*
michael@0 24 * The following add/remove canvas methods are overrides from SkNWayCanvas
michael@0 25 * that do not make sense in the context of our CanvasStack, but since we
michael@0 26 * can share most of the other implementation of NWay we override those
michael@0 27 * methods to be no-ops.
michael@0 28 */
michael@0 29 virtual void addCanvas(SkCanvas*) SK_OVERRIDE { SkDEBUGFAIL("Invalid Op"); }
michael@0 30 virtual void removeCanvas(SkCanvas*) SK_OVERRIDE { SkDEBUGFAIL("Invalid Op"); }
michael@0 31
michael@0 32 protected:
michael@0 33 virtual void didSetMatrix(const SkMatrix&) SK_OVERRIDE;
michael@0 34
michael@0 35 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
michael@0 36 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
michael@0 37 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
michael@0 38 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
michael@0 39
michael@0 40 private:
michael@0 41 void clipToZOrderedBounds();
michael@0 42
michael@0 43 struct CanvasData {
michael@0 44 SkIPoint origin;
michael@0 45 SkRegion requiredClip;
michael@0 46 };
michael@0 47
michael@0 48 SkTArray<CanvasData> fCanvasData;
michael@0 49
michael@0 50 typedef SkNWayCanvas INHERITED;
michael@0 51 };
michael@0 52
michael@0 53 #endif

mercurial