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

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

Issue 83343003: Adding more validation (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fixed comments Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.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 "SkOffsetImageFilter.h" 8 #include "SkOffsetImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void SkOffsetImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const { 72 void SkOffsetImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
73 this->INHERITED::flatten(buffer); 73 this->INHERITED::flatten(buffer);
74 buffer.writePoint(fOffset); 74 buffer.writePoint(fOffset);
75 } 75 }
76 76
77 SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter * input, 77 SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter * input,
78 const CropRect* cropRect) : INHERITED(i nput, cropRect) { 78 const CropRect* cropRect) : INHERITED(i nput, cropRect) {
79 fOffset.set(dx, dy); 79 fOffset.set(dx, dy);
80 } 80 }
81 81
82 SkOffsetImageFilter::SkOffsetImageFilter(SkFlattenableReadBuffer& buffer) : INHE RITED(buffer) { 82 SkOffsetImageFilter::SkOffsetImageFilter(SkFlattenableReadBuffer& buffer)
83 : INHERITED(1, buffer) {
83 buffer.readPoint(&fOffset); 84 buffer.readPoint(&fOffset);
84 buffer.validate(SkScalarIsFinite(fOffset.fX) && 85 buffer.validate(SkScalarIsFinite(fOffset.fX) &&
85 SkScalarIsFinite(fOffset.fY)); 86 SkScalarIsFinite(fOffset.fY));
86 } 87 }
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698