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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 SkRRect rrect = fRRects[curRRect]; | 117 SkRRect rrect = fRRects[curRRect]; |
118 rrect.offset(SkIntToScalar(x), SkIntToScalar(y)); | 118 rrect.offset(SkIntToScalar(x), SkIntToScalar(y)); |
119 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; | 119 GrPrimitiveEdgeType edgeType = (GrPrimitiveEdgeType) et; |
120 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Crea
te(edgeType, | 120 SkAutoTUnref<GrFragmentProcessor> fp(GrRRectEffect::Crea
te(edgeType, |
121
rrect)); | 121
rrect)); |
122 if (fp) { | 122 if (fp) { |
123 drawState.addCoverageProcessor(fp); | 123 drawState.addCoverageProcessor(fp); |
124 drawState.setIdentityViewMatrix(); | 124 drawState.setIdentityViewMatrix(); |
125 drawState.setRenderTarget(rt); | 125 drawState.setRenderTarget(rt); |
126 drawState.setColor(0xff000000); | |
127 | 126 |
128 SkRect bounds = rrect.getBounds(); | 127 SkRect bounds = rrect.getBounds(); |
129 bounds.outset(2.f, 2.f); | 128 bounds.outset(2.f, 2.f); |
130 | 129 |
131 tt.target()->drawSimpleRect(&drawState, bounds); | 130 tt.target()->drawSimpleRect(&drawState, 0xff000000,
bounds); |
132 } else { | 131 } else { |
133 drew = false; | 132 drew = false; |
134 } | 133 } |
135 #endif | 134 #endif |
136 } else if (kBW_Clip_Type == fType || kAA_Clip_Type == fType)
{ | 135 } else if (kBW_Clip_Type == fType || kAA_Clip_Type == fType)
{ |
137 bool aaClip = (kAA_Clip_Type == fType); | 136 bool aaClip = (kAA_Clip_Type == fType); |
138 canvas->clipRRect(fRRects[curRRect], SkRegion::kReplace_
Op, aaClip); | 137 canvas->clipRRect(fRRects[curRRect], SkRegion::kReplace_
Op, aaClip); |
139 canvas->drawRect(kMaxTileBound, paint); | 138 canvas->drawRect(kMaxTileBound, paint); |
140 } else { | 139 } else { |
141 canvas->drawRRect(fRRects[curRRect], paint); | 140 canvas->drawRRect(fRRects[curRRect], paint); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 261 |
263 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) | 262 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) |
264 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) | 263 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) |
265 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) | 264 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) |
266 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) | 265 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) |
267 #if SK_SUPPORT_GPU | 266 #if SK_SUPPORT_GPU |
268 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) | 267 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) |
269 #endif | 268 #endif |
270 | 269 |
271 } | 270 } |
OLD | NEW |