Chromium Code Reviews| 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 13296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13307 GetBoundReadFramebufferServiceId(), | 13307 GetBoundReadFramebufferServiceId(), |
| 13308 GetBoundReadFramebufferInternalFormat()); | 13308 GetBoundReadFramebufferInternalFormat()); |
| 13309 } else { | 13309 } else { |
| 13310 glCopyTexSubImage2D(target, level, destX, destY, copyX, copyY, | 13310 glCopyTexSubImage2D(target, level, destX, destY, copyX, copyY, |
| 13311 copyWidth, copyHeight); | 13311 copyWidth, copyHeight); |
| 13312 } | 13312 } |
| 13313 } | 13313 } |
| 13314 } else { | 13314 } else { |
| 13315 GLenum final_internal_format = TextureManager::AdjustTexInternalFormat( | 13315 GLenum final_internal_format = TextureManager::AdjustTexInternalFormat( |
| 13316 feature_info_.get(), internal_format); | 13316 feature_info_.get(), internal_format); |
| 13317 if (workarounds().init_cube_map_before_copyteximage && | |
| 13318 texture->target() == GL_TEXTURE_CUBE_MAP && | |
| 13319 target != GL_TEXTURE_CUBE_MAP_POSITIVE_X) { | |
| 13320 for (int i = 0; i < 2; ++i) { | |
| 13321 TextureManager::DoTexImageArguments args = { | |
| 13322 target, i, final_internal_format, 1, 1, 1, border, | |
| 13323 format, type, nullptr, 1, 0, | |
| 13324 TextureManager::DoTexImageArguments::kTexImage2D }; | |
| 13325 texture_manager()->WorkaroundCopyTexImageCubeMap(&texture_state_, | |
| 13326 &state_, &framebuffer_state_, texture_ref, func_name, args); | |
| 13327 } | |
|
Zhenyao Mo
2016/09/28 21:14:23
This gets complicated when we also need to emulate
qiankun
2016/09/29 00:51:27
What kinds of TODO, something like to handle this
Zhenyao Mo
2016/09/29 20:30:16
What I mean is, if the src texture format is LUMIN
qiankun
2016/09/30 05:47:39
Sorry, I didn't get this. Can you explain it furth
qiankun
2016/10/11 01:56:20
Zhenyao&Ken, do I still need to add this TODO acco
| |
| 13328 } | |
| 13317 | 13329 |
| 13318 // The service id and target of the texture attached to READ_FRAMEBUFFER. | 13330 // The service id and target of the texture attached to READ_FRAMEBUFFER. |
| 13319 GLuint source_texture_service_id = 0; | 13331 GLuint source_texture_service_id = 0; |
| 13320 GLenum source_texture_target = 0; | 13332 GLenum source_texture_target = 0; |
| 13321 uint32_t channels_exist = GLES2Util::GetChannelsForFormat(read_format); | 13333 uint32_t channels_exist = GLES2Util::GetChannelsForFormat(read_format); |
| 13322 bool use_workaround = NeedsCopyTextureImageWorkaround( | 13334 bool use_workaround = NeedsCopyTextureImageWorkaround( |
| 13323 final_internal_format, channels_exist, &source_texture_service_id, | 13335 final_internal_format, channels_exist, &source_texture_service_id, |
| 13324 &source_texture_target); | 13336 &source_texture_target); |
| 13325 if (requires_luma_blit) { | 13337 if (requires_luma_blit) { |
| 13326 copy_tex_image_blit_->DoCopyTexImage2DToLUMACompatibilityTexture( | 13338 copy_tex_image_blit_->DoCopyTexImage2DToLUMACompatibilityTexture( |
| 13327 this, texture->service_id(), texture->target(), target, format, | 13339 this, texture->service_id(), texture->target(), target, format, |
| 13328 type, level, internal_format, copyX, copyY, copyWidth, copyHeight, | 13340 type, level, internal_format, copyX, copyY, copyWidth, copyHeight, |
| 13329 GetBoundReadFramebufferServiceId(), | 13341 GetBoundReadFramebufferServiceId(), |
| 13330 GetBoundReadFramebufferInternalFormat()); | 13342 GetBoundReadFramebufferInternalFormat()); |
|
qiankun
2016/09/29 00:51:27
FYI: This path requires the init_cube_map_before_c
| |
| 13331 } else if (use_workaround) { | 13343 } else if (use_workaround) { |
| 13332 GLenum dest_texture_target = target; | 13344 GLenum dest_texture_target = target; |
| 13333 GLenum framebuffer_target = features().chromium_framebuffer_multisample | 13345 GLenum framebuffer_target = features().chromium_framebuffer_multisample |
| 13334 ? GL_READ_FRAMEBUFFER_EXT | 13346 ? GL_READ_FRAMEBUFFER_EXT |
| 13335 : GL_FRAMEBUFFER; | 13347 : GL_FRAMEBUFFER; |
| 13336 | 13348 |
| 13337 GLenum temp_internal_format = 0; | 13349 GLenum temp_internal_format = 0; |
| 13338 if (channels_exist == GLES2Util::kRGBA) { | 13350 if (channels_exist == GLES2Util::kRGBA) { |
| 13339 temp_internal_format = GL_RGBA; | 13351 temp_internal_format = GL_RGBA; |
| 13340 } else if (channels_exist == GLES2Util::kRGB) { | 13352 } else if (channels_exist == GLES2Util::kRGB) { |
| (...skipping 4742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 18083 } | 18095 } |
| 18084 | 18096 |
| 18085 // Include the auto-generated part of this file. We split this because it means | 18097 // Include the auto-generated part of this file. We split this because it means |
| 18086 // we can easily edit the non-auto generated parts right here in this file | 18098 // we can easily edit the non-auto generated parts right here in this file |
| 18087 // instead of having to edit some template or the code generator. | 18099 // instead of having to edit some template or the code generator. |
| 18088 #include "base/macros.h" | 18100 #include "base/macros.h" |
| 18089 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18101 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 18090 | 18102 |
| 18091 } // namespace gles2 | 18103 } // namespace gles2 |
| 18092 } // namespace gpu | 18104 } // namespace gpu |
| OLD | NEW |