aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-24 01:46:11 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-24 01:46:11 +0000
commitbbfe4541ef154696313374de2130b1ac90e28482 (patch)
tree566838274cb53abb834309b11109b29c344a855d /src/core
parente9821871ecebbeed06aaef54741a71607ccc9720 (diff)
Apply matrix early in draw bitmap
Committed: http://code.google.com/p/skia/source/detail?r=11930 Reverted: https://code.google.com/p/skia/source/detail?r=11932 R=robertphillips@google.com, senorblanco@chromium.org Author: bsalomon@google.com Review URL: https://codereview.chromium.org/30593003 git-svn-id: http://skia.googlecode.com/svn/trunk@11933 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkImageFilterUtils.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/SkImageFilterUtils.cpp b/src/core/SkImageFilterUtils.cpp
index a4ce51eb91..8385fb446a 100644
--- a/src/core/SkImageFilterUtils.cpp
+++ b/src/core/SkImageFilterUtils.cpp
@@ -23,6 +23,11 @@ bool SkImageFilterUtils::WrapTexture(GrTexture* texture, int width, int height,
bool SkImageFilterUtils::GetInputResultGPU(SkImageFilter* filter, SkImageFilter::Proxy* proxy,
const SkBitmap& src, const SkMatrix& ctm,
SkBitmap* result, SkIPoint* offset) {
+ // Ensure that GrContext calls under filterImage and filterImageGPU below will see an identity
+ // matrix with no clip and that the matrix, clip, and render target set before this function was
+ // called are restored before we return to the caller.
+ GrContext* context = src.getTexture()->getContext();
+ GrContext::AutoWideOpenIdentityDraw awoid(context, NULL);
if (!filter) {
*result = src;
return true;
@@ -31,9 +36,7 @@ bool SkImageFilterUtils::GetInputResultGPU(SkImageFilter* filter, SkImageFilter:
} else {
if (filter->filterImage(proxy, src, ctm, result, offset)) {
if (!result->getTexture()) {
- GrContext* context = ((GrTexture *) src.getTexture())->getContext();
- GrTexture* resultTex = GrLockAndRefCachedBitmapTexture(context,
- *result, NULL);
+ GrTexture* resultTex = GrLockAndRefCachedBitmapTexture(context, *result, NULL);
result->setPixelRef(new SkGrPixelRef(resultTex))->unref();
GrUnlockAndUnrefCachedBitmapTexture(resultTex);
}