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

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

Issue 769953002: 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/SkMatrixImageFilter.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 2012 The Android Open Source Project 2 * Copyright 2012 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 "SkMergeImageFilter.h" 8 #include "SkMergeImageFilter.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return Create(common.inputs(), count, NULL, &common.cropRect(), common.uniqu eID()); 133 return Create(common.inputs(), count, NULL, &common.cropRect(), common.uniqu eID());
134 } 134 }
135 135
136 void SkMergeImageFilter::flatten(SkWriteBuffer& buffer) const { 136 void SkMergeImageFilter::flatten(SkWriteBuffer& buffer) const {
137 this->INHERITED::flatten(buffer); 137 this->INHERITED::flatten(buffer);
138 buffer.writeBool(fModes != NULL); 138 buffer.writeBool(fModes != NULL);
139 if (fModes) { 139 if (fModes) {
140 buffer.writeByteArray(fModes, countInputs() * sizeof(fModes[0])); 140 buffer.writeByteArray(fModes, countInputs() * sizeof(fModes[0]));
141 } 141 }
142 } 142 }
143
144 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
145 SkMergeImageFilter::SkMergeImageFilter(SkReadBuffer& buffer)
146 : INHERITED(-1, buffer) {
147 bool hasModes = buffer.readBool();
148 if (hasModes) {
149 this->initAllocModes();
150 int nbInputs = countInputs();
151 size_t size = nbInputs * sizeof(fModes[0]);
152 SkASSERT(buffer.getArrayCount() == size);
153 if (buffer.validate(buffer.getArrayCount() == size) &&
154 buffer.readByteArray(fModes, size)) {
155 for (int i = 0; i < nbInputs; ++i) {
156 buffer.validate(SkIsValidMode((SkXfermode::Mode)fModes[i]));
157 }
158 }
159 } else {
160 fModes = 0;
161 }
162 }
163 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMatrixImageFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698