aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2014-09-24 11:41:24 -0400
committerGravatar Brian Salomon <bsalomon@google.com>2014-09-24 11:41:24 -0400
commit34a9895baf8b2bf95c4f6944a7914be1a74f1524 (patch)
tree8a9a237e3c6997b3237845af0f369558c3aaf04e /src
parentdc5bbab138bfffc85d6ba525d990aad09c322ff6 (diff)
Revert "Use draw buffer for texture copy impl."
This reverts commit e3d4bf234a04e14b6b0f33e11b3e1132b560c145. Conflicts: src/gpu/GrContext.cpp
Diffstat (limited to 'src')
-rwxr-xr-xsrc/gpu/GrContext.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 630aaebf50..42b884bcac 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1574,21 +1574,16 @@ void GrContext::copyTexture(GrTexture* src, GrRenderTarget* dst, const SkIPoint*
if (NULL == src || NULL == dst) {
return;
}
-
ASSERT_OWNED_RESOURCE(src);
- ASSERT_OWNED_RESOURCE(dst);
+
if (src->hasPendingWrite() || dst->hasPendingIO()) {
this->flush();
}
- GrDrawTarget* target = this->prepareToDraw(NULL, kYes_BufferedDraw, NULL, NULL);
- GrDrawTarget::AutoStateRestore asr(target, GrDrawTarget::kReset_ASRInit);
- GrDrawState* drawState = target->drawState();
-
- drawState->disableState(GrDrawState::kClip_StateBit);
+ GrDrawTarget::AutoStateRestore asr(fGpu, GrDrawTarget::kReset_ASRInit);
+ GrDrawState* drawState = fGpu->drawState();
drawState->setRenderTarget(dst);
-
SkMatrix sampleM;
sampleM.setIDiv(src->width(), src->height());
SkIRect srcRect = SkIRect::MakeWH(dst->width(), dst->height());
@@ -1601,9 +1596,8 @@ void GrContext::copyTexture(GrTexture* src, GrRenderTarget* dst, const SkIPoint*
}
sampleM.preTranslate(SkIntToScalar(srcRect.fLeft), SkIntToScalar(srcRect.fTop));
drawState->addColorTextureProcessor(src, sampleM);
-
SkRect dstR = SkRect::MakeWH(SkIntToScalar(srcRect.width()), SkIntToScalar(srcRect.height()));
- target->drawSimpleRect(dstR);
+ fGpu->drawSimpleRect(dstR);
}
bool GrContext::writeRenderTargetPixels(GrRenderTarget* target,