Fixing logic error in deferred canvas unittest.
authorjunov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 10 Dec 2012 21:24:38 +0000 (21:24 +0000)
committerjunov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 10 Dec 2012 21:24:38 +0000 (21:24 +0000)
Fixing an inverted test condition.  The tested feature is not broken, but the test was passing the inverted test because code just above was missing a restore call, which was affecting the test.
Review URL: https://codereview.appspot.com/6921044

git-svn-id: http://skia.googlecode.com/svn/trunk@6745 2bbb7eff-a529-9590-31e7-b0007b416f81

tests/DeferredCanvasTest.cpp

index 6cc3b08..d527ea3 100644 (file)
@@ -163,6 +163,7 @@ static void TestDeferredCanvasFreshFrame(skiatest::Reporter* reporter) {
         paint.setStyle(SkPaint::kFill_Style);
         paint.setAlpha(255);
         canvas.drawRect(fullRect, paint);
+        canvas.restore();
         REPORTER_ASSERT(reporter, !canvas.isFreshFrame());
     }
 
@@ -182,7 +183,7 @@ static void TestDeferredCanvasFreshFrame(skiatest::Reporter* reporter) {
         paint.setAlpha( 100 );
         paint.setXfermodeMode(SkXfermode::kSrc_Mode);
         canvas.drawRect(fullRect, paint);
-        REPORTER_ASSERT(reporter, !canvas.isFreshFrame());
+        REPORTER_ASSERT(reporter, canvas.isFreshFrame());
     }
 }