GPU: Prefer to restore from decoder state rather than GL state when possible.
Some drivers are buggy. Wherever possible, use the decoder state restoration
for the Scoped{Texture,Framebuffer}Binders.
BUG=239509
Review URL: https://chromiumcodereview.appspot.com/15021011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199542 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 4934df50..1e89262c 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -25,6 +25,7 @@
#include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/gl_context_virtual.h"
+#include "gpu/command_buffer/service/gl_state_restorer_impl.h"
#include "gpu/command_buffer/service/logger.h"
#include "gpu/command_buffer/service/memory_tracking.h"
#include "ui/gl/gl_bindings.h"
@@ -485,6 +486,11 @@
return;
}
+ if (!context->GetGLStateRestorer()) {
+ context->SetGLStateRestorer(
+ new gpu::GLStateRestorerImpl(decoder_->AsWeakPtr()));
+ }
+
if (!context->GetTotalGpuMemory(&total_gpu_memory_))
total_gpu_memory_ = 0;