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

Side by Side Diff: samplecode/SamplePathEffects.cpp

Issue 1821533002: guard rasterizer and drawlooper setters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update android sdk Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkAnimTimer.h" 9 #include "SkAnimTimer.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 paint.setARGB(0xFF, 0, 0xBB, 0); 146 paint.setARGB(0xFF, 0, 0xBB, 0);
147 paint.setPathEffect(make_pe(3, fPhase)); 147 paint.setPathEffect(make_pe(3, fPhase));
148 canvas->drawPath(fPath, paint); 148 canvas->drawPath(fPath, paint);
149 149
150 canvas->translate(0, 50); 150 canvas->translate(0, 50);
151 151
152 paint.setARGB(0xFF, 0, 0, 0); 152 paint.setARGB(0xFF, 0, 0, 0);
153 paint.setPathEffect(make_warp_pe(fPhase)); 153 paint.setPathEffect(make_warp_pe(fPhase));
154 TestRastBuilder testRastBuilder; 154 TestRastBuilder testRastBuilder;
155 paint.setRasterizer(testRastBuilder.detachRasterizer())->unref(); 155 paint.setRasterizer(testRastBuilder.detach());
156 canvas->drawPath(fPath, paint); 156 canvas->drawPath(fPath, paint);
157 } 157 }
158 158
159 bool onAnimate(const SkAnimTimer& timer) override { 159 bool onAnimate(const SkAnimTimer& timer) override {
160 fPhase = timer.scaled(40); 160 fPhase = timer.scaled(40);
161 return true; 161 return true;
162 } 162 }
163 163
164 private: 164 private:
165 typedef SampleView INHERITED; 165 typedef SampleView INHERITED;
166 }; 166 };
167 167
168 ////////////////////////////////////////////////////////////////////////////// 168 //////////////////////////////////////////////////////////////////////////////
169 169
170 static SkView* MyFactory() { return new PathEffectView; } 170 static SkView* MyFactory() { return new PathEffectView; }
171 static SkViewRegister reg(MyFactory); 171 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698