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

Unified Diff: gpu/command_buffer/service/texture_manager.cc

Issue 14308014: Clean up of GLES2 Command Decoder by moving some of the error state into a separate class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the remaining tests. Added mock ErrorState. Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/texture_manager.cc
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 853e9f390ceeba93b4c301dff516cc436f2bb1d4..a8f84ea04c061b2ddabf2346a3d621242fe09600 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -6,6 +6,7 @@
#include "base/bits.h"
#include "base/stringprintf.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
+#include "gpu/command_buffer/service/error_state.h"
#include "gpu/command_buffer/service/feature_info.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
@@ -1043,17 +1044,18 @@ bool TextureManager::Restore(
texture->SetServiceId(definition->ReleaseServiceId());
glBindTexture(texture->target(), texture->service_id());
texture->SetImmutable(definition->immutable());
- SetParameter(function_name, decoder, texture, GL_TEXTURE_MIN_FILTER,
+ ErrorState* error_state = decoder->GetErrorState();
+ SetParameter(function_name, error_state, texture, GL_TEXTURE_MIN_FILTER,
definition->min_filter());
- SetParameter(function_name, decoder, texture, GL_TEXTURE_MAG_FILTER,
+ SetParameter(function_name, error_state, texture, GL_TEXTURE_MAG_FILTER,
definition->mag_filter());
- SetParameter(function_name, decoder, texture, GL_TEXTURE_WRAP_S,
+ SetParameter(function_name, error_state, texture, GL_TEXTURE_WRAP_S,
definition->wrap_s());
- SetParameter(function_name, decoder, texture, GL_TEXTURE_WRAP_T,
+ SetParameter(function_name, error_state, texture, GL_TEXTURE_WRAP_T,
definition->wrap_t());
if (feature_info_->validators()->texture_parameter.IsValid(
GL_TEXTURE_USAGE_ANGLE)) {
- SetParameter(function_name, decoder, texture, GL_TEXTURE_USAGE_ANGLE,
+ SetParameter(function_name, error_state, texture, GL_TEXTURE_USAGE_ANGLE,
definition->usage());
}
@@ -1061,9 +1063,9 @@ bool TextureManager::Restore(
}
void TextureManager::SetParameter(
- const char* function_name, GLES2Decoder* decoder,
+ const char* function_name, ErrorState* error_state,
Texture* texture, GLenum pname, GLint param) {
- DCHECK(decoder);
+ DCHECK(error_state);
DCHECK(texture);
if (!texture->CanRender(feature_info_)) {
DCHECK_NE(0, num_unrenderable_textures_);
@@ -1076,11 +1078,11 @@ void TextureManager::SetParameter(
GLenum result = texture->SetParameter(feature_info_, pname, param);
if (result != GL_NO_ERROR) {
if (result == GL_INVALID_ENUM) {
- GLESDECODER_SET_GL_ERROR_INVALID_ENUM(
- decoder, function_name, param, "param");
+ ERRORSTATE_SET_GL_ERROR_INVALID_ENUM(
+ error_state, function_name, param, "param");
} else {
- GLESDECODER_SET_GL_ERROR_INVALID_PARAM(
- decoder, result, function_name, pname, static_cast<GLint>(param));
+ ERRORSTATE_SET_GL_ERROR_INVALID_PARAM(
+ error_state, result, function_name, pname, static_cast<GLint>(param));
}
} else {
// Texture tracking pools exist only for the command decoder, so

Powered by Google App Engine
This is Rietveld 408576698