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

Side by Side Diff: gm/imagefiltersclipped.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 | « gm/filterfastbounds.cpp ('k') | gm/imagefiltersscaled.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 2014 Google Inc. 2 * Copyright 2014 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 7
8 #include "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBitmapSource.h" 9 #include "SkBitmapSource.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
11 #include "SkColor.h" 11 #include "SkColor.h"
12 #include "SkDisplacementMapEffect.h" 12 #include "SkDisplacementMapEffect.h"
13 #include "SkDropShadowImageFilter.h" 13 #include "SkDropShadowImageFilter.h"
14 #include "SkGradientShader.h" 14 #include "SkGradientShader.h"
15 #include "SkMatrixImageFilter.h"
16 #include "SkMorphologyImageFilter.h" 15 #include "SkMorphologyImageFilter.h"
17 #include "SkOffsetImageFilter.h" 16 #include "SkOffsetImageFilter.h"
18 #include "SkPerlinNoiseShader.h" 17 #include "SkPerlinNoiseShader.h"
19 #include "SkRectShaderImageFilter.h" 18 #include "SkRectShaderImageFilter.h"
20 #include "SkScalar.h" 19 #include "SkScalar.h"
21 #include "gm.h" 20 #include "gm.h"
22 21
23 #define RESIZE_FACTOR_X SkIntToScalar(2) 22 #define RESIZE_FACTOR_X SkIntToScalar(2)
24 #define RESIZE_FACTOR_Y SkIntToScalar(5) 23 #define RESIZE_FACTOR_Y SkIntToScalar(5)
25 24
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 SkIntToScalar(3), SkIntToScalar(3), SK_ColorGREEN, 83 SkIntToScalar(3), SkIntToScalar(3), SK_ColorGREEN,
85 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode), 84 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
86 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS electorType, 85 SkDisplacementMapEffect::Create(SkDisplacementMapEffect::kR_ChannelS electorType,
87 SkDisplacementMapEffect::kR_ChannelS electorType, 86 SkDisplacementMapEffect::kR_ChannelS electorType,
88 SkIntToScalar(12), 87 SkIntToScalar(12),
89 gradient.get(), 88 gradient.get(),
90 checkerboard.get()), 89 checkerboard.get()),
91 SkDilateImageFilter::Create(2, 2, checkerboard.get()), 90 SkDilateImageFilter::Create(2, 2, checkerboard.get()),
92 SkErodeImageFilter::Create(2, 2, checkerboard.get()), 91 SkErodeImageFilter::Create(2, 2, checkerboard.get()),
93 SkOffsetImageFilter::Create(SkIntToScalar(-16), SkIntToScalar(32)), 92 SkOffsetImageFilter::Create(SkIntToScalar(-16), SkIntToScalar(32)),
94 SkMatrixImageFilter::Create(resizeMatrix, kNone_SkFilterQuality), 93 SkImageFilter::CreateMatrixFilter(resizeMatrix, kNone_SkFilterQualit y),
95 SkRectShaderImageFilter::Create(noise), 94 SkRectShaderImageFilter::Create(noise),
96 }; 95 };
97 96
98 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64)); 97 SkRect r = SkRect::MakeWH(SkIntToScalar(64), SkIntToScalar(64));
99 SkScalar margin = SkIntToScalar(16); 98 SkScalar margin = SkIntToScalar(16);
100 SkRect bounds = r; 99 SkRect bounds = r;
101 bounds.outset(margin, margin); 100 bounds.outset(margin, margin);
102 101
103 for (int xOffset = 0; xOffset < 80; xOffset += 16) { 102 for (int xOffset = 0; xOffset < 80; xOffset += 16) {
104 canvas->save(); 103 canvas->save();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 SkBitmap fGradientCircle; 135 SkBitmap fGradientCircle;
137 typedef GM INHERITED; 136 typedef GM INHERITED;
138 }; 137 };
139 138
140 ////////////////////////////////////////////////////////////////////////////// 139 //////////////////////////////////////////////////////////////////////////////
141 140
142 static GM* MyFactory(void*) { return new ImageFiltersClippedGM; } 141 static GM* MyFactory(void*) { return new ImageFiltersClippedGM; }
143 static GMRegistry reg(MyFactory); 142 static GMRegistry reg(MyFactory);
144 143
145 } 144 }
OLDNEW
« no previous file with comments | « gm/filterfastbounds.cpp ('k') | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698