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

Side by Side Diff: src/effects/SkResizeImageFilter.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/SkRectShaderImageFilter.cpp ('k') | src/effects/SkTestImageFilters.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 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 "SkResizeImageFilter.h" 8 #include "SkResizeImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 26 matching lines...) Expand all
37 buffer.writeInt(fFilterLevel); 37 buffer.writeInt(fFilterLevel);
38 } 38 }
39 39
40 SkResizeImageFilter::~SkResizeImageFilter() { 40 SkResizeImageFilter::~SkResizeImageFilter() {
41 } 41 }
42 42
43 bool SkResizeImageFilter::onFilterImage(Proxy* proxy, 43 bool SkResizeImageFilter::onFilterImage(Proxy* proxy,
44 const SkBitmap& source, 44 const SkBitmap& source,
45 const SkMatrix& matrix, 45 const SkMatrix& matrix,
46 SkBitmap* result, 46 SkBitmap* result,
47 SkIPoint* offset) { 47 SkIPoint* offset) const {
48 SkBitmap src = source; 48 SkBitmap src = source;
49 SkIPoint srcOffset = SkIPoint::Make(0, 0); 49 SkIPoint srcOffset = SkIPoint::Make(0, 0);
50 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &s rcOffset)) { 50 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &s rcOffset)) {
51 return false; 51 return false;
52 } 52 }
53 53
54 SkRect dstRect; 54 SkRect dstRect;
55 SkIRect srcBounds, dstBounds; 55 SkIRect srcBounds, dstBounds;
56 src.getBounds(&srcBounds); 56 src.getBounds(&srcBounds);
57 srcBounds.offset(srcOffset); 57 srcBounds.offset(srcOffset);
(...skipping 15 matching lines...) Expand all
73 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 73 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
74 paint.setFilterLevel(fFilterLevel); 74 paint.setFilterLevel(fFilterLevel);
75 canvas.concat(dstMatrix); 75 canvas.concat(dstMatrix);
76 canvas.drawBitmap(src, srcRect.left(), srcRect.top(), &paint); 76 canvas.drawBitmap(src, srcRect.left(), srcRect.top(), &paint);
77 77
78 *result = device.get()->accessBitmap(false); 78 *result = device.get()->accessBitmap(false);
79 offset->fX = dstBounds.fLeft; 79 offset->fX = dstBounds.fLeft;
80 offset->fY = dstBounds.fTop; 80 offset->fY = dstBounds.fTop;
81 return true; 81 return true;
82 } 82 }
OLDNEW
« no previous file with comments | « src/effects/SkRectShaderImageFilter.cpp ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698