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

Side by Side Diff: src/effects/SkDropShadowImageFilter.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/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.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 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkDropShadowImageFilter.h" 8 #include "SkDropShadowImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const 51 void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const
52 { 52 {
53 this->INHERITED::flatten(buffer); 53 this->INHERITED::flatten(buffer);
54 buffer.writeScalar(fDx); 54 buffer.writeScalar(fDx);
55 buffer.writeScalar(fDy); 55 buffer.writeScalar(fDy);
56 buffer.writeScalar(fSigmaX); 56 buffer.writeScalar(fSigmaX);
57 buffer.writeScalar(fSigmaY); 57 buffer.writeScalar(fSigmaY);
58 buffer.writeColor(fColor); 58 buffer.writeColor(fColor);
59 } 59 }
60 60
61 bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source , const SkMatrix& matrix, SkBitmap* result, SkIPoint* offset) 61 bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source , const SkMatrix& matrix, SkBitmap* result, SkIPoint* offset) const
62 { 62 {
63 SkBitmap src = source; 63 SkBitmap src = source;
64 SkIPoint srcOffset = SkIPoint::Make(0, 0); 64 SkIPoint srcOffset = SkIPoint::Make(0, 0);
65 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &s rcOffset)) 65 if (getInput(0) && !getInput(0)->filterImage(proxy, source, matrix, &src, &s rcOffset))
66 return false; 66 return false;
67 67
68 SkIRect bounds; 68 SkIRect bounds;
69 src.getBounds(&bounds); 69 src.getBounds(&bounds);
70 bounds.offset(srcOffset); 70 bounds.offset(srcOffset);
71 if (!this->applyCropRect(&bounds, matrix)) { 71 if (!this->applyCropRect(&bounds, matrix)) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 bounds.offset(-SkScalarCeilToInt(offsetVec.x()), 124 bounds.offset(-SkScalarCeilToInt(offsetVec.x()),
125 -SkScalarCeilToInt(offsetVec.y())); 125 -SkScalarCeilToInt(offsetVec.y()));
126 SkVector sigma, localSigma = SkVector::Make(fSigmaX, fSigmaY); 126 SkVector sigma, localSigma = SkVector::Make(fSigmaX, fSigmaY);
127 ctm.mapVectors(&sigma, &localSigma, 1); 127 ctm.mapVectors(&sigma, &localSigma, 1);
128 bounds.outset(SkScalarCeilToInt(SkScalarMul(sigma.x(), SkIntToScalar(3))), 128 bounds.outset(SkScalarCeilToInt(SkScalarMul(sigma.x(), SkIntToScalar(3))),
129 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3)))); 129 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3))));
130 bounds.join(src); 130 bounds.join(src);
131 *dst = bounds; 131 *dst = bounds;
132 return true; 132 return true;
133 } 133 }
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698