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

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

Issue 768183002: Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMaskFilter.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 2011 The Android Open Source Project 2 * Copyright 2011 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 13 matching lines...) Expand all
24 #define MAX_SIGMA SkIntToScalar(532) 24 #define MAX_SIGMA SkIntToScalar(532)
25 25
26 static SkVector mapSigma(const SkSize& localSigma, const SkMatrix& ctm) { 26 static SkVector mapSigma(const SkSize& localSigma, const SkMatrix& ctm) {
27 SkVector sigma = SkVector::Make(localSigma.width(), localSigma.height()); 27 SkVector sigma = SkVector::Make(localSigma.width(), localSigma.height());
28 ctm.mapVectors(&sigma, 1); 28 ctm.mapVectors(&sigma, 1);
29 sigma.fX = SkMinScalar(SkScalarAbs(sigma.fX), MAX_SIGMA); 29 sigma.fX = SkMinScalar(SkScalarAbs(sigma.fX), MAX_SIGMA);
30 sigma.fY = SkMinScalar(SkScalarAbs(sigma.fY), MAX_SIGMA); 30 sigma.fY = SkMinScalar(SkScalarAbs(sigma.fY), MAX_SIGMA);
31 return sigma; 31 return sigma;
32 } 32 }
33 33
34 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
35 SkBlurImageFilter::SkBlurImageFilter(SkReadBuffer& buffer)
36 : INHERITED(1, buffer) {
37 fSigma.fWidth = buffer.readScalar();
38 fSigma.fHeight = buffer.readScalar();
39 buffer.validate(SkScalarIsFinite(fSigma.fWidth) &&
40 SkScalarIsFinite(fSigma.fHeight) &&
41 (fSigma.fWidth >= 0) &&
42 (fSigma.fHeight >= 0));
43 }
44 #endif
45
34 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX, 46 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX,
35 SkScalar sigmaY, 47 SkScalar sigmaY,
36 SkImageFilter* input, 48 SkImageFilter* input,
37 const CropRect* cropRect, 49 const CropRect* cropRect,
38 uint32_t uniqueID) 50 uint32_t uniqueID)
39 : INHERITED(1, &input, cropRect, uniqueID), fSigma(SkSize::Make(sigmaX, sigm aY)) { 51 : INHERITED(1, &input, cropRect, uniqueID), fSigma(SkSize::Make(sigmaX, sigm aY)) {
40 } 52 }
41 53
42 SkFlattenable* SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) { 54 SkFlattenable* SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) {
43 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 55 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 true, 292 true,
281 sigma.x(), 293 sigma.x(),
282 sigma.y())); 294 sigma.y()));
283 WrapTexture(tex, rect.width(), rect.height(), result); 295 WrapTexture(tex, rect.width(), rect.height(), result);
284 return true; 296 return true;
285 #else 297 #else
286 SkDEBUGFAIL("Should not call in GPU-less build"); 298 SkDEBUGFAIL("Should not call in GPU-less build");
287 return false; 299 return false;
288 #endif 300 #endif
289 } 301 }
OLDNEW
« no previous file with comments | « src/effects/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698