diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-07 18:16:24 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-07 18:16:24 +0000 |
commit | 9bf06c7581a762850bd0d25d9f44c52ab6065056 (patch) | |
tree | 5161e42d9d33da4e0b1bae9d131a70bafedc3964 /cc/surfaces | |
parent | 275f3166c46b21eff834e6d63de818a69955a3eb (diff) | |
download | chromium_src-9bf06c7581a762850bd0d25d9f44c52ab6065056.zip chromium_src-9bf06c7581a762850bd0d25d9f44c52ab6065056.tar.gz chromium_src-9bf06c7581a762850bd0d25d9f44c52ab6065056.tar.bz2 |
cc: Add visible_rect to Draw*Quad::SetNew().
Currently the visible_rect is implicitly set to the quad's |rect| value
then later changed by the occlusion/culling code. Instead we want to
compute this value up front and set it on the quad when the quad is
created. So add it to the SetNew() method. Currently it should always
be set to the same value as the |rect|.
R=enne
BUG=344962
Review URL: https://codereview.chromium.org/185563008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/surfaces')
-rw-r--r-- | cc/surfaces/surface_aggregator_test_helpers.cc | 7 | ||||
-rw-r--r-- | cc/surfaces/surface_aggregator_unittest.cc | 4 | ||||
-rw-r--r-- | cc/surfaces/surfaces_pixeltest.cc | 10 |
3 files changed, 19 insertions, 2 deletions
diff --git a/cc/surfaces/surface_aggregator_test_helpers.cc b/cc/surfaces/surface_aggregator_test_helpers.cc index a1bb0be..d484d7e 100644 --- a/cc/surfaces/surface_aggregator_test_helpers.cc +++ b/cc/surfaces/surface_aggregator_test_helpers.cc @@ -46,8 +46,10 @@ void AddTestSurfaceQuad(TestRenderPass* pass, scoped_ptr<SurfaceDrawQuad> surface_quad = SurfaceDrawQuad::Create(); gfx::Rect quad_rect = gfx::Rect(surface_size); - surface_quad->SetNew( - pass->shared_quad_state_list.back(), gfx::Rect(surface_size), surface_id); + surface_quad->SetNew(pass->shared_quad_state_list.back(), + gfx::Rect(surface_size), + gfx::Rect(surface_size), + surface_id); pass->quad_list.push_back(surface_quad.PassAs<DrawQuad>()); } void AddTestRenderPassQuad(TestRenderPass* pass, @@ -67,6 +69,7 @@ void AddTestRenderPassQuad(TestRenderPass* pass, scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); quad->SetNew(shared_state, output_rect, + output_rect, render_pass_id, false, 0, diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc index 83fddea..0e23389 100644 --- a/cc/surfaces/surface_aggregator_unittest.cc +++ b/cc/surfaces/surface_aggregator_unittest.cc @@ -431,6 +431,7 @@ void AddSolidColorQuadWithBlendMode(const gfx::Size& size, scoped_ptr<SolidColorDrawQuad> color_quad = SolidColorDrawQuad::Create(); color_quad->SetNew(pass->shared_quad_state_list.back(), visible_content_rect, + visible_content_rect, SK_ColorGREEN, force_anti_aliasing_off); pass->quad_list.push_back(color_quad.PassAs<DrawQuad>()); @@ -498,6 +499,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateSharedQuadStateProperties) { SurfaceDrawQuad::Create(); grandchild_surface_quad->SetNew(child_one_pass->shared_quad_state_list.back(), gfx::Rect(surface_size), + gfx::Rect(surface_size), grandchild_surface.surface_id()); child_one_pass->quad_list.push_back( grandchild_surface_quad.PassAs<DrawQuad>()); @@ -523,6 +525,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateSharedQuadStateProperties) { SurfaceDrawQuad::Create(); child_one_surface_quad->SetNew(root_pass->shared_quad_state_list.back(), gfx::Rect(surface_size), + gfx::Rect(surface_size), child_one_surface.surface_id()); root_pass->quad_list.push_back(child_one_surface_quad.PassAs<DrawQuad>()); AddSolidColorQuadWithBlendMode(surface_size, root_pass.get(), blend_modes[4]); @@ -530,6 +533,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, AggregateSharedQuadStateProperties) { SurfaceDrawQuad::Create(); child_two_surface_quad->SetNew(root_pass->shared_quad_state_list.back(), gfx::Rect(surface_size), + gfx::Rect(surface_size), child_two_surface.surface_id()); root_pass->quad_list.push_back(child_two_surface_quad.PassAs<DrawQuad>()); AddSolidColorQuadWithBlendMode(surface_size, root_pass.get(), blend_modes[6]); diff --git a/cc/surfaces/surfaces_pixeltest.cc b/cc/surfaces/surfaces_pixeltest.cc index 54d40d7..fd5951c 100644 --- a/cc/surfaces/surfaces_pixeltest.cc +++ b/cc/surfaces/surfaces_pixeltest.cc @@ -57,6 +57,7 @@ TEST_F(SurfacesPixelTest, DrawSimpleFrame) { bool force_anti_aliasing_off = false; color_quad->SetNew(pass->shared_quad_state_list.back(), rect, + rect, SK_ColorGREEN, force_anti_aliasing_off); pass->quad_list.push_back(color_quad.PassAs<DrawQuad>()); @@ -102,6 +103,7 @@ TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) { scoped_ptr<SurfaceDrawQuad> surface_quad = SurfaceDrawQuad::Create(); surface_quad->SetNew(pass->shared_quad_state_list.back(), gfx::Rect(child_size), + gfx::Rect(child_size), child_surface.surface_id()); pass->quad_list.push_back(surface_quad.PassAs<DrawQuad>()); @@ -109,6 +111,7 @@ TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) { bool force_anti_aliasing_off = false; color_quad->SetNew(pass->shared_quad_state_list.back(), rect, + rect, SK_ColorYELLOW, force_anti_aliasing_off); pass->quad_list.push_back(color_quad.PassAs<DrawQuad>()); @@ -135,6 +138,7 @@ TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) { bool force_anti_aliasing_off = false; color_quad->SetNew(pass->shared_quad_state_list.back(), rect, + rect, SK_ColorBLUE, force_anti_aliasing_off); pass->quad_list.push_back(color_quad.PassAs<DrawQuad>()); @@ -190,6 +194,7 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { scoped_ptr<SurfaceDrawQuad> left_surface_quad = SurfaceDrawQuad::Create(); left_surface_quad->SetNew(pass->shared_quad_state_list.back(), gfx::Rect(child_size), + gfx::Rect(child_size), left_child.surface_id()); pass->quad_list.push_back(left_surface_quad.PassAs<DrawQuad>()); @@ -200,6 +205,7 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { scoped_ptr<SurfaceDrawQuad> right_surface_quad = SurfaceDrawQuad::Create(); right_surface_quad->SetNew(pass->shared_quad_state_list.back(), gfx::Rect(child_size), + gfx::Rect(child_size), right_child.surface_id()); pass->quad_list.push_back(right_surface_quad.PassAs<DrawQuad>()); @@ -226,6 +232,7 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { bool force_anti_aliasing_off = false; top_color_quad->SetNew(pass->shared_quad_state_list.back(), gfx::Rect(quad_size), + gfx::Rect(quad_size), SK_ColorGREEN, force_anti_aliasing_off); pass->quad_list.push_back(top_color_quad.PassAs<DrawQuad>()); @@ -234,6 +241,7 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { SolidColorDrawQuad::Create(); bottom_color_quad->SetNew(pass->shared_quad_state_list.back(), gfx::Rect(0, 100, 100, 100), + gfx::Rect(0, 100, 100, 100), SK_ColorBLUE, force_anti_aliasing_off); pass->quad_list.push_back(bottom_color_quad.PassAs<DrawQuad>()); @@ -261,6 +269,7 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { bool force_anti_aliasing_off = false; top_color_quad->SetNew(pass->shared_quad_state_list.back(), gfx::Rect(quad_size), + gfx::Rect(quad_size), SK_ColorBLUE, force_anti_aliasing_off); pass->quad_list.push_back(top_color_quad.PassAs<DrawQuad>()); @@ -269,6 +278,7 @@ TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { SolidColorDrawQuad::Create(); bottom_color_quad->SetNew(pass->shared_quad_state_list.back(), gfx::Rect(0, 100, 100, 100), + gfx::Rect(0, 100, 100, 100), SK_ColorGREEN, force_anti_aliasing_off); pass->quad_list.push_back(bottom_color_quad.PassAs<DrawQuad>()); |