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

Unified Diff: tests/SurfaceTest.cpp

Issue 14063015: Adding optimization to avoid image copy in SkSurface copy on write when content is discardable (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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/SurfaceTest.cpp
===================================================================
--- tests/SurfaceTest.cpp (revision 8710)
+++ tests/SurfaceTest.cpp (working copy)
@@ -148,14 +148,15 @@
}
static void TestSurfaceNoCanvas(skiatest::Reporter* reporter,
SurfaceType surfaceType,
- GrContext* context) {
+ GrContext* context,
+ SkSurface::ContentChangeMode mode) {
// Verifies the robustness of SkSurface for handling use cases where calls
// are made before a canvas is created.
{
// Test passes by not asserting
SkSurface* surface = createSurface(surfaceType, context);
SkAutoTUnref<SkSurface> aur_surface(surface);
- surface->notifyContentChanged();
+ surface->notifyContentWillChange(mode);
surface->validate();
}
{
@@ -165,7 +166,7 @@
SkAutoTUnref<SkImage> aur_image1(image1);
image1->validate();
surface->validate();
- surface->notifyContentChanged();
+ surface->notifyContentWillChange(mode);
image1->validate();
surface->validate();
SkImage* image2 = surface->newImageSnapshot();
@@ -182,13 +183,15 @@
TestSurfaceCopyOnWrite(reporter, kPicture_SurfaceType, NULL);
TestSurfaceWritableAfterSnapshotRelease(reporter, kRaster_SurfaceType, NULL);
TestSurfaceWritableAfterSnapshotRelease(reporter, kPicture_SurfaceType, NULL);
- TestSurfaceNoCanvas(reporter, kRaster_SurfaceType, NULL);
+ TestSurfaceNoCanvas(reporter, kRaster_SurfaceType, NULL, SkSurface::kDiscard_ContentChangeMode);
+ TestSurfaceNoCanvas(reporter, kRaster_SurfaceType, NULL, SkSurface::kRetain_ContentChangeMode);
#if SK_SUPPORT_GPU
if (NULL != factory) {
GrContext* context = factory->get(GrContextFactory::kNative_GLContextType);
TestSurfaceCopyOnWrite(reporter, kGpu_SurfaceType, context);
TestSurfaceWritableAfterSnapshotRelease(reporter, kGpu_SurfaceType, context);
- TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context);
+ TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface::kDiscard_ContentChangeMode);
+ TestSurfaceNoCanvas(reporter, kGpu_SurfaceType, context, SkSurface::kRetain_ContentChangeMode);
}
#endif
}
« 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