Index: gm/xfermodes3.cpp |
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp |
index c385e41d3afa0e76665fd57d16c2c178b0ba8a09..ffbee1c042b93ea9fd05bbc163bdd4d9b215e349 100644 |
--- a/gm/xfermodes3.cpp |
+++ b/gm/xfermodes3.cpp |
@@ -125,18 +125,13 @@ private: |
SkCanvas* tempCanvas = NULL; |
#if SK_SUPPORT_GPU |
GrContext* context = baseCanvas->getGrContext(); |
- if (context) { |
- GrSurfaceDesc desc; |
- desc.fWidth = w; |
- desc.fHeight = h; |
- desc.fConfig = SkImageInfo2GrPixelConfig(baseCanvas->imageInfo()); |
- desc.fFlags = kRenderTarget_GrSurfaceFlag; |
- SkAutoTUnref<GrSurface> surface(context->createUncachedTexture(desc, NULL, 0)); |
- SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(surface.get(), |
- SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType))); |
- if (device.get()) { |
- tempCanvas = SkNEW_ARGS(SkCanvas, (device.get())); |
- } |
+ SkImageInfo baseInfo = baseCanvas->imageInfo(); |
+ SkImageInfo info = SkImageInfo::Make(w, h, baseInfo.colorType(), baseInfo.alphaType(), |
+ baseInfo.profileType()); |
+ SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, |
+ info, 0, NULL)); |
+ if (surface) { |
+ tempCanvas = SkRef(surface->getCanvas()); |
} |
#endif |
return tempCanvas; |