OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2016 Google Inc. | 3 * Copyright 2016 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 format = GR_GL_BGRA; | 80 format = GR_GL_BGRA; |
81 } else { | 81 } else { |
82 SkASSERT(kSkia8888_GrPixelConfig == kRGBA_8888_GrPixelConfig); | 82 SkASSERT(kSkia8888_GrPixelConfig == kRGBA_8888_GrPixelConfig); |
83 format = GR_GL_RGBA; | 83 format = GR_GL_RGBA; |
84 } | 84 } |
85 | 85 |
86 const GrGLInterface* gl = glCtx->interface(); | 86 const GrGLInterface* gl = glCtx->interface(); |
87 // Useful for debugging whether errors result from use of RECTANGLE | 87 // Useful for debugging whether errors result from use of RECTANGLE |
88 // #define TARGET GR_GL_TEXTURE_2D | 88 // #define TARGET GR_GL_TEXTURE_2D |
89 #define TARGET GR_GL_TEXTURE_RECTANGLE | 89 #define TARGET GR_GL_TEXTURE_RECTANGLE |
90 GrGLuint id; | 90 GrGLuint id = 0; |
91 GR_GL_CALL(gl, GenTextures(1, &id)); | 91 GR_GL_CALL(gl, GenTextures(1, &id)); |
92 GR_GL_CALL(gl, BindTexture(TARGET, id)); | 92 GR_GL_CALL(gl, BindTexture(TARGET, id)); |
93 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_MAG_FILTER, | 93 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_MAG_FILTER, |
94 GR_GL_NEAREST)); | 94 GR_GL_NEAREST)); |
95 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_MIN_FILTER, | 95 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_MIN_FILTER, |
96 GR_GL_NEAREST)); | 96 GR_GL_NEAREST)); |
97 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_S, | 97 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_S, |
98 GR_GL_CLAMP_TO_EDGE)); | 98 GR_GL_CLAMP_TO_EDGE)); |
99 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_T, | 99 GR_GL_CALL(gl, TexParameteri(TARGET, GR_GL_TEXTURE_WRAP_T, |
100 GR_GL_CLAMP_TO_EDGE)); | 100 GR_GL_CLAMP_TO_EDGE)); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 private: | 184 private: |
185 typedef GM INHERITED; | 185 typedef GM INHERITED; |
186 }; | 186 }; |
187 | 187 |
188 DEF_GM(return new RectangleTexture;) | 188 DEF_GM(return new RectangleTexture;) |
189 } | 189 } |
190 | 190 |
191 #endif | 191 #endif |
OLD | NEW |