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 16636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16647 depth); | 16647 depth); |
16648 } | 16648 } |
16649 if (workarounds().reset_base_mipmap_level_before_texstorage && | 16649 if (workarounds().reset_base_mipmap_level_before_texstorage && |
16650 texture->base_level() > 0) | 16650 texture->base_level() > 0) |
16651 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); | 16651 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); |
16652 | 16652 |
16653 { | 16653 { |
16654 GLsizei level_width = width; | 16654 GLsizei level_width = width; |
16655 GLsizei level_height = height; | 16655 GLsizei level_height = height; |
16656 GLsizei level_depth = depth; | 16656 GLsizei level_depth = depth; |
16657 GLenum adjusted_format = internal_format; | |
16658 #if defined(OS_MACOSX) | |
16659 // TODO(dshwang): remove it after fixing the root cause. crbug.com/657532 | |
16660 adjusted_format = feature_info_->IsES3Enabled() ? internal_format : format; | |
16661 #endif | |
16662 | 16657 |
16663 for (int ii = 0; ii < levels; ++ii) { | 16658 for (int ii = 0; ii < levels; ++ii) { |
16664 if (target == GL_TEXTURE_CUBE_MAP) { | 16659 if (target == GL_TEXTURE_CUBE_MAP) { |
16665 for (int jj = 0; jj < 6; ++jj) { | 16660 for (int jj = 0; jj < 6; ++jj) { |
16666 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; | 16661 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; |
16667 texture_manager()->SetLevelInfo( | 16662 texture_manager()->SetLevelInfo( |
16668 texture_ref, face, ii, adjusted_format, level_width, level_height, | 16663 texture_ref, face, ii, internal_format, level_width, level_height, |
16669 1, 0, format, type, gfx::Rect()); | 16664 1, 0, format, type, gfx::Rect()); |
16670 } | 16665 } |
16671 } else { | 16666 } else { |
16672 texture_manager()->SetLevelInfo( | 16667 texture_manager()->SetLevelInfo( |
16673 texture_ref, target, ii, adjusted_format, level_width, level_height, | 16668 texture_ref, target, ii, internal_format, level_width, level_height, |
16674 level_depth, 0, format, type, gfx::Rect()); | 16669 level_depth, 0, format, type, gfx::Rect()); |
16675 } | 16670 } |
16676 level_width = std::max(1, level_width >> 1); | 16671 level_width = std::max(1, level_width >> 1); |
16677 level_height = std::max(1, level_height >> 1); | 16672 level_height = std::max(1, level_height >> 1); |
16678 if (target == GL_TEXTURE_3D) | 16673 if (target == GL_TEXTURE_3D) |
16679 level_depth = std::max(1, level_depth >> 1); | 16674 level_depth = std::max(1, level_depth >> 1); |
16680 } | 16675 } |
16681 texture->SetImmutable(true); | 16676 texture->SetImmutable(true); |
16682 } | 16677 } |
16683 } | 16678 } |
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18769 } | 18764 } |
18770 | 18765 |
18771 // Include the auto-generated part of this file. We split this because it means | 18766 // Include the auto-generated part of this file. We split this because it means |
18772 // we can easily edit the non-auto generated parts right here in this file | 18767 // we can easily edit the non-auto generated parts right here in this file |
18773 // instead of having to edit some template or the code generator. | 18768 // instead of having to edit some template or the code generator. |
18774 #include "base/macros.h" | 18769 #include "base/macros.h" |
18775 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18770 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
18776 | 18771 |
18777 } // namespace gles2 | 18772 } // namespace gles2 |
18778 } // namespace gpu | 18773 } // namespace gpu |
OLD | NEW |