OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
9 | 9 |
10 #include "gm.h" | 10 #include "gm.h" |
11 | 11 |
12 #if SK_SUPPORT_GPU | 12 #if SK_SUPPORT_GPU |
13 #include "GrContext.h" | 13 #include "GrContext.h" |
14 #include "GrDrawContext.h" | 14 #include "GrDrawContext.h" |
| 15 #include "GrFixedClip.h" |
15 #include "SkColorPriv.h" | 16 #include "SkColorPriv.h" |
16 #include "effects/GrPorterDuffXferProcessor.h" | 17 #include "effects/GrPorterDuffXferProcessor.h" |
17 #include "effects/GrSimpleTextureEffect.h" | 18 #include "effects/GrSimpleTextureEffect.h" |
18 | 19 |
19 static const int S = 200; | 20 static const int S = 200; |
20 | 21 |
21 DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) { | 22 DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) { |
22 GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDrawCont
ext(); | 23 GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDrawCont
ext(); |
23 if (!drawContext) { | 24 if (!drawContext) { |
24 skiagm::GM::DrawGpuOnlyMessage(canvas); | 25 skiagm::GM::DrawGpuOnlyMessage(canvas); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 113 } |
113 } | 114 } |
114 texture->writePixels(S, (i ? 0 : S), S, S, | 115 texture->writePixels(S, (i ? 0 : S), S, S, |
115 texture->config(), gTextureData.get(), | 116 texture->config(), gTextureData.get(), |
116 4 * stride); | 117 4 * stride); |
117 drawContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S)); | 118 drawContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S)); |
118 } | 119 } |
119 } | 120 } |
120 #endif | 121 #endif |
121 | 122 |
OLD | NEW |