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

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

Issue 1019493002: Remove uniqueID from all filter serialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Null out fUniqueID deserialization Created 5 years, 9 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"
11 #include "SkBlurImageFilter.h" 11 #include "SkBlurImageFilter.h"
12 #include "SkCanvas.h" 12 #include "SkCanvas.h"
13 #include "SkColorMatrixFilter.h" 13 #include "SkColorMatrixFilter.h"
14 #include "SkDevice.h" 14 #include "SkDevice.h"
15 #include "SkReadBuffer.h" 15 #include "SkReadBuffer.h"
16 #include "SkWriteBuffer.h" 16 #include "SkWriteBuffer.h"
17 17
18 SkDropShadowImageFilter::SkDropShadowImageFilter(SkScalar dx, SkScalar dy, 18 SkDropShadowImageFilter::SkDropShadowImageFilter(SkScalar dx, SkScalar dy,
19 SkScalar sigmaX, SkScalar sigma Y, SkColor color, 19 SkScalar sigmaX, SkScalar sigma Y, SkColor color,
20 ShadowMode shadowMode, SkImageF ilter* input, 20 ShadowMode shadowMode, SkImageF ilter* input,
21 const CropRect* cropRect, uint3 2_t uniqueID) 21 const CropRect* cropRect)
22 : INHERITED(1, &input, cropRect, uniqueID) 22 : INHERITED(1, &input, cropRect)
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 SkFlattenable* SkDropShadowImageFilter::CreateProc(SkReadBuffer& buffer) { 32 SkFlattenable* SkDropShadowImageFilter::CreateProc(SkReadBuffer& buffer) {
33 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 33 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
34 SkScalar dx = buffer.readScalar(); 34 SkScalar dx = buffer.readScalar();
35 SkScalar dy = buffer.readScalar(); 35 SkScalar dy = buffer.readScalar();
36 SkScalar sigmaX = buffer.readScalar(); 36 SkScalar sigmaX = buffer.readScalar();
37 SkScalar sigmaY = buffer.readScalar(); 37 SkScalar sigmaY = buffer.readScalar();
38 SkColor color = buffer.readColor(); 38 SkColor color = buffer.readColor();
39 ShadowMode shadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Ver sion) ? 39 ShadowMode shadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Ver sion) ?
40 kDrawShadowAndForeground_ShadowMode : 40 kDrawShadowAndForeground_ShadowMode :
41 static_cast<ShadowMode>(buffer.readInt()); 41 static_cast<ShadowMode>(buffer.readInt());
42 return Create(dx, dy, sigmaX, sigmaY, color, shadowMode, common.getInput(0), 42 return Create(dx, dy, sigmaX, sigmaY, color, shadowMode, common.getInput(0),
43 &common.cropRect(), common.uniqueID()); 43 &common.cropRect());
44 } 44 }
45 45
46 void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const { 46 void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const {
47 this->INHERITED::flatten(buffer); 47 this->INHERITED::flatten(buffer);
48 buffer.writeScalar(fDx); 48 buffer.writeScalar(fDx);
49 buffer.writeScalar(fDy); 49 buffer.writeScalar(fDy);
50 buffer.writeScalar(fSigmaX); 50 buffer.writeScalar(fSigmaX);
51 buffer.writeScalar(fSigmaY); 51 buffer.writeScalar(fSigmaY);
52 buffer.writeColor(fColor); 52 buffer.writeColor(fColor);
53 buffer.writeInt(static_cast<int>(fShadowMode)); 53 buffer.writeInt(static_cast<int>(fShadowMode));
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 "kDrawShadowAndForeground", "kDrawShadowOnly" 153 "kDrawShadowAndForeground", "kDrawShadowOnly"
154 }; 154 };
155 155
156 SK_COMPILE_ASSERT(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), enum_mis match); 156 SK_COMPILE_ASSERT(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), enum_mis match);
157 157
158 str->appendf(" mode: %s", gModeStrings[fShadowMode]); 158 str->appendf(" mode: %s", gModeStrings[fShadowMode]);
159 159
160 str->append(")"); 160 str->append(")");
161 } 161 }
162 #endif 162 #endif
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