aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp3
-rw-r--r--src/gpu/GrTextureOpList.cpp3
-rw-r--r--src/image/SkSurface_Gpu.cpp23
-rw-r--r--tests/RenderTargetContextTest.cpp8
4 files changed, 10 insertions, 27 deletions
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index 10922ac228..d1c1425123 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -206,7 +206,8 @@ void GrRenderTargetOpList::fullClear(const GrCaps& caps, GrColor color) {
////////////////////////////////////////////////////////////////////////////////
-// MDB TODO: fuse with GrTextureOpList::copySurface
+// This closely parallels GrTextureOpList::copySurface but renderTargetOpLists
+// also store the applied clip and dest proxy with the op
bool GrRenderTargetOpList::copySurface(const GrCaps& caps,
GrSurfaceProxy* dst,
GrSurfaceProxy* src,
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index 3c127f69f0..eb2380f7be 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -77,7 +77,8 @@ void GrTextureOpList::reset() {
////////////////////////////////////////////////////////////////////////////////
-// MDB TODO: fuse with GrRenderTargetOpList::copySurface
+// This closely parallels GrRenderTargetOpList::copySurface but renderTargetOpList
+// stores extra data with the op
bool GrTextureOpList::copySurface(const GrCaps& caps,
GrSurfaceProxy* dst,
GrSurfaceProxy* src,
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 63d1aed172..732fe4aeb3 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -105,26 +105,9 @@ sk_sp<SkImage> SkSurface_Gpu::onNewImageSnapshot() {
// want to ever retarget the SkSurface at another buffer we create. Force a copy now to avoid
// copy-on-write.
if (!srcProxy || rtc->priv().refsWrappedObjects()) {
- // MDB TODO: replace this with GrSurfaceProxy::Copy?
- GrSurfaceDesc desc;
- desc.fConfig = rtc->config();
- desc.fWidth = rtc->width();
- desc.fHeight = rtc->height();
- desc.fOrigin = rtc->origin();
-
- sk_sp<GrSurfaceContext> copyCtx = ctx->contextPriv().makeDeferredSurfaceContext(
- desc,
- SkBackingFit::kExact,
- budgeted);
- if (!copyCtx) {
- return nullptr;
- }
-
- if (!copyCtx->copy(rtc->asSurfaceProxy())) {
- return nullptr;
- }
-
- srcProxy = copyCtx->asTextureProxyRef();
+ SkASSERT(rtc->origin() == rtc->asSurfaceProxy()->origin());
+
+ srcProxy = GrSurfaceProxy::Copy(ctx, rtc->asSurfaceProxy(), budgeted);
}
const SkImageInfo info = fDevice->imageInfo();
diff --git a/tests/RenderTargetContextTest.cpp b/tests/RenderTargetContextTest.cpp
index dbb41851c6..311643e919 100644
--- a/tests/RenderTargetContextTest.cpp
+++ b/tests/RenderTargetContextTest.cpp
@@ -9,9 +9,8 @@
#include "Test.h"
-// MDB TODO: With the move of the discard calls to the RenderTargetContext, deferred RTCs are being
-// instantiated early. This test can be re-enabled once discards do not force an instantiation
-// (i.e., when renderTargetProxies carry the op IORefs)
+// MDB TODO: the early instantiation of the renderTargetContext's backing GrRenderTargetProxy
+// mixes this test up. Re-enable once backing GPU resources are distributed by MDB at flush time.
#if 0
#if SK_SUPPORT_GPU
@@ -50,8 +49,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RenderTargetContextTest, reporter, ctxInfo) {
GrTextureProxy* tProxy = rtCtx->asTextureProxy();
REPORTER_ASSERT(reporter, tProxy);
- GrTexture* tex = tProxy->instantiate(ctx->resourceProvider());
- REPORTER_ASSERT(reporter, tex);
+ REPORTER_ASSERT(reporter, tProxy->instantiate(ctx->resourceProvider()));
check_is_wrapped_status(reporter, rtCtx.get(), true);
}