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

Side by Side Diff: src/core/SkImageFilter.cpp

Issue 26702002: force readbuffer clients to use specialized readFoo for flattenables (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkFlattenableSerialization.cpp ('k') | src/core/SkOrderedReadBuffer.h » ('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 "SkImageFilter.h" 8 #include "SkImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 for (int i = 0; i < fInputCount; i++) { 61 for (int i = 0; i < fInputCount; i++) {
62 SkSafeUnref(fInputs[i]); 62 SkSafeUnref(fInputs[i]);
63 } 63 }
64 delete[] fInputs; 64 delete[] fInputs;
65 } 65 }
66 66
67 SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer) 67 SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer)
68 : fInputCount(buffer.readInt()), fInputs(new SkImageFilter*[fInputCount]) { 68 : fInputCount(buffer.readInt()), fInputs(new SkImageFilter*[fInputCount]) {
69 for (int i = 0; i < fInputCount; i++) { 69 for (int i = 0; i < fInputCount; i++) {
70 if (buffer.readBool()) { 70 if (buffer.readBool()) {
71 fInputs[i] = static_cast<SkImageFilter*>(buffer.readFlattenable()); 71 fInputs[i] = buffer.readImageFilter();
72 } else { 72 } else {
73 fInputs[i] = NULL; 73 fInputs[i] = NULL;
74 } 74 }
75 } 75 }
76 #ifdef SK_CROP_RECT_IS_INT 76 #ifdef SK_CROP_RECT_IS_INT
77 buffer.readIRect(&fCropRect); 77 buffer.readIRect(&fCropRect);
78 #else 78 #else
79 buffer.readRect(&fCropRect.fRect); 79 buffer.readRect(&fCropRect.fRect);
80 fCropRect.fFlags = buffer.readUInt(); 80 fCropRect.fFlags = buffer.readUInt();
81 #endif 81 #endif
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return true; 206 return true;
207 } 207 }
208 208
209 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&) cons t { 209 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&) cons t {
210 return false; 210 return false;
211 } 211 }
212 212
213 bool SkImageFilter::asColorFilter(SkColorFilter**) const { 213 bool SkImageFilter::asColorFilter(SkColorFilter**) const {
214 return false; 214 return false;
215 } 215 }
OLDNEW
« no previous file with comments | « src/core/SkFlattenableSerialization.cpp ('k') | src/core/SkOrderedReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698