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 13272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13283 glCopyTexImage2D(dest_texture_target, level, final_internal_format, 0, 0, | 13283 glCopyTexImage2D(dest_texture_target, level, final_internal_format, 0, 0, |
13284 copyWidth, copyHeight, 0); | 13284 copyWidth, copyHeight, 0); |
13285 | 13285 |
13286 // Rebind source texture. | 13286 // Rebind source texture. |
13287 glFramebufferTexture2DEXT(framebuffer_target, GL_COLOR_ATTACHMENT0, | 13287 glFramebufferTexture2DEXT(framebuffer_target, GL_COLOR_ATTACHMENT0, |
13288 source_texture_target, | 13288 source_texture_target, |
13289 source_texture_service_id, 0); | 13289 source_texture_service_id, 0); |
13290 | 13290 |
13291 glDeleteTextures(1, &temp_texture); | 13291 glDeleteTextures(1, &temp_texture); |
13292 } else { | 13292 } else { |
| 13293 if (workarounds().do_teximage_before_copyteximage_to_cube_map && |
| 13294 texture->target() == GL_TEXTURE_CUBE_MAP) { |
| 13295 TextureManager::DoTexImageArguments args = { |
| 13296 target, level, final_internal_format, width, height, 1, border, |
| 13297 format, type, nullptr, pixels_size, 0, |
| 13298 TextureManager::DoTexImageArguments::kTexImage2D }; |
| 13299 texture_manager()->WorkaroundCopyTexImageCubeMap(&texture_state_, |
| 13300 &state_, &framebuffer_state_, texture_ref, func_name, args); |
| 13301 } |
13293 glCopyTexImage2D(target, level, final_internal_format, copyX, copyY, | 13302 glCopyTexImage2D(target, level, final_internal_format, copyX, copyY, |
13294 copyWidth, copyHeight, border); | 13303 copyWidth, copyHeight, border); |
13295 } | 13304 } |
13296 } | 13305 } |
13297 GLenum error = LOCAL_PEEK_GL_ERROR(func_name); | 13306 GLenum error = LOCAL_PEEK_GL_ERROR(func_name); |
13298 if (error == GL_NO_ERROR) { | 13307 if (error == GL_NO_ERROR) { |
13299 texture_manager()->SetLevelInfo(texture_ref, target, level, internal_format, | 13308 texture_manager()->SetLevelInfo(texture_ref, target, level, internal_format, |
13300 width, height, 1, border, format, | 13309 width, height, 1, border, format, |
13301 type, gfx::Rect(width, height)); | 13310 type, gfx::Rect(width, height)); |
13302 texture->ApplyFormatWorkarounds(feature_info_.get()); | 13311 texture->ApplyFormatWorkarounds(feature_info_.get()); |
(...skipping 4691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17994 } | 18003 } |
17995 | 18004 |
17996 // Include the auto-generated part of this file. We split this because it means | 18005 // Include the auto-generated part of this file. We split this because it means |
17997 // we can easily edit the non-auto generated parts right here in this file | 18006 // we can easily edit the non-auto generated parts right here in this file |
17998 // instead of having to edit some template or the code generator. | 18007 // instead of having to edit some template or the code generator. |
17999 #include "base/macros.h" | 18008 #include "base/macros.h" |
18000 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18009 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
18001 | 18010 |
18002 } // namespace gles2 | 18011 } // namespace gles2 |
18003 } // namespace gpu | 18012 } // namespace gpu |
OLD | NEW |