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

Side by Side Diff: gm/bigrrectaaeffect.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 2015 Google Inc. 2 * Copyright 2015 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 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 SkISize onISize() override { return SkISize::Make(fWidth, fHeight); } 49 SkISize onISize() override { return SkISize::Make(fWidth, fHeight); }
50 50
51 void onDraw(SkCanvas* canvas) override { 51 void onDraw(SkCanvas* canvas) override {
52 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget (); 52 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget ();
53 GrContext* context = rt ? rt->getContext() : nullptr; 53 GrContext* context = rt ? rt->getContext() : nullptr;
54 if (!context) { 54 if (!context) {
55 skiagm::GM::DrawGpuOnlyMessage(canvas); 55 skiagm::GM::DrawGpuOnlyMessage(canvas);
56 return; 56 return;
57 } 57 }
58 58
59 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt)); 59 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(rt)));
60 if (!drawContext) { 60 if (!drawContext) {
61 return; 61 return;
62 } 62 }
63 63
64 SkPaint paint; 64 SkPaint paint;
65 65
66 int y = kPad; 66 int y = kPad;
67 int x = kPad; 67 int x = kPad;
68 static const GrPrimitiveEdgeType kEdgeTypes[] = { 68 static const GrPrimitiveEdgeType kEdgeTypes[] = {
69 kFillAA_GrProcessorEdgeType, 69 kFillAA_GrProcessorEdgeType,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRect(SkRect::MakeIWH(kSize, kSize)), "rect"); ) 130 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRect(SkRect::MakeIWH(kSize, kSize)), "rect"); )
131 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize, kSize)), "circle"); ) 131 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize, kSize)), "circle"); )
132 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize - 1, kSize - 10)), "ellipse"); ) 132 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize - 1, kSize - 10)), "ellipse"); )
133 // The next two have small linear segments between the corners 133 // The next two have small linear segments between the corners
134 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize - 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 10.f), "circular_corner"); ) 134 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize - 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 10.f), "circular_corner"); )
135 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize - 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 15.f), "elliptical_corner"); ) 135 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize - 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 15.f), "elliptical_corner"); )
136 136
137 } 137 }
138 #endif 138 #endif
OLDNEW
« gm/beziereffects.cpp ('K') | « gm/beziereffects.cpp ('k') | gm/constcolorprocessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698