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

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

Issue 504773003: Revert of Fix recursive computation of filter bounds for drop shadow, (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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/SkMorphologyImageFilter.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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 SkRect shadowBounds = *dst; 114 SkRect shadowBounds = *dst;
115 shadowBounds.offset(fDx, fDy); 115 shadowBounds.offset(fDx, fDy);
116 shadowBounds.outset(SkScalarMul(fSigmaX, SkIntToScalar(3)), 116 shadowBounds.outset(SkScalarMul(fSigmaX, SkIntToScalar(3)),
117 SkScalarMul(fSigmaY, SkIntToScalar(3))); 117 SkScalarMul(fSigmaY, SkIntToScalar(3)));
118 dst->join(shadowBounds); 118 dst->join(shadowBounds);
119 } 119 }
120 120
121 bool SkDropShadowImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, 121 bool SkDropShadowImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
122 SkIRect* dst) const { 122 SkIRect* dst) const {
123 SkIRect bounds = src; 123 SkIRect bounds = src;
124 if (getInput(0) && !getInput(0)->filterBounds(src, ctm, &bounds)) {
125 return false;
126 }
124 SkVector offsetVec = SkVector::Make(fDx, fDy); 127 SkVector offsetVec = SkVector::Make(fDx, fDy);
125 ctm.mapVectors(&offsetVec, 1); 128 ctm.mapVectors(&offsetVec, 1);
126 bounds.offset(-SkScalarCeilToInt(offsetVec.x()), 129 bounds.offset(-SkScalarCeilToInt(offsetVec.x()),
127 -SkScalarCeilToInt(offsetVec.y())); 130 -SkScalarCeilToInt(offsetVec.y()));
128 SkVector sigma = SkVector::Make(fSigmaX, fSigmaY); 131 SkVector sigma = SkVector::Make(fSigmaX, fSigmaY);
129 ctm.mapVectors(&sigma, 1); 132 ctm.mapVectors(&sigma, 1);
130 bounds.outset(SkScalarCeilToInt(SkScalarMul(sigma.x(), SkIntToScalar(3))), 133 bounds.outset(SkScalarCeilToInt(SkScalarMul(sigma.x(), SkIntToScalar(3))),
131 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3)))); 134 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3))));
132 bounds.join(src); 135 bounds.join(src);
133 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) {
134 return false;
135 }
136 *dst = bounds; 136 *dst = bounds;
137 return true; 137 return true;
138 } 138 }
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698