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

Unified Diff: cc/output/gl_renderer_unittest.cc

Issue 2881483002: Always set damage rect to output rect if 3D context was reshaped. (Closed)
Patch Set: redesign Created 3 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
« no previous file with comments | « cc/output/direct_renderer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer_unittest.cc
diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc
index 163771813ca8c59bdcba5c5089f86e10cb0558f1..c4a39d7f1cf4278995c4f4c4adeab1f63ac87c91 100644
--- a/cc/output/gl_renderer_unittest.cc
+++ b/cc/output/gl_renderer_unittest.cc
@@ -2046,7 +2046,7 @@ class GLRendererPartialSwapTest : public GLRendererTest {
gfx::Size viewport_size(100, 100);
- {
+ for (int i = 0; i < 2; ++i) {
int root_pass_id = 1;
RenderPass* root_pass = AddRenderPass(
&render_passes_in_draw_order_, root_pass_id, gfx::Rect(viewport_size),
@@ -2065,8 +2065,13 @@ class GLRendererPartialSwapTest : public GLRendererTest {
// Partial frame, we should use a scissor to swap only that part when
// partial swap is enabled.
root_pass->damage_rect = gfx::Rect(2, 2, 3, 3);
- gfx::Rect output_rectangle =
- partial_swap ? root_pass->damage_rect : gfx::Rect(viewport_size);
+ // With SetDrawRectangle the first frame will have its damage expanded
+ // to cover the entire output rect.
+ bool frame_has_partial_damage =
+ partial_swap && (!set_draw_rectangle || (i > 0));
+ gfx::Rect output_rectangle = frame_has_partial_damage
+ ? root_pass->damage_rect
+ : gfx::Rect(viewport_size);
if (partial_swap || set_draw_rectangle) {
EXPECT_CALL(*gl, Enable(GL_SCISSOR_TEST)).InSequence(seq);
@@ -2093,6 +2098,7 @@ class GLRendererPartialSwapTest : public GLRendererTest {
if (set_draw_rectangle) {
EXPECT_EQ(output_rectangle, output_surface->last_set_draw_rectangle());
}
+ Mock::VerifyAndClearExpectations(gl);
}
}
};
« no previous file with comments | « cc/output/direct_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698