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

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 1011273003: Move SkMatrixImageFilter into core, and add a factory fn for it. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Changed all callers to use SkImageFilter::CreateMatrixFilter() instead of SKMIF::Create() Created 5 years, 9 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 | « include/effects/SkMatrixImageFilter.h ('k') | src/core/SkImageFilter.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 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 "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 #include "SkBitmapSource.h" 9 #include "SkBitmapSource.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkColorCubeFilter.h" 12 #include "SkColorCubeFilter.h"
13 #include "SkColorFilter.h" 13 #include "SkColorFilter.h"
14 #include "SkColorFilterImageFilter.h" 14 #include "SkColorFilterImageFilter.h"
15 #include "SkComposeImageFilter.h" 15 #include "SkComposeImageFilter.h"
16 #include "SkData.h" 16 #include "SkData.h"
17 #include "SkDisplacementMapEffect.h" 17 #include "SkDisplacementMapEffect.h"
18 #include "SkDropShadowImageFilter.h" 18 #include "SkDropShadowImageFilter.h"
19 #include "SkFlattenableSerialization.h" 19 #include "SkFlattenableSerialization.h"
20 #include "SkLightingImageFilter.h" 20 #include "SkLightingImageFilter.h"
21 #include "SkMagnifierImageFilter.h" 21 #include "SkMagnifierImageFilter.h"
22 #include "SkMatrixImageFilter.h"
23 #include "SkMatrixConvolutionImageFilter.h" 22 #include "SkMatrixConvolutionImageFilter.h"
24 #include "SkMergeImageFilter.h" 23 #include "SkMergeImageFilter.h"
25 #include "SkMorphologyImageFilter.h" 24 #include "SkMorphologyImageFilter.h"
26 #include "SkOffsetImageFilter.h" 25 #include "SkOffsetImageFilter.h"
27 #include "SkPerlinNoiseShader.h" 26 #include "SkPerlinNoiseShader.h"
28 #include "SkPictureImageFilter.h" 27 #include "SkPictureImageFilter.h"
29 #include "SkPictureRecorder.h" 28 #include "SkPictureRecorder.h"
30 #include "SkRandom.h" 29 #include "SkRandom.h"
31 #include "SkRectShaderImageFilter.h" 30 #include "SkRectShaderImageFilter.h"
32 #include "SkTestImageFilters.h" 31 #include "SkTestImageFilters.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 case XFERMODE: 302 case XFERMODE:
304 { 303 {
305 SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(make_xfermode())); 304 SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(make_xfermode()));
306 filter = SkXfermodeImageFilter::Create(mode, make_image_filter(), make_i mage_filter()); 305 filter = SkXfermodeImageFilter::Create(mode, make_image_filter(), make_i mage_filter());
307 } 306 }
308 break; 307 break;
309 case OFFSET: 308 case OFFSET:
310 filter = SkOffsetImageFilter::Create(make_scalar(), make_scalar(), make_ image_filter()); 309 filter = SkOffsetImageFilter::Create(make_scalar(), make_scalar(), make_ image_filter());
311 break; 310 break;
312 case MATRIX: 311 case MATRIX:
313 filter = SkMatrixImageFilter::Create(make_matrix(), 312 filter = SkImageFilter::CreateMatrixFilter(make_matrix(),
314 (SkFilterQuality)R(4), 313 (SkFilterQuality)R(4),
315 make_image_filter()); 314 make_image_filter());
316 break; 315 break;
317 case MATRIX_CONVOLUTION: 316 case MATRIX_CONVOLUTION:
318 { 317 {
319 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize), 318 SkImageFilter::CropRect cropR(SkRect::MakeWH(SkIntToScalar(kBitmapSize),
320 SkIntToScalar(kBitmapSize)) ); 319 SkIntToScalar(kBitmapSize)) );
321 SkISize size = SkISize::Make(R(10)+1, R(10)+1); 320 SkISize size = SkISize::Make(R(10)+1, R(10)+1);
322 int arraySize = size.width() * size.height(); 321 int arraySize = size.width() * size.height();
323 SkTArray<SkScalar> kernel(arraySize); 322 SkTArray<SkScalar> kernel(arraySize);
324 for (int i = 0; i < arraySize; ++i) { 323 for (int i = 0; i < arraySize; ++i) {
325 kernel.push_back() = make_scalar(); 324 kernel.push_back() = make_scalar();
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 513 }
515 514
516 private: 515 private:
517 typedef SkView INHERITED; 516 typedef SkView INHERITED;
518 }; 517 };
519 518
520 ////////////////////////////////////////////////////////////////////////////// 519 //////////////////////////////////////////////////////////////////////////////
521 520
522 static SkView* MyFactory() { return new ImageFilterFuzzView; } 521 static SkView* MyFactory() { return new ImageFilterFuzzView; }
523 static SkViewRegister reg(MyFactory); 522 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/effects/SkMatrixImageFilter.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698