diff options
author | Robert Phillips <robertphillips@google.com> | 2017-06-23 11:59:24 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-23 18:53:56 +0000 |
commit | 81dd3e0c66c6c521a4548205e7e29d6c4972f644 (patch) | |
tree | acad6c86f813d7318c157379d81026619179931f /src/image | |
parent | b7fd25241e3775dd9882ecdf1d7cc6de4c682119 (diff) |
Finish a few MDB TODOs
Change-Id: I5579bea381ce30dc59502dbeb5841fea927002c2
Reviewed-on: https://skia-review.googlesource.com/20640
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/SkSurface_Gpu.cpp | 23 |
1 files changed, 3 insertions, 20 deletions
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(); |