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

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

Issue 148883011: Make SkImageFilter methods const. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More fixes to gm/ Created 6 years, 10 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
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkComposeImageFilter.cpp » ('j') | 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 "SkColorFilterImageFilter.h" 8 #include "SkColorFilterImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 buffer.writeFlattenable(fColorFilter); 94 buffer.writeFlattenable(fColorFilter);
95 } 95 }
96 96
97 SkColorFilterImageFilter::~SkColorFilterImageFilter() { 97 SkColorFilterImageFilter::~SkColorFilterImageFilter() {
98 SkSafeUnref(fColorFilter); 98 SkSafeUnref(fColorFilter);
99 } 99 }
100 100
101 bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& sourc e, 101 bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& sourc e,
102 const SkMatrix& matrix, 102 const SkMatrix& matrix,
103 SkBitmap* result, 103 SkBitmap* result,
104 SkIPoint* offset) { 104 SkIPoint* offset) const {
105 SkBitmap src = source; 105 SkBitmap src = source;
106 SkIPoint srcOffset = SkIPoint::Make(0, 0); 106 SkIPoint srcOffset = SkIPoint::Make(0, 0);
107 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &s rcOffset)) { 107 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &s rcOffset)) {
108 return false; 108 return false;
109 } 109 }
110 110
111 SkIRect bounds; 111 SkIRect bounds;
112 src.getBounds(&bounds); 112 src.getBounds(&bounds);
113 bounds.offset(srcOffset); 113 bounds.offset(srcOffset);
114 if (!this->applyCropRect(&bounds, matrix)) { 114 if (!this->applyCropRect(&bounds, matrix)) {
(...skipping 20 matching lines...) Expand all
135 bool SkColorFilterImageFilter::asColorFilter(SkColorFilter** filter) const { 135 bool SkColorFilterImageFilter::asColorFilter(SkColorFilter** filter) const {
136 if (!cropRectIsSet()) { 136 if (!cropRectIsSet()) {
137 if (filter) { 137 if (filter) {
138 *filter = fColorFilter; 138 *filter = fColorFilter;
139 fColorFilter->ref(); 139 fColorFilter->ref();
140 } 140 }
141 return true; 141 return true;
142 } 142 }
143 return false; 143 return false;
144 } 144 }
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkComposeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698