Revert "Avoid re-rendering stencil clip for every draw with reducable clip stack"
This reverts commit 92a7d4bf6a371f1f864154be902e8d86938e560b.
Revert "fix mac 10.6 build"
This reverts commit 114cd1a9f2734aaed6914718814364811b78bd7f.
BUG=
Review URL: https://codereview.chromium.org/54543008
git-svn-id: http://skia.googlecode.com/svn/trunk@12087 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/ClipCacheTest.cpp b/tests/ClipCacheTest.cpp
index 070f8eb..fab1f58 100644
--- a/tests/ClipCacheTest.cpp
+++ b/tests/ClipCacheTest.cpp
@@ -106,6 +106,7 @@
const SkClipStack& clip,
GrTexture* mask,
const SkIRect& bound) {
+ SkClipStack cacheClip;
REPORTER_ASSERT(reporter, clip.getTopmostGenID() == cache.getLastClipGenID());
REPORTER_ASSERT(reporter, mask == cache.getLastMask());
@@ -115,19 +116,6 @@
REPORTER_ASSERT(reporter, bound == cacheBound);
}
-static void check_empty_state(skiatest::Reporter* reporter,
- const GrClipMaskCache& cache) {
- REPORTER_ASSERT(reporter, SkClipStack::kInvalidGenID == cache.getLastClipGenID());
- REPORTER_ASSERT(reporter, NULL == cache.getLastMask());
-
- SkIRect emptyBound;
- emptyBound.setEmpty();
-
- SkIRect cacheBound;
- cache.getLastBound(&cacheBound);
- REPORTER_ASSERT(reporter, emptyBound == cacheBound);
-}
-
////////////////////////////////////////////////////////////////////////////////
// basic test of the cache's base functionality:
// push, pop, set, canReuse & getters
@@ -140,8 +128,14 @@
cache.setContext(context);
+ SkClipStack emptyClip;
+ emptyClip.reset();
+
+ SkIRect emptyBound;
+ emptyBound.setEmpty();
+
// check initial state
- check_empty_state(reporter, cache);
+ check_state(reporter, cache, emptyClip, NULL, emptyBound);
// set the current state
SkIRect bound1;
@@ -171,7 +165,7 @@
cache.push();
// verify that the pushed state is initially empty
- check_empty_state(reporter, cache);
+ check_state(reporter, cache, emptyClip, NULL, emptyBound);
REPORTER_ASSERT(reporter, texture1->getRefCnt());
// modify the new state
@@ -208,7 +202,7 @@
cache.reset();
// verify it is now empty
- check_empty_state(reporter, cache);
+ check_state(reporter, cache, emptyClip, NULL, emptyBound);
// pop again - so there is no state
cache.pop();
@@ -216,7 +210,7 @@
#if !defined(SK_DEBUG)
// verify that the getters don't crash
// only do in release since it generates asserts in debug
- check_empty_state(reporter, cache);
+ check_state(reporter, cache, emptyClip, NULL, emptyBound);
#endif
}