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

Side by Side Diff: src/effects/SkDropShadowImageFilter.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/SkDisplacementMapEffect.cpp ('k') | src/effects/SkEmbossMaskFilter.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 11 matching lines...) Expand all
22 : INHERITED(1, &input, cropRect, uniqueID) 22 : INHERITED(1, &input, cropRect, uniqueID)
23 , fDx(dx) 23 , fDx(dx)
24 , fDy(dy) 24 , fDy(dy)
25 , fSigmaX(sigmaX) 25 , fSigmaX(sigmaX)
26 , fSigmaY(sigmaY) 26 , fSigmaY(sigmaY)
27 , fColor(color) 27 , fColor(color)
28 , fShadowMode(shadowMode) 28 , fShadowMode(shadowMode)
29 { 29 {
30 } 30 }
31 31
32 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
33 SkDropShadowImageFilter::SkDropShadowImageFilter(SkReadBuffer& buffer)
34 : INHERITED(1, buffer) {
35 fDx = buffer.readScalar();
36 fDy = buffer.readScalar();
37 fSigmaX = buffer.readScalar();
38 fSigmaY = buffer.readScalar();
39 fColor = buffer.readColor();
40 fShadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Version) ?
41 kDrawShadowAndForeground_ShadowMode :
42 static_cast<ShadowMode>(buffer.readInt());
43 buffer.validate(SkScalarIsFinite(fDx) &&
44 SkScalarIsFinite(fDy) &&
45 SkScalarIsFinite(fSigmaX) &&
46 SkScalarIsFinite(fSigmaY));
47 }
48 #endif
49
32 SkFlattenable* SkDropShadowImageFilter::CreateProc(SkReadBuffer& buffer) { 50 SkFlattenable* SkDropShadowImageFilter::CreateProc(SkReadBuffer& buffer) {
33 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 51 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
34 SkScalar dx = buffer.readScalar(); 52 SkScalar dx = buffer.readScalar();
35 SkScalar dy = buffer.readScalar(); 53 SkScalar dy = buffer.readScalar();
36 SkScalar sigmaX = buffer.readScalar(); 54 SkScalar sigmaX = buffer.readScalar();
37 SkScalar sigmaY = buffer.readScalar(); 55 SkScalar sigmaY = buffer.readScalar();
38 SkColor color = buffer.readColor(); 56 SkColor color = buffer.readColor();
39 ShadowMode shadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Ver sion) ? 57 ShadowMode shadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Ver sion) ?
40 kDrawShadowAndForeground_ShadowMode : 58 kDrawShadowAndForeground_ShadowMode :
41 static_cast<ShadowMode>(buffer.readInt()); 59 static_cast<ShadowMode>(buffer.readInt());
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3)))); 147 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3))));
130 if (fShadowMode == kDrawShadowAndForeground_ShadowMode) { 148 if (fShadowMode == kDrawShadowAndForeground_ShadowMode) {
131 bounds.join(src); 149 bounds.join(src);
132 } 150 }
133 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { 151 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) {
134 return false; 152 return false;
135 } 153 }
136 *dst = bounds; 154 *dst = bounds;
137 return true; 155 return true;
138 } 156 }
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkEmbossMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698