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

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

Issue 2945673002: Allow creating GLImage-backed textures with glTexStorage2D. (Closed)
Patch Set: add test Created 3 years, 6 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 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 if (param < 1) { 1358 if (param < 1) {
1359 return GL_INVALID_VALUE; 1359 return GL_INVALID_VALUE;
1360 } 1360 }
1361 break; 1361 break;
1362 case GL_TEXTURE_USAGE_ANGLE: 1362 case GL_TEXTURE_USAGE_ANGLE:
1363 if (!feature_info->validators()->texture_usage.IsValid(param)) { 1363 if (!feature_info->validators()->texture_usage.IsValid(param)) {
1364 return GL_INVALID_ENUM; 1364 return GL_INVALID_ENUM;
1365 } 1365 }
1366 usage_ = param; 1366 usage_ = param;
1367 break; 1367 break;
1368 case GL_TEXTURE_BUFFER_USAGE_CHROMIUM:
1369 if (!feature_info->validators()->texture_buffer_usage.IsValid(param)) {
1370 return GL_INVALID_ENUM;
1371 }
1372 buffer_usage_ = param;
1373 break;
1368 case GL_TEXTURE_SWIZZLE_R: 1374 case GL_TEXTURE_SWIZZLE_R:
1369 if (!feature_info->validators()->texture_swizzle.IsValid(param)) { 1375 if (!feature_info->validators()->texture_swizzle.IsValid(param)) {
1370 return GL_INVALID_ENUM; 1376 return GL_INVALID_ENUM;
1371 } 1377 }
1372 swizzle_r_ = param; 1378 swizzle_r_ = param;
1373 break; 1379 break;
1374 case GL_TEXTURE_SWIZZLE_G: 1380 case GL_TEXTURE_SWIZZLE_G:
1375 if (!feature_info->validators()->texture_swizzle.IsValid(param)) { 1381 if (!feature_info->validators()->texture_swizzle.IsValid(param)) {
1376 return GL_INVALID_ENUM; 1382 return GL_INVALID_ENUM;
1377 } 1383 }
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
2192 } 2198 }
2193 } else { 2199 } else {
2194 switch (pname) { 2200 switch (pname) {
2195 case GL_TEXTURE_SWIZZLE_R: 2201 case GL_TEXTURE_SWIZZLE_R:
2196 case GL_TEXTURE_SWIZZLE_G: 2202 case GL_TEXTURE_SWIZZLE_G:
2197 case GL_TEXTURE_SWIZZLE_B: 2203 case GL_TEXTURE_SWIZZLE_B:
2198 case GL_TEXTURE_SWIZZLE_A: 2204 case GL_TEXTURE_SWIZZLE_A:
2199 glTexParameteri(texture->target(), pname, 2205 glTexParameteri(texture->target(), pname,
2200 texture->GetCompatibilitySwizzleForChannel(param)); 2206 texture->GetCompatibilitySwizzleForChannel(param));
2201 break; 2207 break;
2208 case GL_TEXTURE_BUFFER_USAGE_CHROMIUM:
2209 break;
2202 default: 2210 default:
2203 glTexParameteri(texture->target(), pname, param); 2211 glTexParameteri(texture->target(), pname, param);
2204 break; 2212 break;
2205 } 2213 }
2206 } 2214 }
2207 } 2215 }
2208 2216
2209 void TextureManager::SetParameterf( 2217 void TextureManager::SetParameterf(
2210 const char* function_name, ErrorState* error_state, 2218 const char* function_name, ErrorState* error_state,
2211 TextureRef* ref, GLenum pname, GLfloat param) { 2219 TextureRef* ref, GLenum pname, GLfloat param) {
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
3761 uint32_t TextureManager::GetServiceIdGeneration() const { 3769 uint32_t TextureManager::GetServiceIdGeneration() const {
3762 return current_service_id_generation_; 3770 return current_service_id_generation_;
3763 } 3771 }
3764 3772
3765 void TextureManager::IncrementServiceIdGeneration() { 3773 void TextureManager::IncrementServiceIdGeneration() {
3766 current_service_id_generation_++; 3774 current_service_id_generation_++;
3767 } 3775 }
3768 3776
3769 } // namespace gles2 3777 } // namespace gles2
3770 } // namespace gpu 3778 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698