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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 context->getTestTarget(&tt); | 110 context->getTestTarget(&tt); |
111 if (NULL == tt.target()) { | 111 if (NULL == tt.target()) { |
112 SkDEBUGFAIL("Couldn't get Gr test target."); | 112 SkDEBUGFAIL("Couldn't get Gr test target."); |
113 return; | 113 return; |
114 } | 114 } |
115 GrDrawState* drawState = tt.target()->drawState(); | 115 GrDrawState* drawState = tt.target()->drawState(); |
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 GrEffectEdgeType edgeType = (GrEffectEdgeType) et; | 119 GrEffectEdgeType edgeType = (GrEffectEdgeType) et; |
120 SkAutoTUnref<GrEffectRef> effect(GrRRectEffect::Create(e
dgeType, rrect)); | 120 SkAutoTUnref<GrEffect> effect(GrRRectEffect::Create(edge
Type, rrect)); |
121 if (effect) { | 121 if (effect) { |
122 drawState->addCoverageEffect(effect); | 122 drawState->addCoverageEffect(effect); |
123 drawState->setIdentityViewMatrix(); | 123 drawState->setIdentityViewMatrix(); |
124 drawState->setRenderTarget(rt); | 124 drawState->setRenderTarget(rt); |
125 drawState->setColor(0xff000000); | 125 drawState->setColor(0xff000000); |
126 | 126 |
127 SkRect bounds = rrect.getBounds(); | 127 SkRect bounds = rrect.getBounds(); |
128 bounds.outset(2.f, 2.f); | 128 bounds.outset(2.f, 2.f); |
129 | 129 |
130 tt.target()->drawSimpleRect(bounds); | 130 tt.target()->drawSimpleRect(bounds); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) | 262 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) |
263 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) | 263 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) |
264 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) | 264 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) |
265 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) | 265 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) |
266 #if SK_SUPPORT_GPU | 266 #if SK_SUPPORT_GPU |
267 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) | 267 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) |
268 #endif | 268 #endif |
269 | 269 |
270 } | 270 } |
OLD | NEW |