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

Unified Diff: tests/SurfaceTest.cpp

Issue 848903004: Require budget decision when creating a RenderTarget SkSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warning Created 5 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 | « tests/ResourceCacheTest.cpp ('k') | tools/PictureRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SurfaceTest.cpp
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index c09d97cabed17855b67c71ec1ea57b65b1e2f446..4816ffc1ac795fbc4b65c62e3971f3163e483c98 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -50,15 +50,9 @@ static SkSurface* createSurface(SurfaceType surfaceType, GrContext* context,
release_storage, storage);
}
case kGpu_SurfaceType:
-#if SK_SUPPORT_GPU
- return context ? SkSurface::NewRenderTarget(context, info, 0, NULL) : NULL;
-#endif
- break;
+ return SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, info, 0, NULL);
case kGpuScratch_SurfaceType:
-#if SK_SUPPORT_GPU
- return context ? SkSurface::NewScratchRenderTarget(context, info) : NULL;
-#endif
- break;
+ return SkSurface::NewRenderTarget(context, SkSurface::kYes_Budgeted, info, 0, NULL);
}
return NULL;
}
@@ -94,8 +88,8 @@ static void test_empty_surface(skiatest::Reporter* reporter, GrContext* ctx) {
REPORTER_ASSERT(reporter, NULL == SkSurface::NewRaster(info));
REPORTER_ASSERT(reporter, NULL == SkSurface::NewRasterDirect(info, NULL, 0));
if (ctx) {
- REPORTER_ASSERT(reporter, NULL == SkSurface::NewRenderTarget(ctx, info, 0, NULL));
- REPORTER_ASSERT(reporter, NULL == SkSurface::NewScratchRenderTarget(ctx, info, 0, NULL));
+ REPORTER_ASSERT(reporter, NULL ==
+ SkSurface::NewRenderTarget(ctx, SkSurface::kNo_Budgeted, info, 0, NULL));
}
}
@@ -129,7 +123,8 @@ static SkImage* createImage(ImageType imageType, GrContext* context, SkColor col
case kRasterData_ImageType:
return SkImage::NewRasterData(info, data, rowBytes);
case kGpu_ImageType: {
- SkAutoTUnref<SkSurface> surf(SkSurface::NewRenderTarget(context, info, 0));
+ SkAutoTUnref<SkSurface> surf(
+ SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, info, 0));
surf->getCanvas()->clear(color);
return surf->newImageSnapshot();
}
« no previous file with comments | « tests/ResourceCacheTest.cpp ('k') | tools/PictureRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698