OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 // This test only works with the GPU backend. | 9 // This test only works with the GPU backend. |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 GrSurfaceDesc desc; | 65 GrSurfaceDesc desc; |
66 // use RT flag bit because in GL it makes the texture be bottom-
up | 66 // use RT flag bit because in GL it makes the texture be bottom-
up |
67 desc.fFlags = i ? kRenderTarget_GrSurfaceFlag : | 67 desc.fFlags = i ? kRenderTarget_GrSurfaceFlag : |
68 kNone_GrSurfaceFlags; | 68 kNone_GrSurfaceFlags; |
69 desc.fConfig = kSkia8888_GrPixelConfig; | 69 desc.fConfig = kSkia8888_GrPixelConfig; |
70 desc.fWidth = 2 * S; | 70 desc.fWidth = 2 * S; |
71 desc.fHeight = 2 * S; | 71 desc.fHeight = 2 * S; |
72 GrTexture* texture = ctx->textureProvider()->createTexture( | 72 GrTexture* texture = ctx->textureProvider()->createTexture( |
73 desc, false, gTextureData.get(), 0); | 73 desc, SkBudgeted::kNo, gTextureData.get(), 0); |
74 | 74 |
75 if (!texture) { | 75 if (!texture) { |
76 return; | 76 return; |
77 } | 77 } |
78 SkAutoTUnref<GrTexture> au(texture); | 78 SkAutoTUnref<GrTexture> au(texture); |
79 | 79 |
80 // setup new clip | 80 // setup new clip |
81 GrClip clip(SkRect::MakeWH(2*S, 2*S)); | 81 GrClip clip(SkRect::MakeWH(2*S, 2*S)); |
82 | 82 |
83 GrPaint paint; | 83 GrPaint paint; |
(...skipping 26 matching lines...) Expand all Loading... |
110 texture->writePixels(S, (i ? 0 : S), S, S, | 110 texture->writePixels(S, (i ? 0 : S), S, S, |
111 texture->config(), gTextureData.get(), | 111 texture->config(), gTextureData.get(), |
112 4 * stride); | 112 4 * stride); |
113 drawContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S))
; | 113 drawContext->drawRect(clip, paint, vm, SkRect::MakeWH(2*S, 2*S))
; |
114 } | 114 } |
115 } else { | 115 } else { |
116 skiagm::GM::DrawGpuOnlyMessage(canvas); | 116 skiagm::GM::DrawGpuOnlyMessage(canvas); |
117 } | 117 } |
118 } | 118 } |
119 #endif | 119 #endif |
OLD | NEW |