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

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: Adapting code to sk_once changes 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/SkGraphics.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"
11 #include "SkFlattenableBuffers.h" 11 #include "SkFlattenableBuffers.h"
12 #include "SkRect.h" 12 #include "SkRect.h"
13 #include "SkValidationUtils.h"
13 #if SK_SUPPORT_GPU 14 #if SK_SUPPORT_GPU
14 #include "GrContext.h" 15 #include "GrContext.h"
15 #include "GrTexture.h" 16 #include "GrTexture.h"
16 #include "SkImageFilterUtils.h" 17 #include "SkImageFilterUtils.h"
17 #endif 18 #endif
18 19
19 SK_DEFINE_INST_COUNT(SkImageFilter) 20 SK_DEFINE_INST_COUNT(SkImageFilter)
20 21
21 SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs, const CropR ect* cropRect) 22 SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs, const CropR ect* cropRect)
22 : fInputCount(inputCount), 23 : fInputCount(inputCount),
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (buffer.readBool()) { 59 if (buffer.readBool()) {
59 fInputs[i] = buffer.readImageFilter(); 60 fInputs[i] = buffer.readImageFilter();
60 } else { 61 } else {
61 fInputs[i] = NULL; 62 fInputs[i] = NULL;
62 } 63 }
63 } 64 }
64 SkRect rect; 65 SkRect rect;
65 buffer.readRect(&rect); 66 buffer.readRect(&rect);
66 uint32_t flags = buffer.readUInt(); 67 uint32_t flags = buffer.readUInt();
67 fCropRect = CropRect(rect, flags); 68 fCropRect = CropRect(rect, flags);
69 buffer.validate(SkIsValidRect(rect));
68 } 70 }
69 71
70 void SkImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const { 72 void SkImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
71 buffer.writeInt(fInputCount); 73 buffer.writeInt(fInputCount);
72 for (int i = 0; i < fInputCount; i++) { 74 for (int i = 0; i < fInputCount; i++) {
73 SkImageFilter* input = getInput(i); 75 SkImageFilter* input = getInput(i);
74 buffer.writeBool(input != NULL); 76 buffer.writeBool(input != NULL);
75 if (input != NULL) { 77 if (input != NULL) {
76 buffer.writeFlattenable(input); 78 buffer.writeFlattenable(input);
77 } 79 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 return true; 180 return true;
179 } 181 }
180 182
181 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&, cons t SkIRect&) const { 183 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&, cons t SkIRect&) const {
182 return false; 184 return false;
183 } 185 }
184 186
185 bool SkImageFilter::asColorFilter(SkColorFilter**) const { 187 bool SkImageFilter::asColorFilter(SkColorFilter**) const {
186 return false; 188 return false;
187 } 189 }
OLDNEW
« no previous file with comments | « src/core/SkGraphics.cpp ('k') | src/core/SkOrderedReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698