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

Side by Side Diff: gm/imagefiltersscaled.cpp

Issue 873333004: s/sk_tools::DrawCheckerboard/sk_tool_utils::draw_checkerboard/ (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « gm/imagefiltersclipped.cpp ('k') | gm/offsetimagefilter.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 "Checkerboard.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 "SkLightingImageFilter.h" 15 #include "SkLightingImageFilter.h"
16 #include "SkMatrixImageFilter.h" 16 #include "SkMatrixImageFilter.h"
17 #include "SkMorphologyImageFilter.h" 17 #include "SkMorphologyImageFilter.h"
18 #include "SkOffsetImageFilter.h" 18 #include "SkOffsetImageFilter.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 ); 57 );
58 SkPaint paint; 58 SkPaint paint;
59 paint.setShader(shader); 59 paint.setShader(shader);
60 canvas.drawCircle(x, y, radius, paint); 60 canvas.drawCircle(x, y, radius, paint);
61 } 61 }
62 62
63 virtual void onDraw(SkCanvas* canvas) { 63 virtual void onDraw(SkCanvas* canvas) {
64 if (!fInitialized) { 64 if (!fInitialized) {
65 fCheckerboard.allocN32Pixels(64, 64); 65 fCheckerboard.allocN32Pixels(64, 64);
66 SkCanvas checkerboardCanvas(fCheckerboard); 66 SkCanvas checkerboardCanvas(fCheckerboard);
67 sk_tools::DrawCheckerboard(&checkerboardCanvas, 0xFFA0A0A0, 0xFF4040 40, 8); 67 sk_tool_utils::draw_checkerboard(&checkerboardCanvas, 0xFFA0A0A0, 0x FF404040, 8);
68 68
69 this->make_gradient_circle(64, 64); 69 this->make_gradient_circle(64, 64);
70 fInitialized = true; 70 fInitialized = true;
71 } 71 }
72 canvas->clear(0x00000000); 72 canvas->clear(0x00000000);
73 73
74 SkAutoTUnref<SkImageFilter> gradient(SkBitmapSource::Create(fGradientCir cle)); 74 SkAutoTUnref<SkImageFilter> gradient(SkBitmapSource::Create(fGradientCir cle));
75 SkAutoTUnref<SkImageFilter> checkerboard(SkBitmapSource::Create(fChecker board)); 75 SkAutoTUnref<SkImageFilter> checkerboard(SkBitmapSource::Create(fChecker board));
76 SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise( 76 SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise(
77 SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0)); 77 SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0));
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 SkBitmap fGradientCircle; 155 SkBitmap fGradientCircle;
156 typedef GM INHERITED; 156 typedef GM INHERITED;
157 }; 157 };
158 158
159 ////////////////////////////////////////////////////////////////////////////// 159 //////////////////////////////////////////////////////////////////////////////
160 160
161 static GM* MyFactory(void*) { return new ImageFiltersScaledGM; } 161 static GM* MyFactory(void*) { return new ImageFiltersScaledGM; }
162 static GMRegistry reg(MyFactory); 162 static GMRegistry reg(MyFactory);
163 163
164 } 164 }
OLDNEW
« no previous file with comments | « gm/imagefiltersclipped.cpp ('k') | gm/offsetimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698