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

Unified Diff: ui/gl/scoped_binders.h

Issue 2762833003: gpu: Use decoder state restoration for scoped_binders (Closed)
Patch Set: Fixed MediaColorTest failures on macOS Created 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/gl/scoped_binders.h
diff --git a/ui/gl/scoped_binders.h b/ui/gl/scoped_binders.h
index 3217c36c7b5d23f7680ed00dac336334076bbdc8..88732e933aa1ed335226015f971656488899f79a 100644
--- a/ui/gl/scoped_binders.h
+++ b/ui/gl/scoped_binders.h
@@ -33,7 +33,11 @@ class GL_EXPORT ScopedActiveTexture {
~ScopedActiveTexture();
private:
- // TODO(dcastagna): Use GLStateRestorer.
+ // Whenever possible we prefer to use the current GLContext's
+ // GLStateRestorer to maximize driver compabitility.
+ GLStateRestorer* state_restorer_;
+
+ // Failing that we use GL calls to save and restore state.
int old_texture_;
DISALLOW_COPY_AND_ASSIGN(ScopedActiveTexture);
@@ -62,7 +66,11 @@ class GL_EXPORT ScopedUseProgram {
~ScopedUseProgram();
private:
- // TODO(dcastagna): Use GLStateRestorer.
+ // Whenever possible we prefer to use the current GLContext's
+ // GLStateRestorer to maximize driver compabitility.
+ GLStateRestorer* state_restorer_;
+
+ // Failing that we use GL calls to save and restore state.
int old_program_;
DISALLOW_COPY_AND_ASSIGN(ScopedUseProgram);
@@ -79,7 +87,11 @@ class GL_EXPORT ScopedVertexAttribArray {
~ScopedVertexAttribArray();
private:
- // TODO(dcastagna): Use GLStateRestorer.
+ // Whenever possible we prefer to use the current GLContext's
+ // GLStateRestorer to maximize driver compabitility.
+ GLStateRestorer* state_restorer_;
+
+ // Failing that we use GL calls to save and restore state.
int buffer_;
int enabled_;
int index_;
@@ -98,7 +110,11 @@ class GL_EXPORT ScopedBufferBinder {
~ScopedBufferBinder();
private:
- // TODO(dcastagna): Use GLStateRestorer.
+ // Whenever possible we prefer to use the current GLContext's
+ // GLStateRestorer to maximize driver compabitility.
+ GLStateRestorer* state_restorer_;
+
+ // Failing that we use GL calls to save and restore state.
int target_;
int old_id_;

Powered by Google App Engine
This is Rietveld 408576698