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

Side by Side Diff: gm/bigrrectaaeffect.cpp

Issue 1471053002: Don't create a GXPFactory when blend is SrcOver (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix compile Created 5 years 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/convexpolyeffect.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 "GrTest.h" 10 #include "GrTest.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #endif 64 #endif
65 canvas->save(); 65 canvas->save();
66 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); 66 canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
67 GrTestTarget tt; 67 GrTestTarget tt;
68 context->getTestTarget(&tt, rt); 68 context->getTestTarget(&tt, rt);
69 if (nullptr == tt.target()) { 69 if (nullptr == tt.target()) {
70 SkDEBUGFAIL("Couldn't get Gr test target."); 70 SkDEBUGFAIL("Couldn't get Gr test target.");
71 return; 71 return;
72 } 72 }
73 GrPipelineBuilder pipelineBuilder; 73 GrPipelineBuilder pipelineBuilder;
74 pipelineBuilder.setXPFactory(
75 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->u nref();
74 76
75 SkRRect rrect = fRRects[curRRect]; 77 SkRRect rrect = fRRects[curRRect];
76 rrect.offset(SkIntToScalar(x), SkIntToScalar(y)); 78 rrect.offset(SkIntToScalar(x), SkIntToScalar(y));
77 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Create(e dgeType, rrect)); 79 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Create(e dgeType, rrect));
78 SkASSERT(fp); 80 SkASSERT(fp);
79 if (fp) { 81 if (fp) {
80 pipelineBuilder.addCoverageFragmentProcessor(fp); 82 pipelineBuilder.addCoverageFragmentProcessor(fp);
81 pipelineBuilder.setRenderTarget(rt); 83 pipelineBuilder.setRenderTarget(rt);
82 84
83 SkRect bounds = SkRect::MakeWH(SkIntToScalar(kMaxSize), 85 SkRect bounds = SkRect::MakeWH(SkIntToScalar(kMaxSize),
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 SkTDArray<SkRRect> fRRects; 125 SkTDArray<SkRRect> fRRects;
124 typedef GM INHERITED; 126 typedef GM INHERITED;
125 }; 127 };
126 128
127 /////////////////////////////////////////////////////////////////////////////// 129 ///////////////////////////////////////////////////////////////////////////////
128 130
129 DEF_GM( return new BigRRectAAEffectGM (); ) 131 DEF_GM( return new BigRRectAAEffectGM (); )
130 132
131 } 133 }
132 #endif 134 #endif
OLDNEW
« no previous file with comments | « gm/beziereffects.cpp ('k') | gm/convexpolyeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698