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

Side by Side Diff: samplecode/ClockFaceView.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 #include "SkXfermode.h" 157 #include "SkXfermode.h"
158 158
159 static void apply_shader(SkPaint* paint, float scale) 159 static void apply_shader(SkPaint* paint, float scale)
160 { 160 {
161 SkPaint p; 161 SkPaint p;
162 SkLayerRasterizer::Builder rastBuilder; 162 SkLayerRasterizer::Builder rastBuilder;
163 163
164 p.setAntiAlias(true); 164 p.setAntiAlias(true);
165 r7(&rastBuilder, p, scale); 165 r7(&rastBuilder, p, scale);
166 paint->setRasterizer(rastBuilder.detachRasterizer())->unref(); 166 paint->setRasterizer(rastBuilder.detach());
167 167
168 paint->setColor(SK_ColorBLUE); 168 paint->setColor(SK_ColorBLUE);
169 } 169 }
170 170
171 class ClockFaceView : public SkView { 171 class ClockFaceView : public SkView {
172 SkTypeface* fFace; 172 SkTypeface* fFace;
173 SkScalar fInterp; 173 SkScalar fInterp;
174 SkScalar fDx; 174 SkScalar fDx;
175 175
176 public: 176 public:
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 251
252 private: 252 private:
253 typedef SkView INHERITED; 253 typedef SkView INHERITED;
254 }; 254 };
255 255
256 ////////////////////////////////////////////////////////////////////////////// 256 //////////////////////////////////////////////////////////////////////////////
257 257
258 static SkView* MyFactory() { return new ClockFaceView; } 258 static SkView* MyFactory() { return new ClockFaceView; }
259 static SkViewRegister reg(MyFactory); 259 static SkViewRegister reg(MyFactory);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698