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

Unified Diff: tests/CanvasTest.cpp

Issue 136753016: remove (unused by chrome) SkDeferredCanvas(device) factory signature (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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 bddba59e0680da40278969ce9f9d2cbfdfe16855..55169cc344609b98c1f0964bf8e6e2d441c4f1ab 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -61,6 +61,7 @@
#include "SkRegion.h"
#include "SkShader.h"
#include "SkStream.h"
+#include "SkSurface.h"
#include "SkTDArray.h"
#include "Test.h"
@@ -140,6 +141,12 @@ static void createBitmap(SkBitmap* bm, SkBitmap::Config config, SkColor color) {
bm->eraseColor(color);
}
+static SkSurface* createSurface(SkColor color) {
+ SkSurface* surface = SkSurface::NewRasterPMColor(kWidth, kHeight);
+ surface->getCanvas()->clear(color);
+ return surface;
+}
+
class CanvasTestStep;
static SkTDArray<CanvasTestStep*>& testStepArray() {
static SkTDArray<CanvasTestStep*> theTests;
@@ -749,10 +756,9 @@ public:
CanvasTestStep* testStep,
const SkCanvas& referenceCanvas, bool silent) {
- SkBitmap deferredStore;
- createBitmap(&deferredStore, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF);
- SkBitmapDevice deferredDevice(deferredStore);
- SkAutoTUnref<SkDeferredCanvas> deferredCanvas(SkDeferredCanvas::Create(&deferredDevice));
+ SkAutoTUnref<SkSurface> surface(createSurface(0xFFFFFFFF));
+ SkAutoTUnref<SkDeferredCanvas> deferredCanvas(SkDeferredCanvas::Create(surface.get()));
+
testStep->setAssertMessageFormat(kDeferredDrawAssertMessageFormat);
testStep->draw(deferredCanvas, reporter);
testStep->setAssertMessageFormat(kDeferredPreFlushAssertMessageFormat);
« 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