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: gm/xfermodes3.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 | « gm/surface.cpp ('k') | include/core/SkSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « gm/surface.cpp ('k') | include/core/SkSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698