Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: tests/CanvasTest.cpp

Issue 1269093002: remove SkDeferredCanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CanvasTest.cpp
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 5aa3d4662863efb96a4fd0d00d6e8e3b8b851ef5..c80e6bef95c6da4918b50c4c3b949dbaa70dfb04 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -46,7 +46,6 @@
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkClipStack.h"
-#include "SkDeferredCanvas.h"
#include "SkDevice.h"
#include "SkDocument.h"
#include "SkMatrix.h"
@@ -72,12 +71,6 @@ static void createBitmap(SkBitmap* bm, SkColor color) {
bm->eraseColor(color);
}
-static SkSurface* createSurface(SkColor color) {
- SkSurface* surface = SkSurface::NewRasterN32Premul(kWidth, kHeight);
- surface->getCanvas()->clear(color);
- return surface;
-}
-
///////////////////////////////////////////////////////////////////////////////
// Constants used by test steps
const SkPoint kTestPoints[] = {
@@ -239,16 +232,8 @@ static void test_clipstack(skiatest::Reporter* reporter) {
static const char* const kDefaultAssertMessageFormat = "%s";
static const char* const kCanvasDrawAssertMessageFormat =
"Drawing test step %s with SkCanvas";
-static const char* const kDeferredDrawAssertMessageFormat =
- "Drawing test step %s with SkDeferredCanvas";
static const char* const kNWayDrawAssertMessageFormat =
"Drawing test step %s with SkNWayCanvas";
-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 kNWayStateAssertMessageFormat =
"test step %s, SkNWayCanvas state consistency";
static const char* const kNWayIndirect1StateAssertMessageFormat =
@@ -586,49 +571,6 @@ static void TestPdfDevice(skiatest::Reporter* reporter,
REPORTER_ASSERT(reporter, doc->close());
}
-// The following class groups static functions that need to access
-// the privates members of SkDeferredCanvas
-class SkDeferredCanvasTester {
-public:
- static void TestDeferredCanvasStateConsistency(
- skiatest::Reporter* reporter,
- const TestData& d,
- CanvasTestStep* testStep,
- const SkCanvas& referenceCanvas, bool silent) {
-
- SkAutoTUnref<SkSurface> surface(createSurface(0xFFFFFFFF));
- SkAutoTUnref<SkDeferredCanvas> deferredCanvas(SkDeferredCanvas::Create(surface.get()));
-
- testStep->setAssertMessageFormat(kDeferredDrawAssertMessageFormat);
- testStep->draw(deferredCanvas, d, reporter);
- testStep->setAssertMessageFormat(kDeferredPreFlushAssertMessageFormat);
- AssertCanvasStatesEqual(reporter, d, deferredCanvas, &referenceCanvas, testStep);
-
- if (silent) {
- deferredCanvas->silentFlush();
- } else {
- deferredCanvas->flush();
- }
-
- testStep->setAssertMessageFormat(
- silent ? kDeferredPostSilentFlushPlaybackAssertMessageFormat :
- kDeferredPostFlushPlaybackAssertMessageFormat);
- AssertCanvasStatesEqual(reporter, d, deferredCanvas->immediateCanvas(),
- &referenceCanvas, testStep);
-
- // Verified that deferred canvas state is not affected by flushing
- // pending draw operations
-
- // The following test code is commented out because it currently fails.
- // Issue: http://code.google.com/p/skia/issues/detail?id=496
- /*
- testStep->setAssertMessageFormat(kDeferredPostFlushAssertMessageFormat);
- AssertCanvasStatesEqual(reporter, &deferredCanvas, &referenceCanvas,
- testStep);
- */
- }
-};
-
// unused
static void TestNWayCanvasStateConsistency(
skiatest::Reporter* reporter,
@@ -675,10 +617,6 @@ static void TestOverrideStateConsistency(skiatest::Reporter* reporter, const Tes
testStep->setAssertMessageFormat(kCanvasDrawAssertMessageFormat);
testStep->draw(&referenceCanvas, d, reporter);
- SkDeferredCanvasTester::TestDeferredCanvasStateConsistency(reporter, d, testStep, referenceCanvas, false);
-
- SkDeferredCanvasTester::TestDeferredCanvasStateConsistency(reporter, d, testStep, referenceCanvas, true);
-
// The following test code is disabled because SkNWayCanvas does not
// report correct clipping and device bounds information
// Issue: http://code.google.com/p/skia/issues/detail?id=501
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698