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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 {GL_ALPHA, GL_ALPHA, GL_HALF_FLOAT_OES}, | 145 {GL_ALPHA, GL_ALPHA, GL_HALF_FLOAT_OES}, |
146 // Exposed by GL_ANGLE_depth_texture | 146 // Exposed by GL_ANGLE_depth_texture |
147 {GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT}, | 147 {GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT}, |
148 {GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT}, | 148 {GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT}, |
149 {GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, | 149 {GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8}, |
150 // Exposed by GL_EXT_sRGB | 150 // Exposed by GL_EXT_sRGB |
151 {GL_SRGB, GL_SRGB, GL_UNSIGNED_BYTE}, | 151 {GL_SRGB, GL_SRGB, GL_UNSIGNED_BYTE}, |
152 {GL_SRGB_ALPHA, GL_SRGB_ALPHA, GL_UNSIGNED_BYTE}, | 152 {GL_SRGB_ALPHA, GL_SRGB_ALPHA, GL_UNSIGNED_BYTE}, |
153 // Exposed by GL_EXT_texture_format_BGRA8888 | 153 // Exposed by GL_EXT_texture_format_BGRA8888 |
154 {GL_BGRA_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE}, | 154 {GL_BGRA_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE}, |
| 155 {GL_BGRA8_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE}, |
155 // Exposed by GL_EXT_texture_rg | 156 // Exposed by GL_EXT_texture_rg |
156 {GL_RED, GL_RED, GL_UNSIGNED_BYTE}, | 157 {GL_RED, GL_RED, GL_UNSIGNED_BYTE}, |
157 {GL_RG, GL_RG, GL_UNSIGNED_BYTE}, | 158 {GL_RG, GL_RG, GL_UNSIGNED_BYTE}, |
158 {GL_RED, GL_RED, GL_FLOAT}, | 159 {GL_RED, GL_RED, GL_FLOAT}, |
159 {GL_RG, GL_RG, GL_FLOAT}, | 160 {GL_RG, GL_RG, GL_FLOAT}, |
160 {GL_RED, GL_RED, GL_HALF_FLOAT_OES}, | 161 {GL_RED, GL_RED, GL_HALF_FLOAT_OES}, |
161 {GL_RG, GL_RG, GL_HALF_FLOAT_OES}, | 162 {GL_RG, GL_RG, GL_HALF_FLOAT_OES}, |
162 | 163 |
163 // ES3. | 164 // ES3. |
164 {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, | 165 {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 } | 755 } |
755 return feature_info->validators()-> | 756 return feature_info->validators()-> |
756 texture_sized_color_renderable_internal_format.IsValid(internal_format); | 757 texture_sized_color_renderable_internal_format.IsValid(internal_format); |
757 } | 758 } |
758 | 759 |
759 // static | 760 // static |
760 bool Texture::TextureFilterable(const FeatureInfo* feature_info, | 761 bool Texture::TextureFilterable(const FeatureInfo* feature_info, |
761 GLenum internal_format, | 762 GLenum internal_format, |
762 GLenum type) { | 763 GLenum type) { |
763 if (feature_info->validators()->texture_unsized_internal_format.IsValid( | 764 if (feature_info->validators()->texture_unsized_internal_format.IsValid( |
764 internal_format)) { | 765 internal_format) || |
| 766 feature_info->validators() |
| 767 ->texture_sized_color_renderable_internal_format.IsValid( |
| 768 internal_format)) { |
765 switch (type) { | 769 switch (type) { |
766 case GL_FLOAT: | 770 case GL_FLOAT: |
767 return feature_info->feature_flags().enable_texture_float_linear; | 771 return feature_info->feature_flags().enable_texture_float_linear; |
768 case GL_HALF_FLOAT_OES: | 772 case GL_HALF_FLOAT_OES: |
769 return feature_info->feature_flags().enable_texture_half_float_linear; | 773 return feature_info->feature_flags().enable_texture_half_float_linear; |
770 default: | 774 default: |
771 // GL_HALF_FLOAT is ES3 only and should only be used with sized formats. | 775 // GL_HALF_FLOAT is ES3 only and should only be used with sized formats. |
772 return true; | 776 return true; |
773 } | 777 } |
774 } | 778 } |
(...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3364 uint32_t TextureManager::GetServiceIdGeneration() const { | 3368 uint32_t TextureManager::GetServiceIdGeneration() const { |
3365 return current_service_id_generation_; | 3369 return current_service_id_generation_; |
3366 } | 3370 } |
3367 | 3371 |
3368 void TextureManager::IncrementServiceIdGeneration() { | 3372 void TextureManager::IncrementServiceIdGeneration() { |
3369 current_service_id_generation_++; | 3373 current_service_id_generation_++; |
3370 } | 3374 } |
3371 | 3375 |
3372 } // namespace gles2 | 3376 } // namespace gles2 |
3373 } // namespace gpu | 3377 } // namespace gpu |
OLD | NEW |