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

Unified Diff: tests/DeferredCanvasTest.cpp

Issue 154163002: remove SkCanvas::createCompatibleDevice, and add SkCanvas::newSurface (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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
« include/core/SkCanvas.h ('K') | « src/utils/SkDeferredCanvas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/DeferredCanvasTest.cpp
diff --git a/tests/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp
index 0ab482b7ed0c013a3408ed67ec99deff860a864d..0386b51697e20815c81f323d5b3d4d8330086ef1 100644
--- a/tests/DeferredCanvasTest.cpp
+++ b/tests/DeferredCanvasTest.cpp
@@ -825,14 +825,14 @@ static void TestDeferredCanvasCreateCompatibleDevice(skiatest::Reporter* reporte
NotificationCounter notificationCounter;
canvas->setNotificationClient(&notificationCounter);
- SkAutoTUnref<SkBaseDevice> secondaryDevice(canvas->createCompatibleDevice(
- SkBitmap::kARGB_8888_Config, 10, 10, false));
- SkCanvas secondaryCanvas(secondaryDevice.get());
+ SkImageInfo info = SkImageInfo::MakeN32Premul(10, 10);
+ SkAutoTUnref<SkSurface> secondarySurface(canvas->newSurface(info));
+
SkRect rect = SkRect::MakeWH(5, 5);
SkPaint paint;
// After spawning a compatible canvas:
// 1) Verify that secondary canvas is usable and does not report to the notification client.
- secondaryCanvas.drawRect(rect, paint);
+ surface->getCanvas()->drawRect(rect, paint);
REPORTER_ASSERT(reporter, notificationCounter.fStorageAllocatedChangedCount == 0);
// 2) Verify that original canvas is usable and still reports to the notification client.
canvas->drawRect(rect, paint);
« include/core/SkCanvas.h ('K') | « src/utils/SkDeferredCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698