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 16539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16550 depth); | 16550 depth); |
16551 } | 16551 } |
16552 if (workarounds().reset_base_mipmap_level_before_texstorage && | 16552 if (workarounds().reset_base_mipmap_level_before_texstorage && |
16553 texture->base_level() > 0) | 16553 texture->base_level() > 0) |
16554 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); | 16554 glTexParameteri(target, GL_TEXTURE_BASE_LEVEL, texture->base_level()); |
16555 | 16555 |
16556 { | 16556 { |
16557 GLsizei level_width = width; | 16557 GLsizei level_width = width; |
16558 GLsizei level_height = height; | 16558 GLsizei level_height = height; |
16559 GLsizei level_depth = depth; | 16559 GLsizei level_depth = depth; |
16560 GLenum adjusted_format = | 16560 GLenum adjusted_format = internal_format; |
16561 feature_info_->IsES3Enabled() ? internal_format : format; | 16561 #if defined(OS_MACOSX) |
| 16562 // TODO(dshwang): remove it after fixing the root cause. crbug.com/657532 |
| 16563 adjusted_format = feature_info_->IsES3Enabled() ? internal_format : format; |
| 16564 #endif |
| 16565 |
16562 for (int ii = 0; ii < levels; ++ii) { | 16566 for (int ii = 0; ii < levels; ++ii) { |
16563 if (target == GL_TEXTURE_CUBE_MAP) { | 16567 if (target == GL_TEXTURE_CUBE_MAP) { |
16564 for (int jj = 0; jj < 6; ++jj) { | 16568 for (int jj = 0; jj < 6; ++jj) { |
16565 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; | 16569 GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X + jj; |
16566 texture_manager()->SetLevelInfo(texture_ref, face, ii, | 16570 texture_manager()->SetLevelInfo( |
16567 adjusted_format, | 16571 texture_ref, face, ii, adjusted_format, level_width, level_height, |
16568 level_width, level_height, 1, | 16572 1, 0, format, type, gfx::Rect()); |
16569 0, format, type, gfx::Rect()); | |
16570 } | 16573 } |
16571 } else { | 16574 } else { |
16572 texture_manager()->SetLevelInfo(texture_ref, target, ii, | 16575 texture_manager()->SetLevelInfo( |
16573 adjusted_format, | 16576 texture_ref, target, ii, adjusted_format, level_width, level_height, |
16574 level_width, level_height, level_depth, | 16577 level_depth, 0, format, type, gfx::Rect()); |
16575 0, format, type, gfx::Rect()); | |
16576 } | 16578 } |
16577 level_width = std::max(1, level_width >> 1); | 16579 level_width = std::max(1, level_width >> 1); |
16578 level_height = std::max(1, level_height >> 1); | 16580 level_height = std::max(1, level_height >> 1); |
16579 if (target == GL_TEXTURE_3D) | 16581 if (target == GL_TEXTURE_3D) |
16580 level_depth = std::max(1, level_depth >> 1); | 16582 level_depth = std::max(1, level_depth >> 1); |
16581 } | 16583 } |
16582 texture->SetImmutable(true); | 16584 texture->SetImmutable(true); |
16583 } | 16585 } |
16584 } | 16586 } |
16585 | 16587 |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18669 } | 18671 } |
18670 | 18672 |
18671 // Include the auto-generated part of this file. We split this because it means | 18673 // Include the auto-generated part of this file. We split this because it means |
18672 // we can easily edit the non-auto generated parts right here in this file | 18674 // we can easily edit the non-auto generated parts right here in this file |
18673 // instead of having to edit some template or the code generator. | 18675 // instead of having to edit some template or the code generator. |
18674 #include "base/macros.h" | 18676 #include "base/macros.h" |
18675 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 18677 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
18676 | 18678 |
18677 } // namespace gles2 | 18679 } // namespace gles2 |
18678 } // namespace gpu | 18680 } // namespace gpu |
OLD | NEW |