Chromium Code Reviews| Index: gm/xfermodes3.cpp |
| diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp |
| index c385e41d3afa0e76665fd57d16c2c178b0ba8a09..490ac196562c18e121f8b20db86aa6e02f64ee1a 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(); |
|
robertphillips
2015/01/15 20:48:17
info -> baseInfo in this line?
bsalomon
2015/01/15 21:14:05
d'oh
|
| + SkImageInfo info = SkImageInfo::Make(w, h, info.colorType(), info.alphaType(), |
| + info.profileType()); |
| + SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, |
| + info, 0, NULL)); |
| + if (surface) { |
| + tempCanvas = SkRef(surface->getCanvas()); |
| } |
| #endif |
| return tempCanvas; |