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

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

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
« no previous file with comments | « gpu/command_buffer/service/context_state.h ('k') | gpu/command_buffer/service/gl_state_restorer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/context_state.cc
diff --git a/gpu/command_buffer/service/context_state.cc b/gpu/command_buffer/service/context_state.cc
index 5aa24fbacd095e7c09ea022d30254b49588ba9fe..7259d753b628349c4598f445b835408592d50610 100644
--- a/gpu/command_buffer/service/context_state.cc
+++ b/gpu/command_buffer/service/context_state.cc
@@ -77,6 +77,16 @@ bool TargetIsSupported(const FeatureInfo* feature_info, GLuint target) {
}
}
+bool BufferTargetIsSupported(GLuint target) {
+ switch (target) {
+ case GL_ARRAY_BUFFER:
+ return true;
+ default:
+ NOTREACHED();
+ return false;
+ }
+}
+
GLuint GetBufferId(const Buffer* buffer) {
if (buffer)
return buffer->service_id();
@@ -306,6 +316,11 @@ void ContextState::DoLineWidth(GLfloat width) const {
std::min(std::max(width, line_width_min_), line_width_max_));
}
+void ContextState::RestoreBufferBinding(unsigned int target) const {
+ if (BufferTargetIsSupported(target))
piman 2017/03/30 18:31:43 Why this logic? Other targets *are* supported at t
Chandan 2017/03/30 19:22:39 I added this logic to keep it consistent with !sta
+ glBindBuffer(target, GetBufferId(bound_array_buffer.get()));
+}
+
void ContextState::RestoreBufferBindings() const {
if (vertex_attrib_manager.get()) {
Buffer* element_array_buffer =
« no previous file with comments | « gpu/command_buffer/service/context_state.h ('k') | gpu/command_buffer/service/gl_state_restorer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698