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

Side by Side Diff: src/effects/SkMagnifierImageFilter.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/SkLightingImageFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkMagnifierImageFilter.h" 9 #include "SkMagnifierImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 226
227 void GrMagnifierEffect::getConstantColorComponents(GrColor* color, uint32_t* val idFlags) const { 227 void GrMagnifierEffect::getConstantColorComponents(GrColor* color, uint32_t* val idFlags) const {
228 this->updateConstantColorComponentsForModulation(color, validFlags); 228 this->updateConstantColorComponentsForModulation(color, validFlags);
229 } 229 }
230 230
231 #endif 231 #endif
232 232
233 //////////////////////////////////////////////////////////////////////////////// 233 ////////////////////////////////////////////////////////////////////////////////
234 SkMagnifierImageFilter::SkMagnifierImageFilter(SkFlattenableReadBuffer& buffer) 234 SkMagnifierImageFilter::SkMagnifierImageFilter(SkFlattenableReadBuffer& buffer)
235 : INHERITED(buffer) { 235 : INHERITED(1, buffer) {
236 float x = buffer.readScalar(); 236 float x = buffer.readScalar();
237 float y = buffer.readScalar(); 237 float y = buffer.readScalar();
238 float width = buffer.readScalar(); 238 float width = buffer.readScalar();
239 float height = buffer.readScalar(); 239 float height = buffer.readScalar();
240 fSrcRect = SkRect::MakeXYWH(x, y, width, height); 240 fSrcRect = SkRect::MakeXYWH(x, y, width, height);
241 fInset = buffer.readScalar(); 241 fInset = buffer.readScalar();
242 242
243 buffer.validate(SkIsValidRect(fSrcRect) && SkScalarIsFinite(fInset)); 243 buffer.validate(SkIsValidRect(fSrcRect) && SkScalarIsFinite(fInset));
244 } 244 }
245 245
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1); 335 int x_val = SkMin32(SkScalarFloorToInt(x_interp), width - 1);
336 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1); 336 int y_val = SkMin32(SkScalarFloorToInt(y_interp), height - 1);
337 337
338 *dptr = sptr[y_val * width + x_val]; 338 *dptr = sptr[y_val * width + x_val];
339 dptr++; 339 dptr++;
340 } 340 }
341 } 341 }
342 return true; 342 return true;
343 } 343 }
OLDNEW
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkMatrixConvolutionImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698