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_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 16505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16516 case GL_SRGB8: | 16516 case GL_SRGB8: |
16517 case GL_RGB565: | 16517 case GL_RGB565: |
16518 case GL_RGB8UI: | 16518 case GL_RGB8UI: |
16519 case GL_SRGB8_ALPHA8: | 16519 case GL_SRGB8_ALPHA8: |
16520 case GL_RGB5_A1: | 16520 case GL_RGB5_A1: |
16521 case GL_RGBA4: | 16521 case GL_RGBA4: |
16522 case GL_RGBA8UI: | 16522 case GL_RGBA8UI: |
16523 valid_dest_format = feature_info_->IsWebGL2OrES3Context(); | 16523 valid_dest_format = feature_info_->IsWebGL2OrES3Context(); |
16524 break; | 16524 break; |
16525 case GL_RGB9_E5: | 16525 case GL_RGB9_E5: |
16526 valid_dest_format = !gl_version_info().is_es; | |
16527 break; | |
16528 case GL_R16F: | 16526 case GL_R16F: |
16529 case GL_R32F: | 16527 case GL_R32F: |
16530 case GL_RG16F: | 16528 case GL_RG16F: |
16531 case GL_RG32F: | 16529 case GL_RG32F: |
16532 case GL_RGB16F: | 16530 case GL_RGB16F: |
16533 case GL_RGBA16F: | 16531 case GL_RGBA16F: |
16534 case GL_R11F_G11F_B10F: | 16532 case GL_R11F_G11F_B10F: |
16535 valid_dest_format = feature_info_->ext_color_buffer_float_available(); | 16533 valid_dest_format = feature_info_->ext_color_buffer_float_available(); |
16536 break; | 16534 break; |
16537 case GL_RGB32F: | 16535 case GL_RGB32F: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16588 bool flip_y, | 16586 bool flip_y, |
16589 bool premultiply_alpha, | 16587 bool premultiply_alpha, |
16590 bool unpremultiply_alpha) { | 16588 bool unpremultiply_alpha) { |
16591 bool premultiply_alpha_change = premultiply_alpha ^ unpremultiply_alpha; | 16589 bool premultiply_alpha_change = premultiply_alpha ^ unpremultiply_alpha; |
16592 bool source_format_color_renderable = | 16590 bool source_format_color_renderable = |
16593 Texture::ColorRenderable(GetFeatureInfo(), source_internal_format, false); | 16591 Texture::ColorRenderable(GetFeatureInfo(), source_internal_format, false); |
16594 bool dest_format_color_renderable = | 16592 bool dest_format_color_renderable = |
16595 Texture::ColorRenderable(GetFeatureInfo(), dest_internal_format, false); | 16593 Texture::ColorRenderable(GetFeatureInfo(), dest_internal_format, false); |
16596 std::string output_error_msg; | 16594 std::string output_error_msg; |
16597 | 16595 |
| 16596 switch (dest_internal_format) { |
| 16597 #if defined(OS_MACOSX) |
| 16598 // RGB5_A1 is not color-renderable on NVIDIA Mac, see crbug.com/676209. |
| 16599 case GL_RGB5_A1: |
| 16600 return DRAW_AND_READBACK; |
| 16601 #endif |
| 16602 // RGB9_E5 isn't accepted by glCopyTexImage2D if underlying context is ES. |
| 16603 case GL_RGB9_E5: |
| 16604 if (gl_version_info().is_es) |
| 16605 return DRAW_AND_READBACK; |
| 16606 break; |
| 16607 // SRGB format has color-space conversion issue. WebGL spec doesn't define |
| 16608 // clearly if linear-to-srgb color space conversion is required or not when |
| 16609 // uploading DOM elements to SRGB textures. WebGL conformance test expects |
| 16610 // no linear-to-srgb conversion, while current GPU path for |
| 16611 // CopyTextureCHROMIUM does the conversion. Do a fallback path before the |
| 16612 // issue is resolved. see https://github.com/KhronosGroup/WebGL/issues/2165. |
| 16613 // TODO(qiankun.miao@intel.com): revisit this once the above issue is |
| 16614 // resolved. |
| 16615 case GL_SRGB_EXT: |
| 16616 case GL_SRGB_ALPHA_EXT: |
| 16617 case GL_SRGB8: |
| 16618 case GL_SRGB8_ALPHA8: |
| 16619 if (feature_info_->IsWebGLContext()) |
| 16620 return DRAW_AND_READBACK; |
| 16621 break; |
| 16622 default: |
| 16623 break; |
| 16624 } |
| 16625 |
16598 // CopyTexImage* should not allow internalformat of GL_BGRA_EXT and | 16626 // CopyTexImage* should not allow internalformat of GL_BGRA_EXT and |
16599 // GL_BGRA8_EXT. crbug.com/663086. | 16627 // GL_BGRA8_EXT. crbug.com/663086. |
16600 bool copy_tex_image_format_valid = | 16628 bool copy_tex_image_format_valid = |
16601 source_internal_format != GL_BGRA_EXT && | 16629 source_internal_format != GL_BGRA_EXT && |
16602 dest_internal_format != GL_BGRA_EXT && | 16630 dest_internal_format != GL_BGRA_EXT && |
16603 source_internal_format != GL_BGRA8_EXT && | 16631 source_internal_format != GL_BGRA8_EXT && |
16604 dest_internal_format != GL_BGRA8_EXT && | 16632 dest_internal_format != GL_BGRA8_EXT && |
16605 ValidateCopyTexFormatHelper(dest_internal_format, source_internal_format, | 16633 ValidateCopyTexFormatHelper(dest_internal_format, source_internal_format, |
16606 source_type, &output_error_msg); | 16634 source_type, &output_error_msg); |
16607 | 16635 |
(...skipping 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19534 } | 19562 } |
19535 | 19563 |
19536 // Include the auto-generated part of this file. We split this because it means | 19564 // Include the auto-generated part of this file. We split this because it means |
19537 // we can easily edit the non-auto generated parts right here in this file | 19565 // we can easily edit the non-auto generated parts right here in this file |
19538 // instead of having to edit some template or the code generator. | 19566 // instead of having to edit some template or the code generator. |
19539 #include "base/macros.h" | 19567 #include "base/macros.h" |
19540 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19568 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
19541 | 19569 |
19542 } // namespace gles2 | 19570 } // namespace gles2 |
19543 } // namespace gpu | 19571 } // namespace gpu |
OLD | NEW |