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

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

Issue 298753004: Fix an early return and the error status in glLoseContextCHROMIUM impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cmd-buffer-missing-early-returns
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/cmd_buffer_functions.txt ('k') | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 8d50037f4045bab1eb4c1846517e321c04c880cf..6deb8374541e5f0f9dbdd85a26433914af716269 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -948,6 +948,8 @@ class GLES2DecoderImpl : public GLES2Decoder,
void DoDrawBuffersEXT(GLsizei count, const GLenum* bufs);
+ void DoLoseContextCHROMIUM(GLenum current, GLenum other);
+
// Creates a Program for the given program.
Program* CreateProgram(
GLuint client_id, GLuint service_id) {
@@ -1716,7 +1718,9 @@ class GLES2DecoderImpl : public GLES2Decoder,
// Backbuffer attachments that are currently undefined.
uint32 backbuffer_needs_clear_bits_;
- // The current decoder error.
+ // The current decoder error communicates the decoder error through command
+ // processing functions that do not return the error value. Should be set only
+ // if not returning an error.
error::Error current_decoder_error_;
bool use_shader_translator_;
@@ -9444,23 +9448,6 @@ void GLES2DecoderImpl::LoseContext(uint32 reset_status) {
current_decoder_error_ = error::kLostContext;
}
-error::Error GLES2DecoderImpl::HandleLoseContextCHROMIUM(
- uint32 immediate_data_size, const cmds::LoseContextCHROMIUM& c) {
- GLenum current = static_cast<GLenum>(c.current);
- GLenum other = static_cast<GLenum>(c.other);
- if (!validators_->reset_status.IsValid(current)) {
- LOCAL_SET_GL_ERROR_INVALID_ENUM(
- "glLoseContextCHROMIUM", current, "current");
- }
- if (!validators_->reset_status.IsValid(other)) {
- LOCAL_SET_GL_ERROR_INVALID_ENUM("glLoseContextCHROMIUM", other, "other");
- }
- group_->LoseContexts(other);
- reset_status_ = current;
- current_decoder_error_ = error::kLostContext;
- return error::kLostContext;
-}
-
error::Error GLES2DecoderImpl::HandleInsertSyncPointCHROMIUM(
uint32 immediate_data_size, const cmds::InsertSyncPointCHROMIUM& c) {
return error::kUnknownCommand;
@@ -10458,6 +10445,12 @@ void GLES2DecoderImpl::DoDrawBuffersEXT(
}
}
+void GLES2DecoderImpl::DoLoseContextCHROMIUM(GLenum current, GLenum other) {
+ group_->LoseContexts(other);
+ reset_status_ = current;
+ current_decoder_error_ = error::kLostContext;
+}
+
bool GLES2DecoderImpl::ValidateAsyncTransfer(
const char* function_name,
TextureRef* texture_ref,
« no previous file with comments | « gpu/command_buffer/cmd_buffer_functions.txt ('k') | gpu/command_buffer/service/gles2_cmd_decoder_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698