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

Unified Diff: gpu/command_buffer/client/gles2_implementation.h

Issue 11363191: Cache more GL state both service and client side. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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: gpu/command_buffer/client/gles2_implementation.h
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 47fb3b07b1356d7ba2a5ccb1aa2c8d6bffd392e8..1ba9acd5e27da9605bfbfb77f271ca3409a51e0d 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -18,6 +18,7 @@
#include "../common/gles2_cmd_utils.h"
#include "../common/scoped_ptr.h"
#include "../client/ref_counted.h"
+#include "../client/client_context_state.h"
#include "../client/gles2_cmd_helper.h"
#include "../client/gles2_interface.h"
#include "../client/query_tracker.h"
@@ -108,8 +109,8 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
virtual void OnErrorMessage(const char* msg, int id) = 0;
};
- // Stores client side cached GL state.
- struct GLCachedState {
+ // Stores GL state that never changes.
+ struct GLStaticState {
struct GLES2_IMPL_EXPORT IntState {
IntState();
GLint max_combined_texture_image_units;
@@ -125,32 +126,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
GLint num_compressed_texture_formats;
GLint num_shader_binary_formats;
};
- struct EnableState {
- EnableState()
- : blend(false),
- cull_face(false),
- depth_test(false),
- dither(false),
- polygon_offset_fill(false),
- sample_alpha_to_coverage(false),
- sample_coverage(false),
- scissor_test(false),
- stencil_test(false) {
- }
-
- bool blend;
- bool cull_face;
- bool depth_test;
- bool dither;
- bool polygon_offset_fill;
- bool sample_alpha_to_coverage;
- bool sample_coverage;
- bool scissor_test;
- bool stencil_test;
- };
-
IntState int_state;
- EnableState enable_state;
};
// The maxiumum result size from simple GL get commands.
@@ -406,11 +382,11 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
bool IsTextureReservedId(GLuint id) { return false; }
bool IsVertexArrayReservedId(GLuint id) { return false; }
- void BindBufferHelper(GLenum target, GLuint texture);
- void BindFramebufferHelper(GLenum target, GLuint texture);
- void BindRenderbufferHelper(GLenum target, GLuint texture);
- void BindTextureHelper(GLenum target, GLuint texture);
- void BindVertexArrayHelper(GLuint array);
+ bool BindBufferHelper(GLenum target, GLuint texture);
+ bool BindFramebufferHelper(GLenum target, GLuint texture);
+ bool BindRenderbufferHelper(GLenum target, GLuint texture);
+ bool BindTextureHelper(GLenum target, GLuint texture);
+ bool BindVertexArrayHelper(GLuint array);
void DeleteBuffersHelper(GLsizei n, const GLuint* buffers);
void DeleteFramebuffersHelper(GLsizei n, const GLuint* framebuffers);
@@ -497,7 +473,8 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
ExtensionStatus angle_pack_reverse_row_order_status;
- GLCachedState gl_state_;
+ GLStaticState static_state_;
+ ClientContextState state_;
// pack alignment as last set by glPixelStorei
GLint pack_alignment_;
@@ -528,6 +505,9 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
GLuint bound_framebuffer_;
GLuint bound_renderbuffer_;
+ // The program in use by glUseProgram
+ GLuint current_program_;
+
// The currently bound array buffer.
GLuint bound_array_buffer_id_;
« no previous file with comments | « gpu/command_buffer/client/client_context_state_impl_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698