| 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/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 3332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3343 ERRORSTATE_COPY_REAL_GL_ERRORS_TO_WRAPPER(error_state, function_name); | 3343 ERRORSTATE_COPY_REAL_GL_ERRORS_TO_WRAPPER(error_state, function_name); |
| 3344 { | 3344 { |
| 3345 if (args.command_type == DoTexImageArguments::kTexImage3D) { | 3345 if (args.command_type == DoTexImageArguments::kTexImage3D) { |
| 3346 glTexImage3D( | 3346 glTexImage3D( |
| 3347 args.target, args.level, | 3347 args.target, args.level, |
| 3348 AdjustTexInternalFormat(feature_info_.get(), args.internal_format), | 3348 AdjustTexInternalFormat(feature_info_.get(), args.internal_format), |
| 3349 args.width, args.height, args.depth, args.border, | 3349 args.width, args.height, args.depth, args.border, |
| 3350 AdjustTexFormat(feature_info_.get(), args.format), args.type, | 3350 AdjustTexFormat(feature_info_.get(), args.format), args.type, |
| 3351 args.pixels); | 3351 args.pixels); |
| 3352 } else { | 3352 } else { |
| 3353 Texture* texture = texture_ref->texture(); |
| 3354 GLint base_level = texture->base_level(); |
| 3355 if (feature_info_->workarounds().reset_teximage2d_base_level && |
| 3356 args.target == GL_TEXTURE_2D && base_level != 0) { |
| 3357 glTexParameteri(args.target, GL_TEXTURE_BASE_LEVEL, 0); |
| 3358 } |
| 3353 glTexImage2D( | 3359 glTexImage2D( |
| 3354 args.target, args.level, | 3360 args.target, args.level, |
| 3355 AdjustTexInternalFormat(feature_info_.get(), args.internal_format), | 3361 AdjustTexInternalFormat(feature_info_.get(), args.internal_format), |
| 3356 args.width, args.height, args.border, | 3362 args.width, args.height, args.border, |
| 3357 AdjustTexFormat(feature_info_.get(), args.format), args.type, | 3363 AdjustTexFormat(feature_info_.get(), args.format), args.type, |
| 3358 args.pixels); | 3364 args.pixels); |
| 3365 if (feature_info_->workarounds().reset_teximage2d_base_level && |
| 3366 args.target == GL_TEXTURE_2D && base_level != 0) { |
| 3367 glTexParameteri(args.target, GL_TEXTURE_BASE_LEVEL, base_level); |
| 3368 } |
| 3359 } | 3369 } |
| 3360 } | 3370 } |
| 3361 GLenum error = ERRORSTATE_PEEK_GL_ERROR(error_state, function_name); | 3371 GLenum error = ERRORSTATE_PEEK_GL_ERROR(error_state, function_name); |
| 3362 if (args.command_type == DoTexImageArguments::kTexImage3D) { | 3372 if (args.command_type == DoTexImageArguments::kTexImage3D) { |
| 3363 UMA_HISTOGRAM_CUSTOM_ENUMERATION("GPU.Error_TexImage3D", error, | 3373 UMA_HISTOGRAM_CUSTOM_ENUMERATION("GPU.Error_TexImage3D", error, |
| 3364 GetAllGLErrors()); | 3374 GetAllGLErrors()); |
| 3365 } else { | 3375 } else { |
| 3366 UMA_HISTOGRAM_CUSTOM_ENUMERATION("GPU.Error_TexImage2D", error, | 3376 UMA_HISTOGRAM_CUSTOM_ENUMERATION("GPU.Error_TexImage2D", error, |
| 3367 GetAllGLErrors()); | 3377 GetAllGLErrors()); |
| 3368 } | 3378 } |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3761 uint32_t TextureManager::GetServiceIdGeneration() const { | 3771 uint32_t TextureManager::GetServiceIdGeneration() const { |
| 3762 return current_service_id_generation_; | 3772 return current_service_id_generation_; |
| 3763 } | 3773 } |
| 3764 | 3774 |
| 3765 void TextureManager::IncrementServiceIdGeneration() { | 3775 void TextureManager::IncrementServiceIdGeneration() { |
| 3766 current_service_id_generation_++; | 3776 current_service_id_generation_++; |
| 3767 } | 3777 } |
| 3768 | 3778 |
| 3769 } // namespace gles2 | 3779 } // namespace gles2 |
| 3770 } // namespace gpu | 3780 } // namespace gpu |
| OLD | NEW |