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 |