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

Unified Diff: tools/PictureRenderer.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/SurfaceTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/PictureRenderer.cpp
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp
index 0d7e14c794843a8cd65eb59690279db48321e331..dc672f013b9af2f6b78a4feea4aa973e99398c5a 100644
--- a/tools/PictureRenderer.cpp
+++ b/tools/PictureRenderer.cpp
@@ -157,16 +157,14 @@ SkCanvas* PictureRenderer::setupCanvas(int width, int height) {
desc.fSampleCnt = fSampleCount;
target.reset(fGrContext->createUncachedTexture(desc, NULL, 0));
}
- if (NULL == target.get()) {
- SkASSERT(0);
+
+ uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts_Flag : 0;
+ SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType);
+ SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target->asRenderTarget(), &props));
+ if (!device) {
return NULL;
}
-
- uint32_t flags = fUseDFText ? SkGpuDevice::kDFText_Flag : 0;
- SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target,
- SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType),
- flags));
- canvas = SkNEW_ARGS(SkCanvas, (device.get()));
+ canvas = SkNEW_ARGS(SkCanvas, (device));
break;
}
#endif
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698