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

Side by Side Diff: src/effects/SkMatrixImageFilter.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/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.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 2014 The Android Open Source Project 2 * Copyright 2014 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 "SkMatrixImageFilter.h" 8 #include "SkMatrixImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkDevice.h" 11 #include "SkDevice.h"
12 #include "SkColorPriv.h" 12 #include "SkColorPriv.h"
13 #include "SkReadBuffer.h" 13 #include "SkReadBuffer.h"
14 #include "SkWriteBuffer.h" 14 #include "SkWriteBuffer.h"
15 #include "SkMatrix.h" 15 #include "SkMatrix.h"
16 #include "SkRect.h" 16 #include "SkRect.h"
17 17
18 SkMatrixImageFilter::SkMatrixImageFilter(const SkMatrix& transform, 18 SkMatrixImageFilter::SkMatrixImageFilter(const SkMatrix& transform,
19 SkFilterQuality filterQuality, 19 SkFilterQuality filterQuality,
20 SkImageFilter* input, 20 SkImageFilter* input)
21 uint32_t uniqueID) 21 : INHERITED(1, &input),
22 : INHERITED(1, &input, NULL, uniqueID),
23 fTransform(transform), 22 fTransform(transform),
24 fFilterQuality(filterQuality) { 23 fFilterQuality(filterQuality) {
25 } 24 }
26 25
27 SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform, 26 SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform,
28 SkFilterQuality filterQuality, 27 SkFilterQuality filterQuality,
29 SkImageFilter* input, 28 SkImageFilter* input) {
30 uint32_t uniqueID) { 29 return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterQuality, input));
31 return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterQuality, input, uni queID));
32 } 30 }
33 31
34 SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) { 32 SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
35 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 33 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
36 SkMatrix matrix; 34 SkMatrix matrix;
37 buffer.readMatrix(&matrix); 35 buffer.readMatrix(&matrix);
38 SkFilterQuality quality = static_cast<SkFilterQuality>(buffer.readInt()); 36 SkFilterQuality quality = static_cast<SkFilterQuality>(buffer.readInt());
39 return Create(matrix, quality, common.getInput(0), common.uniqueID()); 37 return Create(matrix, quality, common.getInput(0));
40 } 38 }
41 39
42 void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const { 40 void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
43 this->INHERITED::flatten(buffer); 41 this->INHERITED::flatten(buffer);
44 buffer.writeMatrix(fTransform); 42 buffer.writeMatrix(fTransform);
45 buffer.writeInt(fFilterQuality); 43 buffer.writeInt(fFilterQuality);
46 } 44 }
47 45
48 SkMatrixImageFilter::~SkMatrixImageFilter() { 46 SkMatrixImageFilter::~SkMatrixImageFilter() {
49 } 47 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 fTransform[SkMatrix::kMPersp2]); 139 fTransform[SkMatrix::kMPersp2]);
142 140
143 str->append("<dt>FilterLevel:</dt><dd>"); 141 str->append("<dt>FilterLevel:</dt><dd>");
144 static const char* gFilterLevelStrings[] = { "None", "Low", "Medium", "High" }; 142 static const char* gFilterLevelStrings[] = { "None", "Low", "Medium", "High" };
145 str->append(gFilterLevelStrings[fFilterQuality]); 143 str->append(gFilterLevelStrings[fFilterQuality]);
146 str->append("</dd>"); 144 str->append("</dd>");
147 145
148 str->appendf(")"); 146 str->appendf(")");
149 } 147 }
150 #endif 148 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698