OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 break; | 274 break; |
275 } | 275 } |
276 | 276 |
277 return alphaIndex + targetIndex * 4 + sourceFormatIndex * 4 * NUM_SAMPLERS + | 277 return alphaIndex + targetIndex * 4 + sourceFormatIndex * 4 * NUM_SAMPLERS + |
278 destFormatIndex * 4 * NUM_SAMPLERS * NUM_S_FORMAT; | 278 destFormatIndex * 4 * NUM_SAMPLERS * NUM_S_FORMAT; |
279 } | 279 } |
280 | 280 |
281 const char* kShaderPrecisionPreamble = | 281 const char* kShaderPrecisionPreamble = |
282 "#ifdef GL_ES\n" | 282 "#ifdef GL_ES\n" |
283 "precision mediump float;\n" | 283 "precision mediump float;\n" |
| 284 "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" |
| 285 "#define TexCoordPrecision highp\n" |
| 286 "#else\n" |
284 "#define TexCoordPrecision mediump\n" | 287 "#define TexCoordPrecision mediump\n" |
| 288 "#endif\n" |
285 "#else\n" | 289 "#else\n" |
286 "#define TexCoordPrecision\n" | 290 "#define TexCoordPrecision\n" |
287 "#endif\n"; | 291 "#endif\n"; |
288 | 292 |
289 std::string GetVertexShaderSource(const gl::GLVersionInfo& gl_version_info, | 293 std::string GetVertexShaderSource(const gl::GLVersionInfo& gl_version_info, |
290 GLenum target) { | 294 GLenum target) { |
291 std::string source; | 295 std::string source; |
292 | 296 |
293 if (gl_version_info.is_es || gl_version_info.IsLowerThanGL(3, 2)) { | 297 if (gl_version_info.is_es || gl_version_info.IsLowerThanGL(3, 2)) { |
294 if (gl_version_info.is_es3 && target != GL_TEXTURE_EXTERNAL_OES) { | 298 if (gl_version_info.is_es3 && target != GL_TEXTURE_EXTERNAL_OES) { |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 decoder->RestoreTextureUnitBindings(0); | 1133 decoder->RestoreTextureUnitBindings(0); |
1130 decoder->RestoreActiveTexture(); | 1134 decoder->RestoreActiveTexture(); |
1131 decoder->RestoreProgramBindings(); | 1135 decoder->RestoreProgramBindings(); |
1132 decoder->RestoreBufferBindings(); | 1136 decoder->RestoreBufferBindings(); |
1133 decoder->RestoreFramebufferBindings(); | 1137 decoder->RestoreFramebufferBindings(); |
1134 decoder->RestoreGlobalState(); | 1138 decoder->RestoreGlobalState(); |
1135 } | 1139 } |
1136 | 1140 |
1137 } // namespace gles2 | 1141 } // namespace gles2 |
1138 } // namespace gpu | 1142 } // namespace gpu |
OLD | NEW |