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

Side by Side Diff: src/effects/SkOffsetImageFilter.cpp

Issue 15600003: Remove SkImageFilter::getInputResult(), since its return value is not (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 | « src/effects/SkMorphologyImageFilter.cpp ('k') | 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 2012 The Android Open Source Project 2 * Copyright 2012 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 "SkOffsetImageFilter.h" 8 #include "SkOffsetImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkMatrix.h" 10 #include "SkMatrix.h"
11 #include "SkFlattenableBuffers.h" 11 #include "SkFlattenableBuffers.h"
12 12
13 bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source, 13 bool SkOffsetImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source,
14 const SkMatrix& matrix, 14 const SkMatrix& matrix,
15 SkBitmap* result, 15 SkBitmap* result,
16 SkIPoint* loc) { 16 SkIPoint* loc) {
17 SkBitmap src = this->getInputResult(0, proxy, source, matrix, loc); 17 SkBitmap src = source;
18 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, lo c)) {
19 return false;
20 }
21
18 SkVector vec; 22 SkVector vec;
19 matrix.mapVectors(&vec, &fOffset, 1); 23 matrix.mapVectors(&vec, &fOffset, 1);
20 24
21 loc->fX += SkScalarRoundToInt(vec.fX); 25 loc->fX += SkScalarRoundToInt(vec.fX);
22 loc->fY += SkScalarRoundToInt(vec.fY); 26 loc->fY += SkScalarRoundToInt(vec.fY);
23 *result = src; 27 *result = src;
24 return true; 28 return true;
25 } 29 }
26 30
27 bool SkOffsetImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm , 31 bool SkOffsetImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm ,
(...skipping 12 matching lines...) Expand all
40 } 44 }
41 45
42 SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy, 46 SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy,
43 SkImageFilter* input) : INHERITED(input ) { 47 SkImageFilter* input) : INHERITED(input ) {
44 fOffset.set(dx, dy); 48 fOffset.set(dx, dy);
45 } 49 }
46 50
47 SkOffsetImageFilter::SkOffsetImageFilter(SkFlattenableReadBuffer& buffer) : INHE RITED(buffer) { 51 SkOffsetImageFilter::SkOffsetImageFilter(SkFlattenableReadBuffer& buffer) : INHE RITED(buffer) {
48 buffer.readPoint(&fOffset); 52 buffer.readPoint(&fOffset);
49 } 53 }
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698