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); |