Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: gpu/command_buffer/service/texture_manager.cc

Issue 2354713004: Implement WEBGL_compressed_texture_es3_0 extension for WebGL 1/2 (Closed)
Patch Set: fixup Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3128 matching lines...) Expand 10 before | Expand all | Expand 10 after
3139 pmd->AddOwnershipEdge(client_guid, service_guid, importance); 3139 pmd->AddOwnershipEdge(client_guid, service_guid, importance);
3140 3140
3141 // Dump all sub-levels held by the texture. They will appear below the main 3141 // Dump all sub-levels held by the texture. They will appear below the main
3142 // gl/textures/client_X/texture_Y dump. 3142 // gl/textures/client_X/texture_Y dump.
3143 ref->texture()->DumpLevelMemory(pmd, memory_tracker_->ClientTracingId(), 3143 ref->texture()->DumpLevelMemory(pmd, memory_tracker_->ClientTracingId(),
3144 dump_name); 3144 dump_name);
3145 } 3145 }
3146 3146
3147 GLenum TextureManager::ExtractFormatFromStorageFormat(GLenum internalformat) { 3147 GLenum TextureManager::ExtractFormatFromStorageFormat(GLenum internalformat) {
3148 switch (internalformat) { 3148 switch (internalformat) {
3149 case GL_COMPRESSED_R11_EAC:
3150 case GL_COMPRESSED_SIGNED_R11_EAC:
3149 case GL_RED: 3151 case GL_RED:
3150 case GL_R8: 3152 case GL_R8:
3151 case GL_R8_SNORM: 3153 case GL_R8_SNORM:
3152 case GL_R16F: 3154 case GL_R16F:
3153 case GL_R32F: 3155 case GL_R32F:
3154 return GL_RED; 3156 return GL_RED;
3155 case GL_R8UI: 3157 case GL_R8UI:
3156 case GL_R8I: 3158 case GL_R8I:
3157 case GL_R16UI: 3159 case GL_R16UI:
3158 case GL_R16I: 3160 case GL_R16I:
3159 case GL_R32UI: 3161 case GL_R32UI:
3160 case GL_R32I: 3162 case GL_R32I:
3161 return GL_RED_INTEGER; 3163 return GL_RED_INTEGER;
3164 case GL_COMPRESSED_RG11_EAC:
3165 case GL_COMPRESSED_SIGNED_RG11_EAC:
3162 case GL_RG: 3166 case GL_RG:
3163 case GL_RG8: 3167 case GL_RG8:
3164 case GL_RG8_SNORM: 3168 case GL_RG8_SNORM:
3165 case GL_RG16F: 3169 case GL_RG16F:
3166 case GL_RG32F: 3170 case GL_RG32F:
3167 return GL_RG; 3171 return GL_RG;
3168 case GL_RG8UI: 3172 case GL_RG8UI:
3169 case GL_RG8I: 3173 case GL_RG8I:
3170 case GL_RG16UI: 3174 case GL_RG16UI:
3171 case GL_RG16I: 3175 case GL_RG16I:
3172 case GL_RG32UI: 3176 case GL_RG32UI:
3173 case GL_RG32I: 3177 case GL_RG32I:
3174 return GL_RG_INTEGER; 3178 return GL_RG_INTEGER;
3175 case GL_ATC_RGB_AMD: 3179 case GL_ATC_RGB_AMD:
3176 case GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 3180 case GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG:
3177 case GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 3181 case GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG:
3178 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: 3182 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
3183 case GL_COMPRESSED_RGB8_ETC2:
3179 case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: 3184 case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
3185 case GL_COMPRESSED_SRGB8_ETC2:
3180 case GL_ETC1_RGB8_OES: 3186 case GL_ETC1_RGB8_OES:
3181 case GL_RGB: 3187 case GL_RGB:
3182 case GL_RGB8: 3188 case GL_RGB8:
3183 case GL_SRGB8: 3189 case GL_SRGB8:
3184 case GL_R11F_G11F_B10F: 3190 case GL_R11F_G11F_B10F:
3185 case GL_RGB565: 3191 case GL_RGB565:
3186 case GL_RGB8_SNORM: 3192 case GL_RGB8_SNORM:
3187 case GL_RGB9_E5: 3193 case GL_RGB9_E5:
3188 case GL_RGB16F: 3194 case GL_RGB16F:
3189 case GL_RGB32F: 3195 case GL_RGB32F:
3190 return GL_RGB; 3196 return GL_RGB;
3191 case GL_RGB8UI: 3197 case GL_RGB8UI:
3192 case GL_RGB8I: 3198 case GL_RGB8I:
3193 case GL_RGB16UI: 3199 case GL_RGB16UI:
3194 case GL_RGB16I: 3200 case GL_RGB16I:
3195 case GL_RGB32UI: 3201 case GL_RGB32UI:
3196 case GL_RGB32I: 3202 case GL_RGB32I:
3197 return GL_RGB_INTEGER; 3203 return GL_RGB_INTEGER;
3198 case GL_SRGB: 3204 case GL_SRGB:
3199 return GL_SRGB; 3205 return GL_SRGB;
3200 case GL_ATC_RGBA_EXPLICIT_ALPHA_AMD: 3206 case GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:
3201 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: 3207 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
3208 case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
3209 case GL_COMPRESSED_RGBA8_ETC2_EAC:
3202 case GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 3210 case GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:
3203 case GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 3211 case GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:
3204 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: 3212 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
3205 case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: 3213 case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
3206 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: 3214 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
3207 case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: 3215 case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
3208 case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: 3216 case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
3209 case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: 3217 case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
3218 case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
3219 case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
3210 case GL_RGBA: 3220 case GL_RGBA:
3211 case GL_RGBA8: 3221 case GL_RGBA8:
3212 case GL_SRGB8_ALPHA8: 3222 case GL_SRGB8_ALPHA8:
3213 case GL_RGBA8_SNORM: 3223 case GL_RGBA8_SNORM:
3214 case GL_RGBA4: 3224 case GL_RGBA4:
3215 case GL_RGB5_A1: 3225 case GL_RGB5_A1:
3216 case GL_RGB10_A2: 3226 case GL_RGB10_A2:
3217 case GL_RGBA16F: 3227 case GL_RGBA16F:
3218 case GL_RGBA32F: 3228 case GL_RGBA32F:
3219 return GL_RGBA; 3229 return GL_RGBA;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
3418 uint32_t TextureManager::GetServiceIdGeneration() const { 3428 uint32_t TextureManager::GetServiceIdGeneration() const {
3419 return current_service_id_generation_; 3429 return current_service_id_generation_;
3420 } 3430 }
3421 3431
3422 void TextureManager::IncrementServiceIdGeneration() { 3432 void TextureManager::IncrementServiceIdGeneration() {
3423 current_service_id_generation_++; 3433 current_service_id_generation_++;
3424 } 3434 }
3425 3435
3426 } // namespace gles2 3436 } // namespace gles2
3427 } // namespace gpu 3437 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698