OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); | 100 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); |
101 if (kEffect_Type == fType) { | 101 if (kEffect_Type == fType) { |
102 #if SK_SUPPORT_GPU | 102 #if SK_SUPPORT_GPU |
103 GrTestTarget tt; | 103 GrTestTarget tt; |
104 context->getTestTarget(&tt, rt); | 104 context->getTestTarget(&tt, rt); |
105 if (nullptr == tt.target()) { | 105 if (nullptr == tt.target()) { |
106 SkDEBUGFAIL("Couldn't get Gr test target."); | 106 SkDEBUGFAIL("Couldn't get Gr test target."); |
107 return; | 107 return; |
108 } | 108 } |
109 GrPipelineBuilder pipelineBuilder; | 109 GrPipelineBuilder pipelineBuilder; |
| 110 pipelineBuilder.setXPFactory( |
| 111 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode)
)->unref(); |
110 | 112 |
111 SkRRect rrect = fRRects[curRRect]; | 113 SkRRect rrect = fRRects[curRRect]; |
112 rrect.offset(SkIntToScalar(x), SkIntToScalar(y)); | 114 rrect.offset(SkIntToScalar(x), SkIntToScalar(y)); |
113 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; | 115 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; |
114 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Crea
te(edgeType, | 116 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Crea
te(edgeType, |
115
rrect)); | 117
rrect)); |
116 if (fp) { | 118 if (fp) { |
117 pipelineBuilder.addCoverageFragmentProcessor(fp); | 119 pipelineBuilder.addCoverageFragmentProcessor(fp); |
118 pipelineBuilder.setRenderTarget(rt); | 120 pipelineBuilder.setRenderTarget(rt); |
119 | 121 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 259 |
258 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) | 260 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) |
259 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) | 261 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) |
260 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) | 262 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) |
261 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) | 263 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) |
262 #if SK_SUPPORT_GPU | 264 #if SK_SUPPORT_GPU |
263 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) | 265 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) |
264 #endif | 266 #endif |
265 | 267 |
266 } | 268 } |
OLD | NEW |