aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-10-02 07:41:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-02 07:41:56 -0700
commit6bd41969a0f2283a7a7320bb0025551353c241ec (patch)
tree8f46646875b1d810ff4156f220ee2eb5d808f664 /tests
parent29fe24c0ed44c1ee8f21df16f4bdc058f27eab77 (diff)
BBHs: void* data -> unsigned data
Now that the old backend's not using BBHs, we can specialize them for SkRecord's needs. The only thing we really want to store is op index, which should always be small enough to fit into an unsigned (unsigned also helps keep it straight from other ints floating around). This means we'll need half (32-bit) or a quarter (64-bit) the bytes in SkTileGrid, because we don't have to store an extra int for ordering. BUG=skia:2834 Review URL: https://codereview.chromium.org/617393004
Diffstat (limited to 'tests')
-rw-r--r--tests/BBoxHierarchyTest.cpp170
-rw-r--r--tests/PictureTest.cpp13
-rw-r--r--tests/RTreeTest.cpp39
-rw-r--r--tests/RecordDrawTest.cpp39
-rw-r--r--tests/TileGridTest.cpp43
5 files changed, 61 insertions, 243 deletions
diff --git a/tests/BBoxHierarchyTest.cpp b/tests/BBoxHierarchyTest.cpp
deleted file mode 100644
index 71b96994f2..0000000000
--- a/tests/BBoxHierarchyTest.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "Test.h"
-#include "SkRandom.h"
-#include "SkRTree.h"
-#include "SkTSort.h"
-
-static const size_t RTREE_MIN_CHILDREN = 6;
-static const size_t RTREE_MAX_CHILDREN = 11;
-
-static const int NUM_RECTS = 200;
-static const size_t NUM_ITERATIONS = 100;
-static const size_t NUM_QUERIES = 50;
-
-static const SkScalar MAX_SIZE = 1000.0f;
-
-struct DataRect {
- SkRect rect;
- void* data;
-};
-
-static SkRect random_rect(SkRandom& rand) {
- SkRect rect = {0,0,0,0};
- while (rect.isEmpty()) {
- rect.fLeft = rand.nextRangeF(0, MAX_SIZE);
- rect.fRight = rand.nextRangeF(0, MAX_SIZE);
- rect.fTop = rand.nextRangeF(0, MAX_SIZE);
- rect.fBottom = rand.nextRangeF(0, MAX_SIZE);
- rect.sort();
- }
- return rect;
-}
-
-static void random_data_rects(SkRandom& rand, DataRect out[], int n) {
- for (int i = 0; i < n; ++i) {
- out[i].rect = random_rect(rand);
- out[i].data = reinterpret_cast<void*>(i);
- }
-}
-
-static bool verify_query(SkRect query, DataRect rects[],
- SkTDArray<void*>& found) {
- // TODO(mtklein): no need to do this after everything's SkRects
- query.roundOut();
-
- SkTDArray<void*> expected;
- // manually intersect with every rectangle
- for (int i = 0; i < NUM_RECTS; ++i) {
- if (SkRect::Intersects(query, rects[i].rect)) {
- expected.push(rects[i].data);
- }
- }
-
- if (expected.count() != found.count()) {
- return false;
- }
-
- if (0 == expected.count()) {
- return true;
- }
-
- // Just cast to long since sorting by the value of the void*'s was being problematic...
- SkTQSort(reinterpret_cast<long*>(expected.begin()),
- reinterpret_cast<long*>(expected.end() - 1));
- SkTQSort(reinterpret_cast<long*>(found.begin()),
- reinterpret_cast<long*>(found.end() - 1));
- return found == expected;
-}
-
-static void run_queries(skiatest::Reporter* reporter, SkRandom& rand, DataRect rects[],
- SkBBoxHierarchy& tree) {
- for (size_t i = 0; i < NUM_QUERIES; ++i) {
- SkTDArray<void*> hits;
- SkRect query = random_rect(rand);
- tree.search(query, &hits);
- REPORTER_ASSERT(reporter, verify_query(query, rects, hits));
- }
-}
-
-static void tree_test_main(SkBBoxHierarchy* tree, int minChildren, int maxChildren,
- skiatest::Reporter* reporter) {
- DataRect rects[NUM_RECTS];
- SkRandom rand;
- REPORTER_ASSERT(reporter, tree);
-
- int expectedDepthMin = -1;
- int expectedDepthMax = -1;
-
- int tmp = NUM_RECTS;
- if (maxChildren > 0) {
- while (tmp > 0) {
- tmp -= static_cast<int>(pow(static_cast<double>(maxChildren),
- static_cast<double>(expectedDepthMin + 1)));
- ++expectedDepthMin;
- }
- }
-
- tmp = NUM_RECTS;
- if (minChildren > 0) {
- while (tmp > 0) {
- tmp -= static_cast<int>(pow(static_cast<double>(minChildren),
- static_cast<double>(expectedDepthMax + 1)));
- ++expectedDepthMax;
- }
- }
-
- for (size_t i = 0; i < NUM_ITERATIONS; ++i) {
- random_data_rects(rand, rects, NUM_RECTS);
-
- // First try bulk-loaded inserts
- for (int i = 0; i < NUM_RECTS; ++i) {
- tree->insert(rects[i].data, rects[i].rect, true);
- }
- tree->flushDeferredInserts();
- run_queries(reporter, rand, rects, *tree);
- REPORTER_ASSERT(reporter, NUM_RECTS == tree->getCount());
- REPORTER_ASSERT(reporter,
- ((expectedDepthMin <= 0) || (expectedDepthMin <= tree->getDepth())) &&
- ((expectedDepthMax <= 0) || (expectedDepthMax >= tree->getDepth())));
- tree->clear();
- REPORTER_ASSERT(reporter, 0 == tree->getCount());
-
- // Then try immediate inserts
- tree->insert(rects[0].data, rects[0].rect);
- tree->flushDeferredInserts();
- for (int i = 1; i < NUM_RECTS; ++i) {
- tree->insert(rects[i].data, rects[i].rect);
- }
- run_queries(reporter, rand, rects, *tree);
- REPORTER_ASSERT(reporter, NUM_RECTS == tree->getCount());
- REPORTER_ASSERT(reporter,
- ((expectedDepthMin <= 0) || (expectedDepthMin <= tree->getDepth())) &&
- ((expectedDepthMax <= 0) || (expectedDepthMax >= tree->getDepth())));
- tree->clear();
- REPORTER_ASSERT(reporter, 0 == tree->getCount());
-
- // And for good measure try immediate inserts, but in reversed order
- tree->insert(rects[NUM_RECTS - 1].data, rects[NUM_RECTS - 1].rect);
- tree->flushDeferredInserts();
- for (int i = NUM_RECTS - 2; i >= 0; --i) {
- tree->insert(rects[i].data, rects[i].rect);
- }
- run_queries(reporter, rand, rects, *tree);
- REPORTER_ASSERT(reporter, NUM_RECTS == tree->getCount());
- REPORTER_ASSERT(reporter,
- ((expectedDepthMin < 0) || (expectedDepthMin <= tree->getDepth())) &&
- ((expectedDepthMax < 0) || (expectedDepthMax >= tree->getDepth())));
- tree->clear();
- REPORTER_ASSERT(reporter, 0 == tree->getCount());
- }
-}
-
-DEF_TEST(BBoxHierarchy, reporter) {
- // RTree
- {
- SkRTree* rtree = SkRTree::Create(RTREE_MIN_CHILDREN, RTREE_MAX_CHILDREN);
- SkAutoUnref au(rtree);
- tree_test_main(rtree, RTREE_MIN_CHILDREN, RTREE_MAX_CHILDREN, reporter);
-
- // Rtree that orders input rectangles on deferred insert.
- SkRTree* unsortedRtree = SkRTree::Create(RTREE_MIN_CHILDREN, RTREE_MAX_CHILDREN, 1, false);
- SkAutoUnref auo(unsortedRtree);
- tree_test_main(unsortedRtree, RTREE_MIN_CHILDREN, RTREE_MAX_CHILDREN, reporter);
- }
-}
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index c41b327dab..0518dd3333 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1865,17 +1865,16 @@ struct CountingBBH : public SkBBoxHierarchy {
CountingBBH() : searchCalls(0) {}
- virtual void search(const SkRect& query, SkTDArray<void*>* results) const {
+ virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE {
this->searchCalls++;
}
// All other methods unimplemented.
- virtual void insert(void* data, const SkRect& bounds, bool defer) {}
- virtual void flushDeferredInserts() {}
- virtual void clear() {}
- virtual int getCount() const { return 0; }
- virtual int getDepth() const { return 0; }
- virtual void rewindInserts() {}
+ virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer) SK_OVERRIDE {}
+ virtual void flushDeferredInserts() SK_OVERRIDE {}
+ virtual void clear() SK_OVERRIDE {}
+ virtual int getCount() const SK_OVERRIDE { return 0; }
+ virtual int getDepth() const SK_OVERRIDE { return 0; }
};
class SpoonFedBBHFactory : public SkBBHFactory {
diff --git a/tests/RTreeTest.cpp b/tests/RTreeTest.cpp
index 40af5fe55b..6e0622c2fb 100644
--- a/tests/RTreeTest.cpp
+++ b/tests/RTreeTest.cpp
@@ -17,11 +17,6 @@ static const int NUM_RECTS = 200;
static const size_t NUM_ITERATIONS = 100;
static const size_t NUM_QUERIES = 50;
-struct DataRect {
- SkRect rect;
- void* data;
-};
-
static SkRect random_rect(SkRandom& rand) {
SkRect rect = {0,0,0,0};
while (rect.isEmpty()) {
@@ -34,24 +29,22 @@ static SkRect random_rect(SkRandom& rand) {
return rect;
}
-static void random_data_rects(SkRandom& rand, DataRect out[], int n) {
+static void random_data_rects(SkRandom& rand, SkRect out[], int n) {
for (int i = 0; i < n; ++i) {
- out[i].rect = random_rect(rand);
- out[i].data = reinterpret_cast<void*>(i);
+ out[i] = random_rect(rand);
}
}
-static bool verify_query(SkRect query, DataRect rects[],
- SkTDArray<void*>& found) {
+static bool verify_query(SkRect query, SkRect rects[], SkTDArray<unsigned>& found) {
// TODO(mtklein): no need to do this after everything's SkRects
query.roundOut();
- SkTDArray<void*> expected;
+ SkTDArray<unsigned> expected;
// manually intersect with every rectangle
for (int i = 0; i < NUM_RECTS; ++i) {
- if (SkRect::Intersects(query, rects[i].rect)) {
- expected.push(rects[i].data);
+ if (SkRect::Intersects(query, rects[i])) {
+ expected.push(i);
}
}
@@ -63,18 +56,16 @@ static bool verify_query(SkRect query, DataRect rects[],
return true;
}
- // Just cast to long since sorting by the value of the void*'s was being problematic...
- SkTQSort(reinterpret_cast<long*>(expected.begin()),
- reinterpret_cast<long*>(expected.end() - 1));
- SkTQSort(reinterpret_cast<long*>(found.begin()),
- reinterpret_cast<long*>(found.end() - 1));
+ // skia:2834. RTree doesn't always return results in order.
+ SkTQSort(expected.begin(), expected.end() -1);
+ SkTQSort(found.begin(), found.end() -1);
return found == expected;
}
-static void run_queries(skiatest::Reporter* reporter, SkRandom& rand, DataRect rects[],
+static void run_queries(skiatest::Reporter* reporter, SkRandom& rand, SkRect rects[],
SkRTree& tree) {
for (size_t i = 0; i < NUM_QUERIES; ++i) {
- SkTDArray<void*> hits;
+ SkTDArray<unsigned> hits;
SkRect query = random_rect(rand);
tree.search(query, &hits);
REPORTER_ASSERT(reporter, verify_query(query, rects, hits));
@@ -82,7 +73,7 @@ static void run_queries(skiatest::Reporter* reporter, SkRandom& rand, DataRect r
}
static void rtree_test_main(SkRTree* rtree, skiatest::Reporter* reporter) {
- DataRect rects[NUM_RECTS];
+ SkRect rects[NUM_RECTS];
SkRandom rand;
REPORTER_ASSERT(reporter, rtree);
@@ -108,7 +99,7 @@ static void rtree_test_main(SkRTree* rtree, skiatest::Reporter* reporter) {
// First try bulk-loaded inserts
for (int i = 0; i < NUM_RECTS; ++i) {
- rtree->insert(rects[i].data, rects[i].rect, true);
+ rtree->insert(i, rects[i], true);
}
rtree->flushDeferredInserts();
run_queries(reporter, rand, rects, *rtree);
@@ -120,7 +111,7 @@ static void rtree_test_main(SkRTree* rtree, skiatest::Reporter* reporter) {
// Then try immediate inserts
for (int i = 0; i < NUM_RECTS; ++i) {
- rtree->insert(rects[i].data, rects[i].rect);
+ rtree->insert(i, rects[i]);
}
run_queries(reporter, rand, rects, *rtree);
REPORTER_ASSERT(reporter, NUM_RECTS == rtree->getCount());
@@ -131,7 +122,7 @@ static void rtree_test_main(SkRTree* rtree, skiatest::Reporter* reporter) {
// And for good measure try immediate inserts, but in reversed order
for (int i = NUM_RECTS - 1; i >= 0; --i) {
- rtree->insert(rects[i].data, rects[i].rect);
+ rtree->insert(i, rects[i]);
}
run_queries(reporter, rand, rects, *rtree);
REPORTER_ASSERT(reporter, NUM_RECTS == rtree->getCount());
diff --git a/tests/RecordDrawTest.cpp b/tests/RecordDrawTest.cpp
index 33efbd83ad..ac3883b2d6 100644
--- a/tests/RecordDrawTest.cpp
+++ b/tests/RecordDrawTest.cpp
@@ -98,24 +98,23 @@ DEF_TEST(RecordDraw_SetMatrixClobber, r) {
}
struct TestBBH : public SkBBoxHierarchy {
- virtual void insert(void* data, const SkRect& bounds, bool defer) SK_OVERRIDE {
- Entry e = { (uintptr_t)data, bounds };
- entries.push(e);
+ virtual void insert(unsigned opIndex, const SkRect& bounds, bool defer) SK_OVERRIDE {
+ Entry e = { opIndex, bounds };
+ fEntries.push(e);
}
- virtual int getCount() const SK_OVERRIDE { return entries.count(); }
+ virtual int getCount() const SK_OVERRIDE { return fEntries.count(); }
virtual void flushDeferredInserts() SK_OVERRIDE {}
- virtual void search(const SkRect& query, SkTDArray<void*>* results) const SK_OVERRIDE {}
+ virtual void search(const SkRect& query, SkTDArray<unsigned>* results) const SK_OVERRIDE {}
virtual void clear() SK_OVERRIDE {}
- virtual void rewindInserts() SK_OVERRIDE {}
virtual int getDepth() const SK_OVERRIDE { return -1; }
struct Entry {
- uintptr_t data;
+ unsigned opIndex;
SkRect bounds;
};
- SkTDArray<Entry> entries;
+ SkTDArray<Entry> fEntries;
};
// Like a==b, with a little slop recognizing that float equality can be weird.
@@ -140,11 +139,11 @@ DEF_TEST(RecordDraw_BBH, r) {
TestBBH bbh;
SkRecordFillBounds(record, &bbh);
- REPORTER_ASSERT(r, bbh.entries.count() == 5);
- for (int i = 0; i < bbh.entries.count(); i++) {
- REPORTER_ASSERT(r, bbh.entries[i].data == (uintptr_t)i);
+ REPORTER_ASSERT(r, bbh.fEntries.count() == 5);
+ for (int i = 0; i < bbh.fEntries.count(); i++) {
+ REPORTER_ASSERT(r, bbh.fEntries[i].opIndex == (unsigned)i);
- REPORTER_ASSERT(r, sloppy_rect_eq(SkRect::MakeWH(400, 480), bbh.entries[i].bounds));
+ REPORTER_ASSERT(r, sloppy_rect_eq(SkRect::MakeWH(400, 480), bbh.fEntries[i].bounds));
}
}
@@ -165,13 +164,13 @@ DEF_TEST(RecordDraw_TextBounds, r) {
TestBBH bbh;
SkRecordFillBounds(record, &bbh);
- REPORTER_ASSERT(r, bbh.entries.count() == 2);
+ REPORTER_ASSERT(r, bbh.fEntries.count() == 2);
// We can make these next assertions confidently because SkRecordFillBounds
// builds its bounds by overestimating font metrics in a platform-independent way.
// If that changes, these tests will need to be more flexible.
- REPORTER_ASSERT(r, sloppy_rect_eq(bbh.entries[0].bounds, SkRect::MakeLTRB(-86, 6, 116, 54)));
- REPORTER_ASSERT(r, sloppy_rect_eq(bbh.entries[1].bounds, SkRect::MakeLTRB(-56, 26, 156, 94)));
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[0].bounds, SkRect::MakeLTRB(-86, 6, 116, 54)));
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[1].bounds, SkRect::MakeLTRB(-56, 26, 156, 94)));
}
// Base test to ensure start/stop range is respected
@@ -252,9 +251,9 @@ DEF_TEST(RecordDraw_SaveLayerAffectsClipBounds, r) {
// The saveLayer, clipRect, and restore bounds were incorrectly (0,0,70,50).
TestBBH bbh;
SkRecordFillBounds(record, &bbh);
- REPORTER_ASSERT(r, bbh.entries.count() == 4);
- REPORTER_ASSERT(r, sloppy_rect_eq(bbh.entries[0].bounds, SkRect::MakeLTRB(0, 0, 50, 50)));
- REPORTER_ASSERT(r, sloppy_rect_eq(bbh.entries[1].bounds, SkRect::MakeLTRB(0, 0, 50, 50)));
- REPORTER_ASSERT(r, sloppy_rect_eq(bbh.entries[2].bounds, SkRect::MakeLTRB(0, 0, 40, 40)));
- REPORTER_ASSERT(r, sloppy_rect_eq(bbh.entries[3].bounds, SkRect::MakeLTRB(0, 0, 50, 50)));
+ REPORTER_ASSERT(r, bbh.fEntries.count() == 4);
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[0].bounds, SkRect::MakeLTRB(0, 0, 50, 50)));
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[1].bounds, SkRect::MakeLTRB(0, 0, 50, 50)));
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[2].bounds, SkRect::MakeLTRB(0, 0, 40, 40)));
+ REPORTER_ASSERT(r, sloppy_rect_eq(bbh.fEntries[3].bounds, SkRect::MakeLTRB(0, 0, 50, 50)));
}
diff --git a/tests/TileGridTest.cpp b/tests/TileGridTest.cpp
index 16434abdc6..6529901dcc 100644
--- a/tests/TileGridTest.cpp
+++ b/tests/TileGridTest.cpp
@@ -31,14 +31,14 @@ public:
SkTDArray<SkRect> fRects;
};
-static void verifyTileHits(skiatest::Reporter* reporter, SkRect rect,
- uint32_t tileMask, int borderPixels = 0) {
+static void verify_tile_hits(skiatest::Reporter* reporter, SkRect rect,
+ uint32_t tileMask, int borderPixels = 0) {
SkTileGridFactory::TileGridInfo info;
info.fMargin.set(borderPixels, borderPixels);
info.fOffset.setZero();
info.fTileInterval.set(10 - 2 * borderPixels, 10 - 2 * borderPixels);
SkTileGrid grid(2, 2, info);
- grid.insert(NULL, rect, false);
+ grid.insert(0, rect, false);
REPORTER_ASSERT(reporter, grid.tileCount(0, 0) ==
((tileMask & kTopLeft_Tile)? 1 : 0));
REPORTER_ASSERT(reporter, grid.tileCount(1, 0) ==
@@ -223,29 +223,28 @@ DEF_TEST(TileGrid_OverlapOffsetQueryAlignment, reporter) {
DEF_TEST(TileGrid, reporter) {
// Out of bounds
- verifyTileHits(reporter, SkRect::MakeXYWH(30, 0, 1, 1), 0);
- verifyTileHits(reporter, SkRect::MakeXYWH(0, 30, 1, 1), 0);
- verifyTileHits(reporter, SkRect::MakeXYWH(-10, 0, 1, 1), 0);
- verifyTileHits(reporter, SkRect::MakeXYWH(0, -10, 1, 1), 0);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(30, 0, 1, 1), 0);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(0, 30, 1, 1), 0);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(-10, 0, 1, 1), 0);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(0, -10, 1, 1), 0);
// Dilation for AA consideration
- verifyTileHits(reporter, SkRect::MakeXYWH(0, 0, 9, 9), kTopLeft_Tile);
- verifyTileHits(reporter, SkRect::MakeXYWH(0, 0, 10, 10), kAll_Tile);
- verifyTileHits(reporter, SkRect::MakeXYWH(9, 9, 1, 1), kAll_Tile);
- verifyTileHits(reporter, SkRect::MakeXYWH(10, 10, 1, 1), kAll_Tile);
- verifyTileHits(reporter, SkRect::MakeXYWH(11, 11, 1, 1), kBottomRight_Tile);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(0, 0, 9, 9), kTopLeft_Tile);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(0, 0, 10, 10), kAll_Tile);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(9, 9, 1, 1), kAll_Tile);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(10, 10, 1, 1), kAll_Tile);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(11, 11, 1, 1), kBottomRight_Tile);
// BorderPixels
- verifyTileHits(reporter, SkRect::MakeXYWH(0, 0, 6, 6), kTopLeft_Tile, 1);
- verifyTileHits(reporter, SkRect::MakeXYWH(0, 0, 7, 7), kAll_Tile, 1);
- verifyTileHits(reporter, SkRect::MakeXYWH(9, 9, 1, 1), kAll_Tile, 1);
- verifyTileHits(reporter, SkRect::MakeXYWH(10, 10, 1, 1), kBottomRight_Tile, 1);
- verifyTileHits(reporter, SkRect::MakeXYWH(17, 17, 1, 1), kBottomRight_Tile, 1);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(0, 0, 6, 6), kTopLeft_Tile, 1);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(0, 0, 7, 7), kAll_Tile, 1);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(9, 9, 1, 1), kAll_Tile, 1);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(10, 10, 1, 1), kBottomRight_Tile, 1);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(17, 17, 1, 1), kBottomRight_Tile, 1);
// BBoxes that overlap tiles
- verifyTileHits(reporter, SkRect::MakeXYWH(5, 5, 10, 1), kTopLeft_Tile | kTopRight_Tile);
- verifyTileHits(reporter, SkRect::MakeXYWH(5, 5, 1, 10), kTopLeft_Tile |
- kBottomLeft_Tile);
- verifyTileHits(reporter, SkRect::MakeXYWH(5, 5, 10, 10), kAll_Tile);
- verifyTileHits(reporter, SkRect::MakeXYWH(-10, -10, 40, 40), kAll_Tile);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(5, 5, 10, 1), kTopLeft_Tile | kTopRight_Tile);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(5, 5, 1, 10), kTopLeft_Tile | kBottomLeft_Tile);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(5, 5, 10, 10), kAll_Tile);
+ verify_tile_hits(reporter, SkRect::MakeXYWH(-10, -10, 40, 40),kAll_Tile);
}