Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2776083002: enable fallback path (Closed)
Patch Set: use stream read Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 16484 matching lines...) Expand 10 before | Expand all | Expand 10 after
16495 case GL_SRGB8: 16495 case GL_SRGB8:
16496 case GL_RGB565: 16496 case GL_RGB565:
16497 case GL_RGB8UI: 16497 case GL_RGB8UI:
16498 case GL_SRGB8_ALPHA8: 16498 case GL_SRGB8_ALPHA8:
16499 case GL_RGB5_A1: 16499 case GL_RGB5_A1:
16500 case GL_RGBA4: 16500 case GL_RGBA4:
16501 case GL_RGBA8UI: 16501 case GL_RGBA8UI:
16502 valid_dest_format = feature_info_->IsWebGL2OrES3Context(); 16502 valid_dest_format = feature_info_->IsWebGL2OrES3Context();
16503 break; 16503 break;
16504 case GL_RGB9_E5: 16504 case GL_RGB9_E5:
16505 valid_dest_format = !gl_version_info().is_es;
16506 break;
16507 case GL_R16F: 16505 case GL_R16F:
16508 case GL_R32F: 16506 case GL_R32F:
16509 case GL_RG16F: 16507 case GL_RG16F:
16510 case GL_RG32F: 16508 case GL_RG32F:
16511 case GL_RGB16F: 16509 case GL_RGB16F:
16512 case GL_RGBA16F: 16510 case GL_RGBA16F:
16513 case GL_R11F_G11F_B10F: 16511 case GL_R11F_G11F_B10F:
16514 valid_dest_format = feature_info_->ext_color_buffer_float_available(); 16512 valid_dest_format = feature_info_->ext_color_buffer_float_available();
16515 break; 16513 break;
16516 case GL_RGB32F: 16514 case GL_RGB32F:
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
16567 bool flip_y, 16565 bool flip_y,
16568 bool premultiply_alpha, 16566 bool premultiply_alpha,
16569 bool unpremultiply_alpha) { 16567 bool unpremultiply_alpha) {
16570 bool premultiply_alpha_change = premultiply_alpha ^ unpremultiply_alpha; 16568 bool premultiply_alpha_change = premultiply_alpha ^ unpremultiply_alpha;
16571 bool source_format_color_renderable = 16569 bool source_format_color_renderable =
16572 Texture::ColorRenderable(GetFeatureInfo(), source_internal_format, false); 16570 Texture::ColorRenderable(GetFeatureInfo(), source_internal_format, false);
16573 bool dest_format_color_renderable = 16571 bool dest_format_color_renderable =
16574 Texture::ColorRenderable(GetFeatureInfo(), dest_internal_format, false); 16572 Texture::ColorRenderable(GetFeatureInfo(), dest_internal_format, false);
16575 std::string output_error_msg; 16573 std::string output_error_msg;
16576 16574
16575 switch (dest_internal_format) {
16576 #if defined(OS_MACOSX)
16577 // RGB5_A1 is not color-renderable on NVIDIA Mac, see crbug.com/676209.
16578 case GL_RGB5_A1:
16579 return DRAW_AND_READBACK;
16580 #endif
16581 // RGB9_E5 isn't accepted by glCopyTexImage2D if underlying context is ES.
16582 case GL_RGB9_E5:
16583 if (gl_version_info().is_es)
16584 return DRAW_AND_READBACK;
16585 break;
16586 // SRGB format has color-space conversion issue. WebGL spec doesn't define
16587 // clearly if linear-to-srgb color space conversion is required or not when
16588 // uploading DOM elements to SRGB textures. WebGL conformance test expects
16589 // no linear-to-srgb conversion, while current GPU path for
16590 // CopyTextureCHROMIUM does the conversion. Do a fallback path before the
16591 // issue is resolved. see https://github.com/KhronosGroup/WebGL/issues/2165.
16592 // TODO(qiankun.miao@intel.com): revisit this once the above issue is
16593 // resolved.
16594 case GL_SRGB_EXT:
16595 case GL_SRGB_ALPHA_EXT:
16596 case GL_SRGB8:
16597 case GL_SRGB8_ALPHA8:
16598 if (feature_info_->IsWebGLContext())
16599 return DRAW_AND_READBACK;
16600 break;
16601 default:
16602 break;
16603 }
16604
16577 // CopyTexImage* should not allow internalformat of GL_BGRA_EXT and 16605 // CopyTexImage* should not allow internalformat of GL_BGRA_EXT and
16578 // GL_BGRA8_EXT. crbug.com/663086. 16606 // GL_BGRA8_EXT. crbug.com/663086.
16579 bool copy_tex_image_format_valid = 16607 bool copy_tex_image_format_valid =
16580 source_internal_format != GL_BGRA_EXT && 16608 source_internal_format != GL_BGRA_EXT &&
16581 dest_internal_format != GL_BGRA_EXT && 16609 dest_internal_format != GL_BGRA_EXT &&
16582 source_internal_format != GL_BGRA8_EXT && 16610 source_internal_format != GL_BGRA8_EXT &&
16583 dest_internal_format != GL_BGRA8_EXT && 16611 dest_internal_format != GL_BGRA8_EXT &&
16584 ValidateCopyTexFormatHelper(dest_internal_format, source_internal_format, 16612 ValidateCopyTexFormatHelper(dest_internal_format, source_internal_format,
16585 source_type, &output_error_msg); 16613 source_type, &output_error_msg);
16586 16614
(...skipping 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after
19513 } 19541 }
19514 19542
19515 // Include the auto-generated part of this file. We split this because it means 19543 // Include the auto-generated part of this file. We split this because it means
19516 // we can easily edit the non-auto generated parts right here in this file 19544 // we can easily edit the non-auto generated parts right here in this file
19517 // instead of having to edit some template or the code generator. 19545 // instead of having to edit some template or the code generator.
19518 #include "base/macros.h" 19546 #include "base/macros.h"
19519 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 19547 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
19520 19548
19521 } // namespace gles2 19549 } // namespace gles2
19522 } // namespace gpu 19550 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698