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

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

Issue 308703010: Fix desynched GPU stencil mask cache values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting fix Created 6 years, 7 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.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index f2a6888a51ee903f5d38915b349575ad91f502dc..1c188a92134bdc2b860c6c903255dc77e62528a8 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -727,6 +727,25 @@ void GLES2DecoderTestBase::SetupExpectationsForDepthMask(bool mask) {
}
}
+void GLES2DecoderTestBase::SetupExpectationsForStencilMask(uint32 front_mask,
+ uint32 back_mask) {
+ if (ignore_cached_state_for_test_ ||
+ cached_stencil_front_mask_ != front_mask) {
+ cached_stencil_front_mask_ = front_mask;
+ EXPECT_CALL(*gl_, StencilMaskSeparate(GL_FRONT, front_mask))
+ .Times(1)
+ .RetiresOnSaturation();
+ }
+
+ if (ignore_cached_state_for_test_ ||
+ cached_stencil_back_mask_ != back_mask) {
+ cached_stencil_back_mask_ = back_mask;
+ EXPECT_CALL(*gl_, StencilMaskSeparate(GL_BACK, back_mask))
+ .Times(1)
+ .RetiresOnSaturation();
+ }
+}
+
void GLES2DecoderTestBase::SetupExpectationsForEnableDisable(GLenum cap,
bool enable) {
switch (cap) {
@@ -813,23 +832,7 @@ void GLES2DecoderTestBase::SetupExpectationsForApplyingDirtyState(
SetupExpectationsForColorMask(
color_mask_red, color_mask_green, color_mask_blue, color_mask_alpha);
SetupExpectationsForDepthMask(depth_mask);
-
- if (ignore_cached_state_for_test_ ||
- cached_stencil_front_mask_ != front_stencil_mask) {
- cached_stencil_front_mask_ = front_stencil_mask;
- EXPECT_CALL(*gl_, StencilMaskSeparate(GL_FRONT, front_stencil_mask))
- .Times(1)
- .RetiresOnSaturation();
- }
-
- if (ignore_cached_state_for_test_ ||
- cached_stencil_back_mask_ != back_stencil_mask) {
- cached_stencil_back_mask_ = back_stencil_mask;
- EXPECT_CALL(*gl_, StencilMaskSeparate(GL_BACK, back_stencil_mask))
- .Times(1)
- .RetiresOnSaturation();
- }
-
+ SetupExpectationsForStencilMask(front_stencil_mask, back_stencil_mask);
SetupExpectationsForEnableDisable(GL_DEPTH_TEST,
framebuffer_has_depth && depth_enabled);
SetupExpectationsForEnableDisable(GL_STENCIL_TEST,

Powered by Google App Engine
This is Rietveld 408576698