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

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

Issue 1128813005: Supplement filters in Texture::SetParameter* for ES3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bits.h" 10 #include "base/bits.h"
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 target_ == GL_TEXTURE_RECTANGLE_ARB) { 753 target_ == GL_TEXTURE_RECTANGLE_ARB) {
754 if (pname == GL_TEXTURE_MIN_FILTER && 754 if (pname == GL_TEXTURE_MIN_FILTER &&
755 (param != GL_NEAREST && param != GL_LINEAR)) 755 (param != GL_NEAREST && param != GL_LINEAR))
756 return GL_INVALID_ENUM; 756 return GL_INVALID_ENUM;
757 if ((pname == GL_TEXTURE_WRAP_S || pname == GL_TEXTURE_WRAP_T) && 757 if ((pname == GL_TEXTURE_WRAP_S || pname == GL_TEXTURE_WRAP_T) &&
758 param != GL_CLAMP_TO_EDGE) 758 param != GL_CLAMP_TO_EDGE)
759 return GL_INVALID_ENUM; 759 return GL_INVALID_ENUM;
760 } 760 }
761 761
762 switch (pname) { 762 switch (pname) {
763 case GL_TEXTURE_MIN_LOD:
764 case GL_TEXTURE_MAX_LOD:
765 {
766 GLfloat fparam = static_cast<GLfloat>(param);
767 return SetParameterf(feature_info, pname, fparam);
768 }
763 case GL_TEXTURE_MIN_FILTER: 769 case GL_TEXTURE_MIN_FILTER:
764 if (!feature_info->validators()->texture_min_filter_mode.IsValid(param)) { 770 if (!feature_info->validators()->texture_min_filter_mode.IsValid(param)) {
765 return GL_INVALID_ENUM; 771 return GL_INVALID_ENUM;
766 } 772 }
767 min_filter_ = param; 773 min_filter_ = param;
768 break; 774 break;
769 case GL_TEXTURE_MAG_FILTER: 775 case GL_TEXTURE_MAG_FILTER:
770 if (!feature_info->validators()->texture_mag_filter_mode.IsValid(param)) { 776 if (!feature_info->validators()->texture_mag_filter_mode.IsValid(param)) {
771 return GL_INVALID_ENUM; 777 return GL_INVALID_ENUM;
772 } 778 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 UpdateCanRenderCondition(); 848 UpdateCanRenderCondition();
843 return GL_NO_ERROR; 849 return GL_NO_ERROR;
844 } 850 }
845 851
846 GLenum Texture::SetParameterf( 852 GLenum Texture::SetParameterf(
847 const FeatureInfo* feature_info, GLenum pname, GLfloat param) { 853 const FeatureInfo* feature_info, GLenum pname, GLfloat param) {
848 switch (pname) { 854 switch (pname) {
849 case GL_TEXTURE_MIN_FILTER: 855 case GL_TEXTURE_MIN_FILTER:
850 case GL_TEXTURE_MAG_FILTER: 856 case GL_TEXTURE_MAG_FILTER:
851 case GL_TEXTURE_POOL_CHROMIUM: 857 case GL_TEXTURE_POOL_CHROMIUM:
858 case GL_TEXTURE_WRAP_R:
852 case GL_TEXTURE_WRAP_S: 859 case GL_TEXTURE_WRAP_S:
853 case GL_TEXTURE_WRAP_T: 860 case GL_TEXTURE_WRAP_T:
861 case GL_TEXTURE_COMPARE_FUNC:
862 case GL_TEXTURE_COMPARE_MODE:
863 case GL_TEXTURE_BASE_LEVEL:
864 case GL_TEXTURE_MAX_LEVEL:
854 case GL_TEXTURE_USAGE_ANGLE: 865 case GL_TEXTURE_USAGE_ANGLE:
855 { 866 {
856 GLint iparam = static_cast<GLint>(param); 867 GLint iparam = static_cast<GLint>(param);
857 return SetParameteri(feature_info, pname, iparam); 868 return SetParameteri(feature_info, pname, iparam);
858 } 869 }
859 case GL_TEXTURE_MIN_LOD: 870 case GL_TEXTURE_MIN_LOD:
860 min_lod_ = param; 871 min_lod_ = param;
861 break; 872 break;
862 case GL_TEXTURE_MAX_LOD: 873 case GL_TEXTURE_MAX_LOD:
863 max_lod_ = param; 874 max_lod_ = param;
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 } 1827 }
1817 1828
1818 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() { 1829 ScopedTextureUploadTimer::~ScopedTextureUploadTimer() {
1819 texture_state_->texture_upload_count++; 1830 texture_state_->texture_upload_count++;
1820 texture_state_->total_texture_upload_time += 1831 texture_state_->total_texture_upload_time +=
1821 base::TimeTicks::Now() - begin_time_; 1832 base::TimeTicks::Now() - begin_time_;
1822 } 1833 }
1823 1834
1824 } // namespace gles2 1835 } // namespace gles2
1825 } // namespace gpu 1836 } // 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