gfx/skia/trunk/include/core/SkTileGridPicture.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 2012 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 SkTileGridPicture_DEFINED
michael@0 9 #define SkTileGridPicture_DEFINED
michael@0 10
michael@0 11 #include "SkPicture.h"
michael@0 12 #include "SkPoint.h"
michael@0 13 #include "SkSize.h"
michael@0 14
michael@0 15 /**
michael@0 16 * Subclass of SkPicture that override the behavior of the
michael@0 17 * kOptimizeForClippedPlayback_RecordingFlag by creating an SkTileGrid
michael@0 18 * structure rather than an R-Tree. The tile grid has lower recording
michael@0 19 * and playback costs, but is less effective at eliminating extraneous
michael@0 20 * primitives for arbitrary query rectangles. It is most effective for
michael@0 21 * tiled playback when the tile structure is known at record time.
michael@0 22 */
michael@0 23 class SK_API SkTileGridPicture : public SkPicture {
michael@0 24 public:
michael@0 25 struct TileGridInfo {
michael@0 26 /** Tile placement interval */
michael@0 27 SkISize fTileInterval;
michael@0 28
michael@0 29 /** Pixel coverage overlap between adjacent tiles */
michael@0 30 SkISize fMargin;
michael@0 31
michael@0 32 /** Offset added to device-space bounding box positions to convert
michael@0 33 * them to tile-grid space. This can be used to adjust the "phase"
michael@0 34 * of the tile grid to match probable query rectangles that will be
michael@0 35 * used to search into the tile grid. As long as the offset is smaller
michael@0 36 * or equal to the margin, there is no need to extend the domain of
michael@0 37 * the tile grid to prevent data loss.
michael@0 38 */
michael@0 39 SkIPoint fOffset;
michael@0 40 };
michael@0 41 /**
michael@0 42 * Constructor
michael@0 43 * @param width recording canvas width in device pixels
michael@0 44 * @param height recording canvas height in device pixels
michael@0 45 * @param info description of the tiling layout
michael@0 46 */
michael@0 47 SkTileGridPicture(int width, int height, const TileGridInfo& info);
michael@0 48
michael@0 49 virtual SkBBoxHierarchy* createBBoxHierarchy() const SK_OVERRIDE;
michael@0 50
michael@0 51 private:
michael@0 52 int fXTileCount, fYTileCount;
michael@0 53 TileGridInfo fInfo;
michael@0 54 };
michael@0 55
michael@0 56 #endif

mercurial