aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkTileGrid.h
diff options
context:
space:
mode:
authorGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-27 18:35:16 +0000
committerGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-27 18:35:16 +0000
commit29b19e53cfac5af4f9bd5d361436d1097f349a34 (patch)
treef00138de9091031ecbb929f6800b080be8f7c02e /src/core/SkTileGrid.h
parentd1c53aae59ee44377be8bc0cc15e54d46aa530ce (diff)
Change SkTileGride geometry calculations to match the Chromium compositor.
This patch changes the semantics of tileWidth/Height to include the border region, and uses an offset to take into account the fact that there is no outer border for outer tiles. This patch also fixes a previous bug where the right column and bottom row were considered to be included in bounds that are expressed as an SkIRect. Companion Chromium CL required for roll: https://codereview.chromium.org/12221077/ TEST=TileGrid unit test Review URL: https://codereview.appspot.com/7350050 git-svn-id: http://skia.googlecode.com/svn/trunk@7885 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkTileGrid.h')
-rw-r--r--src/core/SkTileGrid.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/SkTileGrid.h b/src/core/SkTileGrid.h
index c0fd3ddaef..c83a0fd468 100644
--- a/src/core/SkTileGrid.h
+++ b/src/core/SkTileGrid.h
@@ -11,6 +11,7 @@
#include "SkBBoxHierarchy.h"
#include "SkPictureStateTree.h"
+#include "SkTileGridPicture.h" // for TileGridInfo
/**
* Subclass of SkBBoxHierarchy that stores elements in buckets that correspond
@@ -26,7 +27,7 @@ class SkTileGrid : public SkBBoxHierarchy {
public:
typedef void* (*SkTileGridNextDatumFunctionPtr)(SkTDArray<void*>** tileData, SkTDArray<int>& tileIndices);
- SkTileGrid(int tileWidth, int tileHeight, int xTileCount, int yTileCount, int borderPixels,
+ SkTileGrid(int xTileCount, int yTileCount, const SkTileGridPicture::TileGridInfo& info,
SkTileGridNextDatumFunctionPtr nextDatumFunction);
virtual ~SkTileGrid();
@@ -61,7 +62,8 @@ public:
private:
SkTDArray<void*>& tile(int x, int y);
- int fTileWidth, fTileHeight, fXTileCount, fYTileCount, fTileCount, fBorderPixels;
+ int fXTileCount, fYTileCount, fTileCount;
+ SkTileGridPicture::TileGridInfo fInfo;
SkTDArray<void*>* fTileData;
int fInsertionCount;
SkIRect fGridBounds;