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

Side by Side Diff: gm/bigrrectaaeffect.cpp

Issue 1988923002: Remove GrRenderTarget from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 6 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 | « gm/beziereffects.cpp ('k') | gm/constcolorprocessor.cpp » ('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 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 GrPipelineBuilder pipelineBuilder; 77 GrPipelineBuilder pipelineBuilder;
78 pipelineBuilder.setXPFactory( 78 pipelineBuilder.setXPFactory(
79 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref (); 79 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref ();
80 80
81 SkRRect rrect = fRRect; 81 SkRRect rrect = fRRect;
82 rrect.offset(SkIntToScalar(x + kGap), SkIntToScalar(y + kGap)); 82 rrect.offset(SkIntToScalar(x + kGap), SkIntToScalar(y + kGap));
83 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Create(edgeT ype, rrect)); 83 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Create(edgeT ype, rrect));
84 SkASSERT(fp); 84 SkASSERT(fp);
85 if (fp) { 85 if (fp) {
86 pipelineBuilder.addCoverageFragmentProcessor(fp); 86 pipelineBuilder.addCoverageFragmentProcessor(fp);
87 pipelineBuilder.setRenderTarget(drawContext->accessRenderTar get());
88 87
89 SkRect bounds = testBounds; 88 SkRect bounds = testBounds;
90 bounds.offset(SkIntToScalar(x), SkIntToScalar(y)); 89 bounds.offset(SkIntToScalar(x), SkIntToScalar(y));
91 90
92 SkAutoTUnref<GrDrawBatch> batch( 91 SkAutoTUnref<GrDrawBatch> batch(
93 GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMa trix::I(), bounds, 92 GrRectBatchFactory::CreateNonAAFill(0xff000000, SkMa trix::I(), bounds,
94 nullptr, nullptr )); 93 nullptr, nullptr ));
95 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin eBuilder, batch); 94 drawContext->drawContextPriv().testingOnly_drawBatch(pipelin eBuilder, batch);
96 } 95 }
97 canvas->restore(); 96 canvas->restore();
(...skipping 25 matching lines...) Expand all
123 122
124 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRect(SkRect::MakeIWH(kSize, kSize)), "rect"); ) 123 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRect(SkRect::MakeIWH(kSize, kSize)), "rect"); )
125 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize, kSize)), "circle"); ) 124 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize, kSize)), "circle"); )
126 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize - 1, kSize - 10)), "ellipse"); ) 125 DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeOval(SkRect::MakeIWH(kSize - 1, kSize - 10)), "ellipse"); )
127 // The next two have small linear segments between the corners 126 // The next two have small linear segments between the corners
128 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"); ) 127 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"); )
129 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"); ) 128 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"); )
130 129
131 } 130 }
132 #endif 131 #endif
OLDNEW
« no previous file with comments | « gm/beziereffects.cpp ('k') | gm/constcolorprocessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698