aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar twiz@google.com <twiz@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-27 19:39:33 +0000
committerGravatar twiz@google.com <twiz@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-27 19:39:33 +0000
commit1ac87ff5aaff284b337652cf3ac0b41bd56fb781 (patch)
tree6c88a21b9de188f32c8d9ae4e23be74257d99d6d
parent8c2cc1a4ddbc99be2435674bc3512af9c9f03452 (diff)
Addition of necessary flush to copyToTexturePixelRef(...).
Ganesh batches drawing operations, which means that the copy operation, which does not flush the pipeline, can capture stale contents. By forcing a flush, the up-to-date version of the texture is copied. TEST=none BUG=124054 Review URL: https://codereview.appspot.com/6129043 git-svn-id: http://skia.googlecode.com/svn/trunk@3785 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/gpu/GrContext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 835ab23368..ac812cbd49 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1915,6 +1915,12 @@ void GrContext::copyTexture(GrTexture* src, GrRenderTarget* dst) {
}
ASSERT_OWNED_RESOURCE(src);
+ // Writes pending to the source texture are not tracked, so a flush
+ // is required to ensure that the copy captures the most recent contents
+ // of the source texture. See similar behaviour in
+ // GrContext::resolveRenderTarget.
+ this->flush();
+
GrDrawTarget::AutoStateRestore asr(fGpu, GrDrawTarget::kReset_ASRInit);
GrDrawState* drawState = fGpu->drawState();
drawState->setRenderTarget(dst);