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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 GrSurfaceDesc desc; | 80 GrSurfaceDesc desc; |
81 // use RT flag bit because in GL it makes the texture be bottom-
up | 81 // use RT flag bit because in GL it makes the texture be bottom-
up |
82 desc.fFlags = i ? kRenderTarget_GrSurfaceFlag : | 82 desc.fFlags = i ? kRenderTarget_GrSurfaceFlag : |
83 kNone_GrSurfaceFlags; | 83 kNone_GrSurfaceFlags; |
84 desc.fConfig = kSkia8888_GrPixelConfig; | 84 desc.fConfig = kSkia8888_GrPixelConfig; |
85 desc.fWidth = 2 * S; | 85 desc.fWidth = 2 * S; |
86 desc.fHeight = 2 * S; | 86 desc.fHeight = 2 * S; |
87 GrTexture* texture = | 87 GrTexture* texture = ctx->createTexture(desc, false, gTextureDat
a.get(), 0); |
88 ctx->createUncachedTexture(desc, gTextureData.get(), 0); | |
89 | 88 |
90 if (!texture) { | 89 if (!texture) { |
91 return; | 90 return; |
92 } | 91 } |
93 SkAutoTUnref<GrTexture> au(texture); | 92 SkAutoTUnref<GrTexture> au(texture); |
94 | 93 |
95 GrContext::AutoClip acs(ctx, SkRect::MakeWH(2*S, 2*S)); | 94 GrContext::AutoClip acs(ctx, SkRect::MakeWH(2*S, 2*S)); |
96 | 95 |
97 ctx->setRenderTarget(target); | 96 ctx->setRenderTarget(target); |
98 | 97 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 }; | 137 }; |
139 | 138 |
140 ////////////////////////////////////////////////////////////////////////////// | 139 ////////////////////////////////////////////////////////////////////////////// |
141 | 140 |
142 static GM* MyFactory(void*) { return new TexDataGM; } | 141 static GM* MyFactory(void*) { return new TexDataGM; } |
143 static GMRegistry reg(MyFactory); | 142 static GMRegistry reg(MyFactory); |
144 | 143 |
145 } | 144 } |
146 | 145 |
147 #endif | 146 #endif |
OLD | NEW |