Index: src/gpu/GrContext.cpp |
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
index 9d684aa1357a8ce86e227e8cee9262d69e8df321..d95b4fe088aa1baf655ac2a8d4e319f677db9351 100755 |
--- a/src/gpu/GrContext.cpp |
+++ b/src/gpu/GrContext.cpp |
@@ -1534,12 +1534,15 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target, |
return true; |
} |
-void GrContext::resolveRenderTarget(GrRenderTarget* target) { |
- SkASSERT(target); |
- ASSERT_OWNED_RESOURCE(target); |
- this->flush(); |
- if (fGpu) { |
- fGpu->resolveRenderTarget(target); |
+void GrContext::prepareSurfaceForExternalRead(GrSurface* surface) { |
+ SkASSERT(surface); |
+ ASSERT_OWNED_RESOURCE(surface); |
joshualitt
2014/11/03 21:47:45
The original code had a check for needing resolve,
bsalomon
2014/11/03 21:54:16
I did that to try to avoid the flush if the surfac
|
+ if (surface->surfacePriv().hasPendingIO()) { |
+ this->flush(); |
+ } |
+ GrRenderTarget* rt = surface->asRenderTarget(); |
+ if (fGpu && rt) { |
+ fGpu->resolveRenderTarget(rt); |
} |
} |