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

Unified Diff: tests/DeferredCanvasTest.cpp

Issue 214803002: Making SkDeferredCanvas::silentFlush trigger a skippedPendingDrawCommands callback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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') | 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 0af0c51fede0db8c98dbf063cdf2794a94b583ee..13758a768d664e1abd176f6aaea0da3ec4c9dbc4 100644
--- a/tests/DeferredCanvasTest.cpp
+++ b/tests/DeferredCanvasTest.cpp
@@ -496,6 +496,19 @@ static void TestDeferredCanvasMemoryLimit(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, 1 == notificationCounter.fFlushedDrawCommandsCount);
}
+static void TestDeferredCanvasSilentFlush(skiatest::Reporter* reporter) {
+ SkAutoTUnref<SkSurface> surface(createSurface(0));
+ SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(surface.get()));
+
+ NotificationCounter notificationCounter;
+ canvas->setNotificationClient(&notificationCounter);
+
+ canvas->silentFlush(); // will skip the initial clear that was recorded in createSurface
+
+ REPORTER_ASSERT(reporter, 0 == notificationCounter.fFlushedDrawCommandsCount);
+ REPORTER_ASSERT(reporter, 1 == notificationCounter.fSkippedPendingDrawCommandsCount);
+}
+
static void TestDeferredCanvasBitmapCaching(skiatest::Reporter* reporter) {
SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterPMColor(100, 100));
SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(surface.get()));
@@ -806,6 +819,7 @@ static void TestDeferredCanvasCreateCompatibleDevice(skiatest::Reporter* reporte
DEF_GPUTEST(DeferredCanvas, reporter, factory) {
TestDeferredCanvasBitmapAccess(reporter);
TestDeferredCanvasFlush(reporter);
+ TestDeferredCanvasSilentFlush(reporter);
TestDeferredCanvasFreshFrame(reporter);
TestDeferredCanvasMemoryLimit(reporter);
TestDeferredCanvasBitmapCaching(reporter);
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698