OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 // This test only works with the GPU backend. | 8 // This test only works with the GPU backend. |
10 | 9 |
11 #include "gm.h" | 10 #include "gm.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // #define TARGET GR_GL_TEXTURE_2D | 87 // #define TARGET GR_GL_TEXTURE_2D |
89 #define TARGET GR_GL_TEXTURE_RECTANGLE | 88 #define TARGET GR_GL_TEXTURE_RECTANGLE |
90 GrGLuint id = 0; | 89 GrGLuint id = 0; |
91 GR_GL_CALL(gl, GenTextures(1, &id)); | 90 GR_GL_CALL(gl, GenTextures(1, &id)); |
92 GR_GL_CALL(gl, BindTexture(TARGET, id)); | 91 GR_GL_CALL(gl, BindTexture(TARGET, id)); |
93 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_MAG_FILTER, | 92 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_MAG_FILTER, |
94 GR_GL_NEAREST)); | 93 GR_GL_NEAREST)); |
95 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_MIN_FILTER, | 94 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_MIN_FILTER, |
96 GR_GL_NEAREST)); | 95 GR_GL_NEAREST)); |
97 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_S, | 96 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_S, |
98 GR_GL_CLAMP_TO_EDGE)); | 97 GR_GL_CLAMP_TO_EDGE)); |
99 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_T, | 98 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_T, |
100 GR_GL_CLAMP_TO_EDGE)); | 99 GR_GL_CLAMP_TO_EDGE)); |
101 GR_GL_CALL(gl, TexImage2D(TARGET, 0, GR_GL_RGBA, width, height, 0, | 100 GR_GL_CALL(gl, TexImage2D(TARGET, 0, GR_GL_RGBA, width, height, 0, |
102 format, GR_GL_UNSIGNED_BYTE, pixels)); | 101 format, GR_GL_UNSIGNED_BYTE, pixels)); |
103 | 102 |
104 | 103 |
105 context->resetContext(); | 104 context->resetContext(); |
106 GrGLTextureInfo info; | 105 GrGLTextureInfo info; |
107 info.fID = id; | 106 info.fID = id; |
108 info.fTarget = TARGET; | 107 info.fTarget = TARGET; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 181 } |
183 | 182 |
184 private: | 183 private: |
185 typedef GM INHERITED; | 184 typedef GM INHERITED; |
186 }; | 185 }; |
187 | 186 |
188 DEF_GM(return new RectangleTexture;) | 187 DEF_GM(return new RectangleTexture;) |
189 } | 188 } |
190 | 189 |
191 #endif | 190 #endif |
OLD | NEW |