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

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

Issue 12315051: Make CopyTextureCHROMIUM restore its own state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/service/gles2_cmd_copy_texture_chromium.cc ('k') | no next file » | 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 573d6cbac9de03418f19c5b1bf2dc387b286f649..66426e95d81e9e98b4a1039515b350de234e322e 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -9581,7 +9581,7 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
if (!copy_texture_CHROMIUM_.get()) {
CopyRealGLErrorsToWrapper();
copy_texture_CHROMIUM_.reset(new CopyTextureCHROMIUMResourceManager());
- copy_texture_CHROMIUM_->Initialize();
+ copy_texture_CHROMIUM_->Initialize(this);
RestoreCurrentFramebufferBindings();
if (PeekGLError() != GL_NO_ERROR)
return;
@@ -9625,31 +9625,13 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
texture_manager()->SetLevelCleared(dest_info, GL_TEXTURE_2D, level, true);
}
- clear_state_dirty_ = true;
- glViewport(0, 0, source_width, source_height);
- copy_texture_CHROMIUM_->DoCopyTexture(target, source_info->service_id(),
+ copy_texture_CHROMIUM_->DoCopyTexture(this,
+ target, source_info->service_id(),
dest_info->service_id(), level,
+ source_width, source_height,
unpack_flip_y_,
unpack_premultiply_alpha_,
unpack_unpremultiply_alpha_);
- glViewport(
- state_.viewport_x, state_.viewport_y,
- state_.viewport_width, state_.viewport_height);
-
- // Restore all of the state touched by the extension.
- if (state_.current_program)
- glUseProgram(state_.current_program->service_id());
- else
- glUseProgram(0);
-
- RestoreCurrentFramebufferBindings();
- RestoreCurrentTexture2DBindings();
- RestoreStateForAttrib(
- CopyTextureCHROMIUMResourceManager::kVertexPositionAttrib);
- RestoreStateForAttrib(
- CopyTextureCHROMIUMResourceManager::kVertexTextureAttrib);
-
- ApplyDirtyState();
}
static GLenum ExtractTypeFromStorageFormat(GLenum internalformat) {
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698