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

Side by Side Diff: gm/samplerstress.cpp

Issue 173633003: Factory methods for heap-allocated SkMaskFilter objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add SkTableMaskFilter::Create(table) and remove deprecated SkEmbossMaskFilter constructor. Created 6 years, 10 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 | include/core/SkMaskFilter.h » ('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 Google Inc. 2 * Copyright 2012 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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 fShader.reset(SkShader::CreateBitmapShader(fTexture, 76 fShader.reset(SkShader::CreateBitmapShader(fTexture,
77 SkShader::kRepeat_TileMode, 77 SkShader::kRepeat_TileMode,
78 SkShader::kRepeat_TileMode)); 78 SkShader::kRepeat_TileMode));
79 } 79 }
80 80
81 void createMaskFilter() { 81 void createMaskFilter() {
82 if (NULL != fMaskFilter.get()) { 82 if (NULL != fMaskFilter.get()) {
83 return; 83 return;
84 } 84 }
85 85
86 fMaskFilter.reset(SkNEW(SkStippleMaskFilter)); 86 fMaskFilter.reset(SkStippleMaskFilter::Create());
87 } 87 }
88 88
89 virtual void onDraw(SkCanvas* canvas) { 89 virtual void onDraw(SkCanvas* canvas) {
90 90
91 createShader(); 91 createShader();
92 createMaskFilter(); 92 createMaskFilter();
93 93
94 canvas->save(); 94 canvas->save();
95 95
96 // draw a letter "M" with a green & red striped texture and a 96 // draw a letter "M" with a green & red striped texture and a
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 typedef GM INHERITED; 144 typedef GM INHERITED;
145 }; 145 };
146 146
147 ////////////////////////////////////////////////////////////////////////////// 147 //////////////////////////////////////////////////////////////////////////////
148 148
149 static GM* MyFactory(void*) { return new SamplerStressGM; } 149 static GM* MyFactory(void*) { return new SamplerStressGM; }
150 static GMRegistry reg(MyFactory); 150 static GMRegistry reg(MyFactory);
151 151
152 } 152 }
OLDNEW
« no previous file with comments | « no previous file | include/core/SkMaskFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698