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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h

Issue 245923008: Optimize GLES2DecoderImpl::ApplyDirtyState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on refactored gles2_cmd_decoder_unittest.cc Created 6 years, 8 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: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
index 52e7211e4241df47083ef78c3337a59eb6448351..91ff2e12c8d83ef1cc9990ece39b6bfac5a4f094 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -34,7 +34,7 @@ namespace gles2 {
class MemoryTracker;
-class GLES2DecoderTestBase : public testing::Test {
+class GLES2DecoderTestBase : public ::testing::TestWithParam<bool> {
public:
GLES2DecoderTestBase();
virtual ~GLES2DecoderTestBase();
@@ -269,6 +269,8 @@ class GLES2DecoderTestBase : public testing::Test {
GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset);
void DoVertexAttribDivisorANGLE(GLuint index, GLuint divisor);
+ void DoEnableDisable(GLenum cap, bool enable);
+
void DoEnableVertexAttribArray(GLint index);
void DoBufferData(GLenum target, GLsizei size);
@@ -330,6 +332,13 @@ class GLES2DecoderTestBase : public testing::Test {
GLclampf restore_depth,
bool restore_scissor_test);
+ void SetupExpectationsForDepthMask(bool mask);
+ void SetupExpectationsForEnableDisable(GLenum cap, bool enable);
+ void SetupExpectationsForColorMask(bool red,
+ bool green,
+ bool blue,
+ bool alpha);
+
void SetupExpectationsForApplyingDirtyState(
bool framebuffer_is_rgb,
bool framebuffer_has_depth,
@@ -339,10 +348,7 @@ class GLES2DecoderTestBase : public testing::Test {
bool depth_enabled,
GLuint front_stencil_mask,
GLuint back_stencil_mask,
- bool stencil_enabled,
- bool cull_face_enabled,
- bool scissor_test_enabled,
- bool blend_enabled);
+ bool stencil_enabled);
void SetupExpectationsForApplyingDefaultDirtyState();
@@ -510,6 +516,30 @@ class GLES2DecoderTestBase : public testing::Test {
int8 immediate_buffer_[256];
+ const bool ignore_cached_state_for_test_;
+ bool cached_color_mask_red_;
+ bool cached_color_mask_green_;
+ bool cached_color_mask_blue_;
+ bool cached_color_mask_alpha_;
+ bool cached_depth_mask_;
+ uint32 cached_stencil_front_mask_;
+ uint32 cached_stencil_back_mask_;
+
+ struct EnableFlags {
+ EnableFlags();
+ bool cached_blend;
+ bool cached_cull_face;
+ bool cached_depth_test;
+ bool cached_dither;
+ bool cached_polygon_offset_fill;
+ bool cached_sample_alpha_to_coverage;
+ bool cached_sample_coverage;
+ bool cached_scissor_test;
+ bool cached_stencil_test;
+ };
+
+ EnableFlags enable_flags_;
+
private:
class MockCommandBufferEngine : public CommandBufferEngine {
public:

Powered by Google App Engine
This is Rietveld 408576698