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

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

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests: cc, skcanvas_video_renderer, wrtcrecorder... Fake capture supports Y16. Created 4 years, 2 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 {GL_RED, GL_RED, GL_FLOAT}, 159 {GL_RED, GL_RED, GL_FLOAT},
160 {GL_RG, GL_RG, GL_FLOAT}, 160 {GL_RG, GL_RG, GL_FLOAT},
161 {GL_RED, GL_RED, GL_HALF_FLOAT_OES}, 161 {GL_RED, GL_RED, GL_HALF_FLOAT_OES},
162 {GL_RG, GL_RG, GL_HALF_FLOAT_OES}, 162 {GL_RG, GL_RG, GL_HALF_FLOAT_OES},
163 163
164 // ES3. 164 // ES3.
165 {GL_R8, GL_RED, GL_UNSIGNED_BYTE}, 165 {GL_R8, GL_RED, GL_UNSIGNED_BYTE},
166 {GL_R8_SNORM, GL_RED, GL_BYTE}, 166 {GL_R8_SNORM, GL_RED, GL_BYTE},
167 {GL_R16F, GL_RED, GL_HALF_FLOAT}, 167 {GL_R16F, GL_RED, GL_HALF_FLOAT},
168 {GL_R16F, GL_RED, GL_FLOAT}, 168 {GL_R16F, GL_RED, GL_FLOAT},
169 {GL_R16F, GL_R16F, GL_HALF_FLOAT},
Ken Russell (switch to Gerrit) 2016/09/30 23:01:30 These entries are flat-out wrong. Please remove th
169 {GL_R32F, GL_RED, GL_FLOAT}, 170 {GL_R32F, GL_RED, GL_FLOAT},
171 {GL_R32F, GL_R32F, GL_FLOAT},
170 {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE}, 172 {GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE},
171 {GL_R8I, GL_RED_INTEGER, GL_BYTE}, 173 {GL_R8I, GL_RED_INTEGER, GL_BYTE},
172 {GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT}, 174 {GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT},
175 {GL_R16UI, GL_R16UI, GL_UNSIGNED_SHORT},
173 {GL_R16I, GL_RED_INTEGER, GL_SHORT}, 176 {GL_R16I, GL_RED_INTEGER, GL_SHORT},
174 {GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT}, 177 {GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT},
175 {GL_R32I, GL_RED_INTEGER, GL_INT}, 178 {GL_R32I, GL_RED_INTEGER, GL_INT},
176 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE}, 179 {GL_RG8, GL_RG, GL_UNSIGNED_BYTE},
177 {GL_RG8_SNORM, GL_RG, GL_BYTE}, 180 {GL_RG8_SNORM, GL_RG, GL_BYTE},
178 {GL_RG16F, GL_RG, GL_HALF_FLOAT}, 181 {GL_RG16F, GL_RG, GL_HALF_FLOAT},
179 {GL_RG16F, GL_RG, GL_FLOAT}, 182 {GL_RG16F, GL_RG, GL_FLOAT},
180 {GL_RG32F, GL_RG, GL_FLOAT}, 183 {GL_RG32F, GL_RG, GL_FLOAT},
181 {GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE}, 184 {GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE},
182 {GL_RG8I, GL_RG_INTEGER, GL_BYTE}, 185 {GL_RG8I, GL_RG_INTEGER, GL_BYTE},
(...skipping 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after
2898 return GL_RGB; 2901 return GL_RGB;
2899 if (format == GL_SRGB_ALPHA_EXT) 2902 if (format == GL_SRGB_ALPHA_EXT)
2900 return GL_RGBA; 2903 return GL_RGBA;
2901 } 2904 }
2902 if (feature_info->gl_version_info().is_desktop_core_profile) { 2905 if (feature_info->gl_version_info().is_desktop_core_profile) {
2903 const Texture::CompatibilitySwizzle* swizzle = 2906 const Texture::CompatibilitySwizzle* swizzle =
2904 GetCompatibilitySwizzle(format); 2907 GetCompatibilitySwizzle(format);
2905 if (swizzle) 2908 if (swizzle)
2906 return swizzle->dest_format; 2909 return swizzle->dest_format;
2907 } 2910 }
2911 switch (format) {
Ken Russell (switch to Gerrit) 2016/09/30 23:01:30 This mapping back of illegal formats to correct on
2912 case GL_R32F:
2913 case GL_R16F:
2914 case GL_R8:
2915 return GL_RED;
2916 case GL_RG8:
2917 return GL_RG;
2918 case GL_R16UI:
2919 return GL_RED_INTEGER;
2920 default:
2921 break;
2922 }
2908 return format; 2923 return format;
2909 } 2924 }
2910 2925
2911 void TextureManager::DoTexImage( 2926 void TextureManager::DoTexImage(
2912 DecoderTextureState* texture_state, 2927 DecoderTextureState* texture_state,
2913 ContextState* state, 2928 ContextState* state,
2914 DecoderFramebufferState* framebuffer_state, 2929 DecoderFramebufferState* framebuffer_state,
2915 const char* function_name, 2930 const char* function_name,
2916 TextureRef* texture_ref, 2931 TextureRef* texture_ref,
2917 const DoTexImageArguments& args) { 2932 const DoTexImageArguments& args) {
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
3379 uint32_t TextureManager::GetServiceIdGeneration() const { 3394 uint32_t TextureManager::GetServiceIdGeneration() const {
3380 return current_service_id_generation_; 3395 return current_service_id_generation_;
3381 } 3396 }
3382 3397
3383 void TextureManager::IncrementServiceIdGeneration() { 3398 void TextureManager::IncrementServiceIdGeneration() {
3384 current_service_id_generation_++; 3399 current_service_id_generation_++;
3385 } 3400 }
3386 3401
3387 } // namespace gles2 3402 } // namespace gles2
3388 } // namespace gpu 3403 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698