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

Unified Diff: src/image/SkSurface_Gpu.cpp

Issue 1694943002: When a surface is backed by an external render target force a copy on image snap (Closed) Base URL: https://skia.googlesource.com/skia.git@imgcopy
Patch Set: Created 4 years, 10 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 | « src/gpu/GrResourceCache.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface_Gpu.cpp
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 7d98b31af58f19d6f39f52278dfed35fe2b571d2..86b8f3a66123b65c1034ca8975565a6422cd908c 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -81,8 +81,7 @@ SkImage* SkSurface_Gpu::onNewImageSnapshot(Budgeted budgeted, ForceCopyMode forc
SkASSERT(rt);
GrTexture* tex = rt->asTexture();
SkAutoTUnref<GrTexture> copy;
robertphillips 2016/02/24 13:11:54 // When clients wrap an external FBO in a Surface
bsalomon 2016/02/26 17:44:44 Added a comment.
- // TODO: Force a copy when the rt is an external resource.
- if (kYes_ForceCopyMode == forceCopyMode || !tex) {
+ if (kYes_ForceCopyMode == forceCopyMode || !tex || rt->resourcePriv().isExternal()) {
GrSurfaceDesc desc = fDevice->accessRenderTarget()->desc();
GrContext* ctx = fDevice->context();
desc.fFlags = desc.fFlags & !kRenderTarget_GrSurfaceFlag;
« no previous file with comments | « src/gpu/GrResourceCache.cpp ('k') | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698