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 2864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2875 | 2875 |
2876 // static | 2876 // static |
2877 GLenum TextureManager::AdjustTexInternalFormat( | 2877 GLenum TextureManager::AdjustTexInternalFormat( |
2878 const gles2::FeatureInfo* feature_info, | 2878 const gles2::FeatureInfo* feature_info, |
2879 GLenum format) { | 2879 GLenum format) { |
2880 if (feature_info->gl_version_info().is_desktop_core_profile) { | 2880 if (feature_info->gl_version_info().is_desktop_core_profile) { |
2881 const Texture::CompatibilitySwizzle* swizzle = | 2881 const Texture::CompatibilitySwizzle* swizzle = |
2882 GetCompatibilitySwizzle(format); | 2882 GetCompatibilitySwizzle(format); |
2883 if (swizzle) | 2883 if (swizzle) |
2884 return swizzle->dest_format; | 2884 return swizzle->dest_format; |
2885 | |
2886 // Compatibility format substitutions that do not require swizzling | |
2887 if (format == GL_BGRA_EXT) | |
2888 return GL_RGBA; | |
2889 if (format == GL_BGRA8_EXT) | |
2890 return GL_RGBA8; | |
piman
2016/07/19 20:32:30
This transformation should already happen at a low
Justin Novosad
2016/07/19 21:45:25
Thanks for pointing this out. I did a bit of inves
piman
2016/07/19 21:56:08
Ah, Ozone indeed does use the ES backend of Mesa.
| |
2885 } | 2891 } |
2892 | |
2886 return format; | 2893 return format; |
2887 } | 2894 } |
2888 | 2895 |
2889 // static | 2896 // static |
2890 GLenum TextureManager::AdjustTexFormat(const gles2::FeatureInfo* feature_info, | 2897 GLenum TextureManager::AdjustTexFormat(const gles2::FeatureInfo* feature_info, |
2891 GLenum format) { | 2898 GLenum format) { |
2892 // TODO(bajones): GLES 3 allows for internal format and format to differ. | 2899 // TODO(bajones): GLES 3 allows for internal format and format to differ. |
2893 // This logic may need to change as a result. | 2900 // This logic may need to change as a result. |
2894 if (!feature_info->gl_version_info().is_es) { | 2901 if (!feature_info->gl_version_info().is_es) { |
2895 if (format == GL_SRGB_EXT) | 2902 if (format == GL_SRGB_EXT) |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3364 uint32_t TextureManager::GetServiceIdGeneration() const { | 3371 uint32_t TextureManager::GetServiceIdGeneration() const { |
3365 return current_service_id_generation_; | 3372 return current_service_id_generation_; |
3366 } | 3373 } |
3367 | 3374 |
3368 void TextureManager::IncrementServiceIdGeneration() { | 3375 void TextureManager::IncrementServiceIdGeneration() { |
3369 current_service_id_generation_++; | 3376 current_service_id_generation_++; |
3370 } | 3377 } |
3371 | 3378 |
3372 } // namespace gles2 | 3379 } // namespace gles2 |
3373 } // namespace gpu | 3380 } // namespace gpu |
OLD | NEW |