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

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

Issue 189133004: WebGL TexParameterf and GetTexParameterf needs to handle float param correctly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/service/error_state.h ('k') | gpu/command_buffer/service/error_state_mock.h » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/error_state.h" 5 #include "gpu/command_buffer/service/error_state.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
(...skipping 15 matching lines...) Expand all
26 int line, 26 int line,
27 unsigned int error, 27 unsigned int error,
28 const char* function_name, 28 const char* function_name,
29 const char* msg) OVERRIDE; 29 const char* msg) OVERRIDE;
30 virtual void SetGLErrorInvalidEnum( 30 virtual void SetGLErrorInvalidEnum(
31 const char* filename, 31 const char* filename,
32 int line, 32 int line,
33 const char* function_name, 33 const char* function_name,
34 unsigned int value, 34 unsigned int value,
35 const char* label) OVERRIDE; 35 const char* label) OVERRIDE;
36 virtual void SetGLErrorInvalidParam( 36 virtual void SetGLErrorInvalidParami(
37 const char* filename, 37 const char* filename,
38 int line, 38 int line,
39 unsigned int error, 39 unsigned int error,
40 const char* function_name, 40 const char* function_name,
41 unsigned int pname, 41 unsigned int pname,
42 int param) OVERRIDE; 42 int param) OVERRIDE;
43 virtual void SetGLErrorInvalidParamf(
44 const char* filename,
45 int line,
46 unsigned int error,
47 const char* function_name,
48 unsigned int pname,
49 float param) OVERRIDE;
43 50
44 virtual unsigned int PeekGLError( 51 virtual unsigned int PeekGLError(
45 const char* filename, int line, const char* function_name) OVERRIDE; 52 const char* filename, int line, const char* function_name) OVERRIDE;
46 53
47 virtual void CopyRealGLErrorsToWrapper( 54 virtual void CopyRealGLErrorsToWrapper(
48 const char* filename, int line, const char* function_name) OVERRIDE; 55 const char* filename, int line, const char* function_name) OVERRIDE;
49 56
50 virtual void ClearRealGLErrors( 57 virtual void ClearRealGLErrors(
51 const char* filename, int line, const char* function_name) OVERRIDE; 58 const char* filename, int line, const char* function_name) OVERRIDE;
52 59
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const char* filename, 131 const char* filename,
125 int line, 132 int line,
126 const char* function_name, 133 const char* function_name,
127 unsigned int value, 134 unsigned int value,
128 const char* label) { 135 const char* label) {
129 SetGLError(filename, line, GL_INVALID_ENUM, function_name, 136 SetGLError(filename, line, GL_INVALID_ENUM, function_name,
130 (std::string(label) + " was " + 137 (std::string(label) + " was " +
131 GLES2Util::GetStringEnum(value)).c_str()); 138 GLES2Util::GetStringEnum(value)).c_str());
132 } 139 }
133 140
134 void ErrorStateImpl::SetGLErrorInvalidParam( 141 void ErrorStateImpl::SetGLErrorInvalidParami(
135 const char* filename, 142 const char* filename,
136 int line, 143 int line,
137 unsigned int error, 144 unsigned int error,
138 const char* function_name, 145 const char* function_name,
139 unsigned int pname, int param) { 146 unsigned int pname, int param) {
140 if (error == GL_INVALID_ENUM) { 147 if (error == GL_INVALID_ENUM) {
141 SetGLError( 148 SetGLError(
142 filename, line, GL_INVALID_ENUM, function_name, 149 filename, line, GL_INVALID_ENUM, function_name,
143 (std::string("trying to set ") + 150 (std::string("trying to set ") +
144 GLES2Util::GetStringEnum(pname) + " to " + 151 GLES2Util::GetStringEnum(pname) + " to " +
145 GLES2Util::GetStringEnum(param)).c_str()); 152 GLES2Util::GetStringEnum(param)).c_str());
146 } else { 153 } else {
147 SetGLError( 154 SetGLError(
148 filename, line, error, function_name, 155 filename, line, error, function_name,
149 (std::string("trying to set ") + 156 (std::string("trying to set ") +
150 GLES2Util::GetStringEnum(pname) + " to " + 157 GLES2Util::GetStringEnum(pname) + " to " +
151 base::StringPrintf("%d", param)).c_str()); 158 base::StringPrintf("%d", param)).c_str());
152 } 159 }
153 } 160 }
154 161
162 void ErrorStateImpl::SetGLErrorInvalidParamf(
163 const char* filename,
164 int line,
165 unsigned int error,
166 const char* function_name,
167 unsigned int pname, float param) {
168 SetGLError(
169 filename, line, error, function_name,
170 (std::string("trying to set ") +
171 GLES2Util::GetStringEnum(pname) + " to " +
172 base::StringPrintf("%G", param)).c_str());
173 }
174
155 void ErrorStateImpl::CopyRealGLErrorsToWrapper( 175 void ErrorStateImpl::CopyRealGLErrorsToWrapper(
156 const char* filename, int line, const char* function_name) { 176 const char* filename, int line, const char* function_name) {
157 GLenum error; 177 GLenum error;
158 while ((error = glGetError()) != GL_NO_ERROR) { 178 while ((error = glGetError()) != GL_NO_ERROR) {
159 SetGLError(filename, line, error, function_name, 179 SetGLError(filename, line, error, function_name,
160 "<- error from previous GL command"); 180 "<- error from previous GL command");
161 } 181 }
162 } 182 }
163 183
164 void ErrorStateImpl::ClearRealGLErrors( 184 void ErrorStateImpl::ClearRealGLErrors(
165 const char* filename, int line, const char* function_name) { 185 const char* filename, int line, const char* function_name) {
166 // Clears and logs all current gl errors. 186 // Clears and logs all current gl errors.
167 GLenum error; 187 GLenum error;
168 while ((error = glGetError()) != GL_NO_ERROR) { 188 while ((error = glGetError()) != GL_NO_ERROR) {
169 if (error != GL_OUT_OF_MEMORY) { 189 if (error != GL_OUT_OF_MEMORY) {
170 // GL_OUT_OF_MEMORY can legally happen on lost device. 190 // GL_OUT_OF_MEMORY can legally happen on lost device.
171 logger_->LogMessage( 191 logger_->LogMessage(
172 filename, line, 192 filename, line,
173 std::string("GL ERROR :") + 193 std::string("GL ERROR :") +
174 GLES2Util::GetStringEnum(error) + " : " + 194 GLES2Util::GetStringEnum(error) + " : " +
175 function_name + ": was unhandled"); 195 function_name + ": was unhandled");
176 NOTREACHED() << "GL error " << error << " was unhandled."; 196 NOTREACHED() << "GL error " << error << " was unhandled.";
177 } 197 }
178 } 198 }
179 } 199 }
180 200
181 } // namespace gles2 201 } // namespace gles2
182 } // namespace gpu 202 } // namespace gpu
183 203
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/error_state.h ('k') | gpu/command_buffer/service/error_state_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698