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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 paint.setAntiAlias(true); | 82 paint.setAntiAlias(true); |
83 } | 83 } |
84 | 84 |
85 static const SkRect kMaxTileBound = SkRect::MakeWH(SkIntToScalar(kTileX)
, | 85 static const SkRect kMaxTileBound = SkRect::MakeWH(SkIntToScalar(kTileX)
, |
86 SkIntToScalar(kTileY)
); | 86 SkIntToScalar(kTileY)
); |
87 #ifdef SK_DEBUG | 87 #ifdef SK_DEBUG |
88 static const SkRect kMaxImageBound = SkRect::MakeWH(SkIntToScalar(kImage
Width), | 88 static const SkRect kMaxImageBound = SkRect::MakeWH(SkIntToScalar(kImage
Width), |
89 SkIntToScalar(kImage
Height)); | 89 SkIntToScalar(kImage
Height)); |
90 #endif | 90 #endif |
91 | 91 |
| 92 #if SK_SUPPORT_GPU |
92 int lastEdgeType = (kEffect_Type == fType) ? kLast_GrEffectEdgeType: 0; | 93 int lastEdgeType = (kEffect_Type == fType) ? kLast_GrEffectEdgeType: 0; |
| 94 #else |
| 95 int lastEdgeType = 0; |
| 96 #endif |
93 | 97 |
94 int y = 1; | 98 int y = 1; |
95 for (int et = (GrEffectEdgeType) 0; et <= lastEdgeType; ++et) { | 99 for (int et = 0; et <= lastEdgeType; ++et) { |
96 int x = 1; | 100 int x = 1; |
97 for (int curRRect = 0; curRRect < kNumRRects; ++curRRect) { | 101 for (int curRRect = 0; curRRect < kNumRRects; ++curRRect) { |
98 bool drew = true; | 102 bool drew = true; |
99 #ifdef SK_DEBUG | 103 #ifdef SK_DEBUG |
100 SkASSERT(kMaxTileBound.contains(fRRects[curRRect].getBounds())); | 104 SkASSERT(kMaxTileBound.contains(fRRects[curRRect].getBounds())); |
101 SkRect imageSpaceBounds = fRRects[curRRect].getBounds(); | 105 SkRect imageSpaceBounds = fRRects[curRRect].getBounds(); |
102 imageSpaceBounds.offset(SkIntToScalar(x), SkIntToScalar(y)); | 106 imageSpaceBounds.offset(SkIntToScalar(x), SkIntToScalar(y)); |
103 SkASSERT(kMaxImageBound.contains(imageSpaceBounds)); | 107 SkASSERT(kMaxImageBound.contains(imageSpaceBounds)); |
104 #endif | 108 #endif |
105 canvas->save(); | 109 canvas->save(); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 244 |
241 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) | 245 DEF_GM( return new RRectGM(RRectGM::kAA_Draw_Type); ) |
242 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) | 246 DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); ) |
243 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) | 247 DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); ) |
244 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) | 248 DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); ) |
245 #if SK_SUPPORT_GPU | 249 #if SK_SUPPORT_GPU |
246 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) | 250 DEF_GM( return new RRectGM(RRectGM::kEffect_Type); ) |
247 #endif | 251 #endif |
248 | 252 |
249 } | 253 } |
OLD | NEW |