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

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

Issue 2999923002: Revert of Allow creating GLImage-backed textures with glTexStorage2D. (Closed)
Patch Set: rebase Created 3 years, 4 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 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 if (param < 1) { 1392 if (param < 1) {
1393 return GL_INVALID_VALUE; 1393 return GL_INVALID_VALUE;
1394 } 1394 }
1395 break; 1395 break;
1396 case GL_TEXTURE_USAGE_ANGLE: 1396 case GL_TEXTURE_USAGE_ANGLE:
1397 if (!feature_info->validators()->texture_usage.IsValid(param)) { 1397 if (!feature_info->validators()->texture_usage.IsValid(param)) {
1398 return GL_INVALID_ENUM; 1398 return GL_INVALID_ENUM;
1399 } 1399 }
1400 usage_ = param; 1400 usage_ = param;
1401 break; 1401 break;
1402 case GL_TEXTURE_BUFFER_USAGE_CHROMIUM:
1403 if (!feature_info->validators()->texture_buffer_usage.IsValid(param)) {
1404 return GL_INVALID_ENUM;
1405 }
1406 buffer_usage_ = param;
1407 break;
1408 case GL_TEXTURE_SWIZZLE_R: 1402 case GL_TEXTURE_SWIZZLE_R:
1409 if (!feature_info->validators()->texture_swizzle.IsValid(param)) { 1403 if (!feature_info->validators()->texture_swizzle.IsValid(param)) {
1410 return GL_INVALID_ENUM; 1404 return GL_INVALID_ENUM;
1411 } 1405 }
1412 swizzle_r_ = param; 1406 swizzle_r_ = param;
1413 break; 1407 break;
1414 case GL_TEXTURE_SWIZZLE_G: 1408 case GL_TEXTURE_SWIZZLE_G:
1415 if (!feature_info->validators()->texture_swizzle.IsValid(param)) { 1409 if (!feature_info->validators()->texture_swizzle.IsValid(param)) {
1416 return GL_INVALID_ENUM; 1410 return GL_INVALID_ENUM;
1417 } 1411 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 case GL_TEXTURE_WRAP_S: 1450 case GL_TEXTURE_WRAP_S:
1457 case GL_TEXTURE_WRAP_T: 1451 case GL_TEXTURE_WRAP_T:
1458 case GL_TEXTURE_COMPARE_FUNC: 1452 case GL_TEXTURE_COMPARE_FUNC:
1459 case GL_TEXTURE_COMPARE_MODE: 1453 case GL_TEXTURE_COMPARE_MODE:
1460 case GL_TEXTURE_BASE_LEVEL: 1454 case GL_TEXTURE_BASE_LEVEL:
1461 case GL_TEXTURE_MAX_LEVEL: 1455 case GL_TEXTURE_MAX_LEVEL:
1462 case GL_TEXTURE_USAGE_ANGLE: 1456 case GL_TEXTURE_USAGE_ANGLE:
1463 case GL_TEXTURE_SWIZZLE_R: 1457 case GL_TEXTURE_SWIZZLE_R:
1464 case GL_TEXTURE_SWIZZLE_G: 1458 case GL_TEXTURE_SWIZZLE_G:
1465 case GL_TEXTURE_SWIZZLE_B: 1459 case GL_TEXTURE_SWIZZLE_B:
1466 case GL_TEXTURE_SWIZZLE_A: 1460 case GL_TEXTURE_SWIZZLE_A: {
1467 case GL_TEXTURE_BUFFER_USAGE_CHROMIUM: {
1468 GLint iparam = static_cast<GLint>(std::round(param)); 1461 GLint iparam = static_cast<GLint>(std::round(param));
1469 return SetParameteri(feature_info, pname, iparam); 1462 return SetParameteri(feature_info, pname, iparam);
1470 } 1463 }
1471 case GL_TEXTURE_MIN_LOD: 1464 case GL_TEXTURE_MIN_LOD:
1472 sampler_state_.min_lod = param; 1465 sampler_state_.min_lod = param;
1473 break; 1466 break;
1474 case GL_TEXTURE_MAX_LOD: 1467 case GL_TEXTURE_MAX_LOD:
1475 sampler_state_.max_lod = param; 1468 sampler_state_.max_lod = param;
1476 break; 1469 break;
1477 case GL_TEXTURE_MAX_ANISOTROPY_EXT: 1470 case GL_TEXTURE_MAX_ANISOTROPY_EXT:
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
2233 } 2226 }
2234 } else { 2227 } else {
2235 switch (pname) { 2228 switch (pname) {
2236 case GL_TEXTURE_SWIZZLE_R: 2229 case GL_TEXTURE_SWIZZLE_R:
2237 case GL_TEXTURE_SWIZZLE_G: 2230 case GL_TEXTURE_SWIZZLE_G:
2238 case GL_TEXTURE_SWIZZLE_B: 2231 case GL_TEXTURE_SWIZZLE_B:
2239 case GL_TEXTURE_SWIZZLE_A: 2232 case GL_TEXTURE_SWIZZLE_A:
2240 glTexParameteri(texture->target(), pname, 2233 glTexParameteri(texture->target(), pname,
2241 texture->GetCompatibilitySwizzleForChannel(param)); 2234 texture->GetCompatibilitySwizzleForChannel(param));
2242 break; 2235 break;
2243 case GL_TEXTURE_BUFFER_USAGE_CHROMIUM:
2244 break;
2245 default: 2236 default:
2246 glTexParameteri(texture->target(), pname, param); 2237 glTexParameteri(texture->target(), pname, param);
2247 break; 2238 break;
2248 } 2239 }
2249 } 2240 }
2250 } 2241 }
2251 2242
2252 void TextureManager::SetParameterf( 2243 void TextureManager::SetParameterf(
2253 const char* function_name, ErrorState* error_state, 2244 const char* function_name, ErrorState* error_state,
2254 TextureRef* ref, GLenum pname, GLfloat param) { 2245 TextureRef* ref, GLenum pname, GLfloat param) {
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
3812 uint32_t TextureManager::GetServiceIdGeneration() const { 3803 uint32_t TextureManager::GetServiceIdGeneration() const {
3813 return current_service_id_generation_; 3804 return current_service_id_generation_;
3814 } 3805 }
3815 3806
3816 void TextureManager::IncrementServiceIdGeneration() { 3807 void TextureManager::IncrementServiceIdGeneration() {
3817 current_service_id_generation_++; 3808 current_service_id_generation_++;
3818 } 3809 }
3819 3810
3820 } // namespace gles2 3811 } // namespace gles2
3821 } // namespace gpu 3812 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager.h ('k') | gpu/command_buffer/tests/gl_texture_storage_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698