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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2834123002: cc: Replace render surface layer list with a render surface list (Closed)
Patch Set: Address review comments 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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1613 child->draw_properties().visible_layer_rect = gfx::Rect(10, 10); 1613 child->draw_properties().visible_layer_rect = gfx::Rect(10, 10);
1614 child->SetDrawsContent(true); 1614 child->SetDrawsContent(true);
1615 1615
1616 host_impl_->active_tree()->SetElementIdsForTesting(); 1616 host_impl_->active_tree()->SetElementIdsForTesting();
1617 1617
1618 AddAnimatedTransformToElementWithPlayer(child->element_id(), timeline(), 10.0, 1618 AddAnimatedTransformToElementWithPlayer(child->element_id(), timeline(), 10.0,
1619 3, 0); 1619 3, 0);
1620 1620
1621 // Set up the property trees so that UpdateDrawProperties will work in 1621 // Set up the property trees so that UpdateDrawProperties will work in
1622 // CommitComplete below. 1622 // CommitComplete below.
1623 LayerImplList list; 1623 RenderSurfaceList list;
1624 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 1624 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
1625 root, gfx::Size(50, 50), &list); 1625 root, gfx::Size(50, 50), &list);
1626 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); 1626 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs);
1627 1627
1628 EXPECT_FALSE(did_request_next_frame_); 1628 EXPECT_FALSE(did_request_next_frame_);
1629 EXPECT_FALSE(did_request_redraw_); 1629 EXPECT_FALSE(did_request_redraw_);
1630 EXPECT_FALSE(did_request_commit_); 1630 EXPECT_FALSE(did_request_commit_);
1631 1631
1632 host_impl_->CommitComplete(); 1632 host_impl_->CommitComplete();
1633 1633
(...skipping 6411 matching lines...) Expand 10 before | Expand all | Expand 10 after
8045 root->SetDrawsContent(true); 8045 root->SetDrawsContent(true);
8046 root->test_properties()->force_render_surface = true; 8046 root->test_properties()->force_render_surface = true;
8047 root->test_properties()->AddChild(std::move(child)); 8047 root->test_properties()->AddChild(std::move(child));
8048 8048
8049 host_impl_->active_tree()->SetRootLayerForTesting(std::move(root)); 8049 host_impl_->active_tree()->SetRootLayerForTesting(std::move(root));
8050 host_impl_->active_tree()->BuildPropertyTreesForTesting(); 8050 host_impl_->active_tree()->BuildPropertyTreesForTesting();
8051 8051
8052 TestFrameData frame; 8052 TestFrameData frame;
8053 8053
8054 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); 8054 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
8055 EXPECT_EQ(1u, frame.render_surface_layer_list->size()); 8055 EXPECT_EQ(1u, frame.render_surface_list->size());
8056 EXPECT_EQ(1u, frame.render_passes.size()); 8056 EXPECT_EQ(1u, frame.render_passes.size());
8057 host_impl_->DidDrawAllLayers(frame); 8057 host_impl_->DidDrawAllLayers(frame);
8058 } 8058 }
8059 8059
8060 class FakeLayerWithQuads : public LayerImpl { 8060 class FakeLayerWithQuads : public LayerImpl {
8061 public: 8061 public:
8062 static std::unique_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) { 8062 static std::unique_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
8063 return base::WrapUnique(new FakeLayerWithQuads(tree_impl, id)); 8063 return base::WrapUnique(new FakeLayerWithQuads(tree_impl, id));
8064 } 8064 }
8065 8065
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
8430 host_impl_->pending_tree()->BuildPropertyTreesForTesting(); 8430 host_impl_->pending_tree()->BuildPropertyTreesForTesting();
8431 8431
8432 scrolling_layer->layer_tree_impl() 8432 scrolling_layer->layer_tree_impl()
8433 ->property_trees() 8433 ->property_trees()
8434 ->scroll_tree.UpdateScrollOffsetBaseForTesting(scrolling_layer->id(), 8434 ->scroll_tree.UpdateScrollOffsetBaseForTesting(scrolling_layer->id(),
8435 scroll_offset); 8435 scroll_offset);
8436 host_impl_->ActivateSyncTree(); 8436 host_impl_->ActivateSyncTree();
8437 8437
8438 bool update_lcd_text = false; 8438 bool update_lcd_text = false;
8439 host_impl_->active_tree()->UpdateDrawProperties(update_lcd_text); 8439 host_impl_->active_tree()->UpdateDrawProperties(update_lcd_text);
8440 ASSERT_EQ(1u, host_impl_->active_tree()->RenderSurfaceLayerList().size()); 8440 ASSERT_EQ(1u, host_impl_->active_tree()->GetRenderSurfaceList().size());
8441 8441
8442 TestFrameData frame; 8442 TestFrameData frame;
8443 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); 8443 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
8444 8444
8445 ASSERT_EQ(1u, frame.render_passes.size()); 8445 ASSERT_EQ(1u, frame.render_passes.size());
8446 ASSERT_LE(1u, frame.render_passes[0]->quad_list.size()); 8446 ASSERT_LE(1u, frame.render_passes[0]->quad_list.size());
8447 const DrawQuad* quad = frame.render_passes[0]->quad_list.front(); 8447 const DrawQuad* quad = frame.render_passes[0]->quad_list.front();
8448 8448
8449 bool clipped = false, force_aa = false; 8449 bool clipped = false, force_aa = false;
8450 gfx::QuadF device_layer_quad = MathUtil::MapQuad( 8450 gfx::QuadF device_layer_quad = MathUtil::MapQuad(
(...skipping 3897 matching lines...) Expand 10 before | Expand all | Expand 10 after
12348 else 12348 else
12349 EXPECT_FALSE(tile->HasRasterTask()); 12349 EXPECT_FALSE(tile->HasRasterTask());
12350 } 12350 }
12351 Region expected_invalidation( 12351 Region expected_invalidation(
12352 raster_source->GetRectForImage(checkerable_image->uniqueID())); 12352 raster_source->GetRectForImage(checkerable_image->uniqueID()));
12353 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation())); 12353 EXPECT_EQ(expected_invalidation, *(root->GetPendingInvalidation()));
12354 } 12354 }
12355 12355
12356 } // namespace 12356 } // namespace
12357 } // namespace cc 12357 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698