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

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: Address initial comments 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..e8ee54879af20fdf24fd149b83a3d7d7f99678c1 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -51,12 +51,18 @@ static SkSurface* createSurface(SurfaceType surfaceType, GrContext* context,
}
case kGpu_SurfaceType:
#if SK_SUPPORT_GPU
robertphillips 2015/01/15 21:30:36 Do we need the "if (context) {" check any more ?
bsalomon 2015/01/15 22:15:50 good point, gonzo Actually don't need the #if SK_
- return context ? SkSurface::NewRenderTarget(context, info, 0, NULL) : NULL;
+ if (context) {
+ return SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, info, 0, NULL);
+ }
+ return NULL;
#endif
break;
case kGpuScratch_SurfaceType:
#if SK_SUPPORT_GPU
- return context ? SkSurface::NewScratchRenderTarget(context, info) : NULL;
+ if (context) {
+ return SkSurface::NewRenderTarget(context, SkSurface::kYes_Budgeted, info, 0, NULL);
+ }
+ return NULL;
#endif
break;
}
@@ -94,8 +100,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 +135,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