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

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

Issue 2741613004: Handle TEXTURE_SWIZZLE_* in gpu::gles2::Texture::SetParameterf (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 case GL_TEXTURE_MIN_FILTER: 1377 case GL_TEXTURE_MIN_FILTER:
1378 case GL_TEXTURE_MAG_FILTER: 1378 case GL_TEXTURE_MAG_FILTER:
1379 case GL_TEXTURE_WRAP_R: 1379 case GL_TEXTURE_WRAP_R:
1380 case GL_TEXTURE_WRAP_S: 1380 case GL_TEXTURE_WRAP_S:
1381 case GL_TEXTURE_WRAP_T: 1381 case GL_TEXTURE_WRAP_T:
1382 case GL_TEXTURE_COMPARE_FUNC: 1382 case GL_TEXTURE_COMPARE_FUNC:
1383 case GL_TEXTURE_COMPARE_MODE: 1383 case GL_TEXTURE_COMPARE_MODE:
1384 case GL_TEXTURE_BASE_LEVEL: 1384 case GL_TEXTURE_BASE_LEVEL:
1385 case GL_TEXTURE_MAX_LEVEL: 1385 case GL_TEXTURE_MAX_LEVEL:
1386 case GL_TEXTURE_USAGE_ANGLE: 1386 case GL_TEXTURE_USAGE_ANGLE:
1387 { 1387 case GL_TEXTURE_SWIZZLE_R:
1388 GLint iparam = static_cast<GLint>(std::round(param)); 1388 case GL_TEXTURE_SWIZZLE_G:
1389 return SetParameteri(feature_info, pname, iparam); 1389 case GL_TEXTURE_SWIZZLE_B:
1390 } 1390 case GL_TEXTURE_SWIZZLE_A: {
1391 GLint iparam = static_cast<GLint>(std::round(param));
1392 return SetParameteri(feature_info, pname, iparam);
1393 }
1391 case GL_TEXTURE_MIN_LOD: 1394 case GL_TEXTURE_MIN_LOD:
1392 sampler_state_.min_lod = param; 1395 sampler_state_.min_lod = param;
1393 break; 1396 break;
1394 case GL_TEXTURE_MAX_LOD: 1397 case GL_TEXTURE_MAX_LOD:
1395 sampler_state_.max_lod = param; 1398 sampler_state_.max_lod = param;
1396 break; 1399 break;
1397 case GL_TEXTURE_MAX_ANISOTROPY_EXT: 1400 case GL_TEXTURE_MAX_ANISOTROPY_EXT:
1398 if (param < 1.f) { 1401 if (param < 1.f) {
1399 return GL_INVALID_VALUE; 1402 return GL_INVALID_VALUE;
1400 } 1403 }
(...skipping 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after
3655 uint32_t TextureManager::GetServiceIdGeneration() const { 3658 uint32_t TextureManager::GetServiceIdGeneration() const {
3656 return current_service_id_generation_; 3659 return current_service_id_generation_;
3657 } 3660 }
3658 3661
3659 void TextureManager::IncrementServiceIdGeneration() { 3662 void TextureManager::IncrementServiceIdGeneration() {
3660 current_service_id_generation_++; 3663 current_service_id_generation_++;
3661 } 3664 }
3662 3665
3663 } // namespace gles2 3666 } // namespace gles2
3664 } // namespace gpu 3667 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698