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

Side by Side Diff: gm/convexpolyeffect.cpp

Issue 1918003003: Bring sk_sp to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 8 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 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 // This test only works with the GPU backend. 8 // This test only works with the GPU backend.
9 9
10 #include "gm.h" 10 #include "gm.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget (); 156 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget ();
157 if (nullptr == rt) { 157 if (nullptr == rt) {
158 skiagm::GM::DrawGpuOnlyMessage(canvas); 158 skiagm::GM::DrawGpuOnlyMessage(canvas);
159 return; 159 return;
160 } 160 }
161 GrContext* context = rt->getContext(); 161 GrContext* context = rt->getContext();
162 if (nullptr == context) { 162 if (nullptr == context) {
163 return; 163 return;
164 } 164 }
165 165
166 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); 166 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt)));
167 if (!drawContext) { 167 if (!drawContext) {
168 return; 168 return;
169 } 169 }
170 170
171 SkScalar y = 0; 171 SkScalar y = 0;
172 static const SkScalar kDX = 12.f; 172 static const SkScalar kDX = 12.f;
173 for (PathList::Iter iter(fPaths, PathList::Iter::kHead_IterStart); 173 for (PathList::Iter iter(fPaths, PathList::Iter::kHead_IterStart);
174 iter.get(); 174 iter.get();
175 iter.next()) { 175 iter.next()) {
176 const SkPath* path = iter.get(); 176 const SkPath* path = iter.get();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 PathList fPaths; 261 PathList fPaths;
262 RectList fRects; 262 RectList fRects;
263 263
264 typedef GM INHERITED; 264 typedef GM INHERITED;
265 }; 265 };
266 266
267 DEF_GM(return new ConvexPolyEffect;) 267 DEF_GM(return new ConvexPolyEffect;)
268 } 268 }
269 269
270 #endif 270 #endif
OLDNEW
« gm/beziereffects.cpp ('K') | « gm/constcolorprocessor.cpp ('k') | gm/rrects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698