diff options
author | Robert Phillips <robertphillips@google.com> | 2017-03-30 08:02:11 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-30 12:55:37 +0000 |
commit | 7ee385e1dc3cd6a47dc8f7297fef6e175eaba224 (patch) | |
tree | 47e0c374c185e4d94a536a468bb39387acdb3bf4 /src/gpu/GrTextureContext.cpp | |
parent | d1443efcb8cc91e2ba25e7e5d9735735a95f5169 (diff) |
Add GrSurfaceProxy* parameter to GrContext::flush
Split out of: https://skia-review.googlesource.com/c/10284/ (Omnibus: Remove GrSurface-derived classes from ops)
Change-Id: I12c66a6fa826c2363b21ece56391fb352d12d6b3
Reviewed-on: https://skia-review.googlesource.com/10541
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrTextureContext.cpp')
-rw-r--r-- | src/gpu/GrTextureContext.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gpu/GrTextureContext.cpp b/src/gpu/GrTextureContext.cpp index bc48e8eeb1..00cc97cf53 100644 --- a/src/gpu/GrTextureContext.cpp +++ b/src/gpu/GrTextureContext.cpp @@ -6,6 +6,8 @@ */ #include "GrTextureContext.h" + +#include "GrContextPriv.h" #include "GrDrawingManager.h" #include "GrResourceProvider.h" #include "GrTextureOpList.h" @@ -76,18 +78,18 @@ bool GrTextureContext::onCopy(GrSurfaceProxy* srcProxy, SkDEBUGCODE(this->validate();) GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrTextureContext::copy"); +#ifndef ENABLE_MDB + // We can't yet fully defer copies to textures, so GrTextureContext::copySurface will + // execute the copy immediately. Ensure the data is ready. + fContext->contextPriv().flushSurfaceWrites(srcProxy); +#endif + // TODO: defer instantiation until flush time sk_sp<GrSurface> src(sk_ref_sp(srcProxy->instantiate(fContext->resourceProvider()))); if (!src) { return false; } -#ifndef ENABLE_MDB - // We can't yet fully defer copies to textures, so GrTextureContext::copySurface will - // execute the copy immediately. Ensure the data is ready. - fContext->flushSurfaceWrites(src.get()); -#endif - // TODO: this needs to be fixed up since it ends the deferrable of the GrTexture sk_sp<GrTexture> tex(sk_ref_sp(fTextureProxy->instantiate(fContext->resourceProvider()))); if (!tex) { |