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

Unified Diff: src/image/SkSurface_Gpu.cpp

Issue 1954103002: Revert of Retract GrRenderTarget a bit within SkGpuDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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/SkGpuDevice.cpp ('k') | no next file » | 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 1e4bd87661a1a0ec10562ec8f86e6fc216b51dfd..110d614d9b311dbee70ffc179ade7719f94eac97 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -68,7 +68,8 @@
}
sk_sp<SkSurface> SkSurface_Gpu::onNewSurface(const SkImageInfo& info) {
- int sampleCount = fDevice->accessDrawContext()->numColorSamples();
+ GrRenderTarget* rt = fDevice->accessRenderTarget();
+ int sampleCount = rt->numColorSamples();
// TODO: Make caller specify this (change virtual signature of onNewSurface).
static const SkBudgeted kBudgeted = SkBudgeted::kNo;
return SkSurface::MakeRenderTarget(fDevice->context(), kBudgeted, info, sampleCount,
@@ -84,7 +85,7 @@
// want to ever retarget the SkSurface at another buffer we create. Force a copy now to avoid
// copy-on-write.
if (kYes_ForceCopyMode == forceCopyMode || !tex || rt->resourcePriv().refsWrappedObjects()) {
- GrSurfaceDesc desc = fDevice->accessDrawContext()->desc();
+ GrSurfaceDesc desc = fDevice->accessRenderTarget()->desc();
GrContext* ctx = fDevice->context();
desc.fFlags = desc.fFlags & ~kRenderTarget_GrSurfaceFlag;
copy.reset(ctx->textureProvider()->createTexture(desc, budgeted));
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698