aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-20 19:35:43 +0000
committerGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-20 19:35:43 +0000
commitfb10389403cf1cc771e103016207fde84c5f4825 (patch)
tree8cd372eadb4eaa6f7b82cf5360ba03e1b58fb08d /tests
parent84d320e258bb99ab7b5435f9954d3fbdd45e90f9 (diff)
Adding a silent playback option to SkGPipeRead
Testing state consistency after silent playback in CanvasTest indirectly through SkDeferredCanvas. BUG=http://code.google.com/p/chromium/issues/detail?id=146178 TEST=CanvasTest unit test, and bench with --mode deferredSilent Review URL: https://codereview.appspot.com/6542047 git-svn-id: http://skia.googlecode.com/svn/trunk@5619 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/CanvasTest.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 9449bfe61e..fd62893392 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -125,6 +125,8 @@ static const char* const kDeferredPreFlushAssertMessageFormat =
"test step %s, SkDeferredCanvas state consistency before flush";
static const char* const kDeferredPostFlushPlaybackAssertMessageFormat =
"test step %s, SkDeferredCanvas playback canvas state consistency after flush";
+static const char* const kDeferredPostSilentFlushPlaybackAssertMessageFormat =
+ "test step %s, SkDeferredCanvas playback canvas state consistency after silent flush";
static const char* const kDeferredPostFlushAssertMessageFormat =
"test step %s, SkDeferredCanvas state consistency after flush";
static const char* const kPictureResourceReuseMessageFormat =
@@ -738,7 +740,7 @@ public:
static void TestDeferredCanvasStateConsistency(
skiatest::Reporter* reporter,
CanvasTestStep* testStep,
- const SkCanvas& referenceCanvas) {
+ const SkCanvas& referenceCanvas, bool silent) {
SkBitmap deferredStore;
createBitmap(&deferredStore, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF);
@@ -750,8 +752,14 @@ public:
AssertCanvasStatesEqual(reporter, &deferredCanvas, &referenceCanvas,
testStep);
- deferredCanvas.flush();
- testStep->setAssertMessageFormat(
+ if (silent) {
+ deferredCanvas.silentFlush();
+ } else {
+ deferredCanvas.flush();
+ }
+
+ testStep->setAssertMessageFormat(
+ silent ? kDeferredPostSilentFlushPlaybackAssertMessageFormat :
kDeferredPostFlushPlaybackAssertMessageFormat);
AssertCanvasStatesEqual(reporter,
deferredCanvas.immediateCanvas(),
@@ -844,7 +852,9 @@ static void TestOverrideStateConsistency(skiatest::Reporter* reporter,
testStep->setAssertMessageFormat(kCanvasDrawAssertMessageFormat);
testStep->draw(&referenceCanvas, reporter);
- SkDeferredCanvasTester::TestDeferredCanvasStateConsistency(reporter, testStep, referenceCanvas);
+ SkDeferredCanvasTester::TestDeferredCanvasStateConsistency(reporter, testStep, referenceCanvas, false);
+
+ SkDeferredCanvasTester::TestDeferredCanvasStateConsistency(reporter, testStep, referenceCanvas, true);
// The following test code is disabled because SkProxyCanvas is
// missing a lot of virtual overrides on get* methods, which are used