Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: src/core/SkImageFilterUtils.cpp

Issue 5636027884503040: Initialize the matrix used when recursing from a GPU image filter -> raster image filter. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The Android Open Source Project 2 * Copyright 2013 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkMatrix.h" 8 #include "SkMatrix.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 11 matching lines...) Expand all
22 22
23 bool SkImageFilterUtils::GetInputResultGPU(SkImageFilter* filter, SkImageFilter: :Proxy* proxy, 23 bool SkImageFilterUtils::GetInputResultGPU(SkImageFilter* filter, SkImageFilter: :Proxy* proxy,
24 const SkBitmap& src, SkBitmap* result , 24 const SkBitmap& src, SkBitmap* result ,
25 SkIPoint* offset) { 25 SkIPoint* offset) {
26 if (!filter) { 26 if (!filter) {
27 *result = src; 27 *result = src;
28 return true; 28 return true;
29 } else if (filter->canFilterImageGPU()) { 29 } else if (filter->canFilterImageGPU()) {
30 return filter->filterImageGPU(proxy, src, result, offset); 30 return filter->filterImageGPU(proxy, src, result, offset);
31 } else { 31 } else {
32 if (filter->filterImage(proxy, src, SkMatrix(), result, offset)) { 32 SkMatrix matrix;
33 matrix.reset();
34 if (filter->filterImage(proxy, src, matrix, result, offset)) {
33 if (!result->getTexture()) { 35 if (!result->getTexture()) {
34 GrContext* context = ((GrTexture *) src.getTexture())->getContex t(); 36 GrContext* context = ((GrTexture *) src.getTexture())->getContex t();
35 GrTexture* resultTex = GrLockAndRefCachedBitmapTexture(context, 37 GrTexture* resultTex = GrLockAndRefCachedBitmapTexture(context,
36 *result, NULL); 38 *result, NULL);
37 result->setPixelRef(new SkGrPixelRef(resultTex))->unref(); 39 result->setPixelRef(new SkGrPixelRef(resultTex))->unref();
38 GrUnlockAndUnrefCachedBitmapTexture(resultTex); 40 GrUnlockAndUnrefCachedBitmapTexture(resultTex);
39 } 41 }
40 return true; 42 return true;
41 } else { 43 } else {
42 return false; 44 return false;
43 } 45 }
44 } 46 }
45 } 47 }
46 #endif 48 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698