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

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 139613002: Adding change for new constructor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Same code, trying to upload again Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 #include "SampleCode.h" 7 #include "SampleCode.h"
8 #include "SkBicubicImageFilter.h" 8 #include "SkBicubicImageFilter.h"
9 #include "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), 244 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize),
245 SkIntToScalar(kBitmapSize)) ); 245 SkIntToScalar(kBitmapSize)) );
246 filter = SkRectShaderImageFilter::Create(shader, &cropR); 246 filter = SkRectShaderImageFilter::Create(shader, &cropR);
247 } 247 }
248 break; 248 break;
249 case DROP_SHADOW: 249 case DROP_SHADOW:
250 filter = new SkDropShadowImageFilter(make_scalar(), make_scalar(), 250 filter = new SkDropShadowImageFilter(make_scalar(), make_scalar(),
251 make_scalar(true), make_color(), make_image_filter()); 251 make_scalar(true), make_color(), make_image_filter());
252 break; 252 break;
253 case MORPHOLOGY: 253 case MORPHOLOGY:
254 if (R(2) == 1) 254 if (R(2) == 1) {
255 filter = new SkDilateImageFilter(R(static_cast<float>(kBitmapSize)), 255 filter = new SkDilateImageFilter(R(static_cast<float>(kBitmapSize)),
256 R(static_cast<float>(kBitmapSize)), make_image_filter()); 256 R(static_cast<float>(kBitmapSize)), make_image_filter());
257 else 257 } else {
258 filter = new SkErodeImageFilter(R(static_cast<float>(kBitmapSize)), 258 filter = new SkErodeImageFilter(R(static_cast<float>(kBitmapSize)),
259 R(static_cast<float>(kBitmapSize)), make_image_filter()); 259 R(static_cast<float>(kBitmapSize)), make_image_filter());
260 }
260 break; 261 break;
261 case BITMAP: 262 case BITMAP:
262 filter = new SkBitmapSource(make_bitmap()); 263 if (R(2) == 1) {
264 filter = new SkBitmapSource(make_bitmap(), make_rect(), make_rect()) ;
265 } else {
266 filter = new SkBitmapSource(make_bitmap());
267 }
263 break; 268 break;
264 case DISPLACE: 269 case DISPLACE:
265 filter = new SkDisplacementMapEffect(make_channel_selector_type(), 270 filter = new SkDisplacementMapEffect(make_channel_selector_type(),
266 make_channel_selector_type(), make_scalar(), 271 make_channel_selector_type(), make_scalar(),
267 make_image_filter(false), make_image_filter()); 272 make_image_filter(false), make_image_filter());
268 break; 273 break;
269 case TILE: 274 case TILE:
270 filter = new SkTileImageFilter(make_rect(), make_rect(), make_image_filt er(false)); 275 filter = new SkTileImageFilter(make_rect(), make_rect(), make_image_filt er(false));
271 break; 276 break;
272 default: 277 default:
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 370 }
366 371
367 private: 372 private:
368 typedef SkView INHERITED; 373 typedef SkView INHERITED;
369 }; 374 };
370 375
371 ////////////////////////////////////////////////////////////////////////////// 376 //////////////////////////////////////////////////////////////////////////////
372 377
373 static SkView* MyFactory() { return new ImageFilterFuzzView; } 378 static SkView* MyFactory() { return new ImageFilterFuzzView; }
374 static SkViewRegister reg(MyFactory); 379 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698