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

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

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Adding validation helper file Created 7 years, 3 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
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer) 55 SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer)
56 : fInputCount(buffer.readInt()), fInputs(new SkImageFilter*[fInputCount]) { 56 : fInputCount(buffer.readInt()), fInputs(new SkImageFilter*[fInputCount]) {
57 for (int i = 0; i < fInputCount; i++) { 57 for (int i = 0; i < fInputCount; i++) {
58 if (buffer.readBool()) { 58 if (buffer.readBool()) {
59 fInputs[i] = static_cast<SkImageFilter*>(buffer.readFlattenable()); 59 fInputs[i] = static_cast<SkImageFilter*>(buffer.readFlattenable());
60 } else { 60 } else {
61 fInputs[i] = NULL; 61 fInputs[i] = NULL;
62 } 62 }
63 } 63 }
64 buffer.readIRect(&fCropRect); 64 buffer.readIRect(&fCropRect);
65 buffer.validateData(fCropRect.isValid());
65 } 66 }
66 67
67 void SkImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const { 68 void SkImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
68 buffer.writeInt(fInputCount); 69 buffer.writeInt(fInputCount);
69 for (int i = 0; i < fInputCount; i++) { 70 for (int i = 0; i < fInputCount; i++) {
70 SkImageFilter* input = getInput(i); 71 SkImageFilter* input = getInput(i);
71 buffer.writeBool(input != NULL); 72 buffer.writeBool(input != NULL);
72 if (input != NULL) { 73 if (input != NULL) {
73 buffer.writeFlattenable(input); 74 buffer.writeFlattenable(input);
74 } 75 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 return true; 174 return true;
174 } 175 }
175 176
176 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&) cons t { 177 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&) cons t {
177 return false; 178 return false;
178 } 179 }
179 180
180 bool SkImageFilter::asColorFilter(SkColorFilter**) const { 181 bool SkImageFilter::asColorFilter(SkColorFilter**) const {
181 return false; 182 return false;
182 } 183 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698