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

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

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mutex fix Created 5 years, 3 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
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_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "cc/animation/keyframed_animation_curve.h" 10 #include "cc/animation/keyframed_animation_curve.h"
(...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after
2663 // deleted). 2663 // deleted).
2664 EXPECT_EQ(gfx::Rect(grand_child->bounds()), 2664 EXPECT_EQ(gfx::Rect(grand_child->bounds()),
2665 grand_child->visible_layer_rect()); 2665 grand_child->visible_layer_rect());
2666 } 2666 }
2667 2667
2668 TEST_F(LayerTreeHostCommonTest, 2668 TEST_F(LayerTreeHostCommonTest,
2669 OcclusionForLayerWithUninvertibleDrawTransform) { 2669 OcclusionForLayerWithUninvertibleDrawTransform) {
2670 FakeImplProxy proxy; 2670 FakeImplProxy proxy;
2671 TestSharedBitmapManager shared_bitmap_manager; 2671 TestSharedBitmapManager shared_bitmap_manager;
2672 TestTaskGraphRunner task_graph_runner; 2672 TestTaskGraphRunner task_graph_runner;
2673 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
2673 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, 2674 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
2674 &task_graph_runner); 2675 &task_graph_runner);
2675 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1); 2676 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
2676 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2); 2677 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2);
2677 scoped_ptr<LayerImpl> grand_child = 2678 scoped_ptr<LayerImpl> grand_child =
2678 LayerImpl::Create(host_impl.active_tree(), 3); 2679 LayerImpl::Create(host_impl.active_tree(), 3);
2679 scoped_ptr<LayerImpl> occluding_child = 2680 scoped_ptr<LayerImpl> occluding_child =
2680 LayerImpl::Create(host_impl.active_tree(), 4); 2681 LayerImpl::Create(host_impl.active_tree(), 4);
2681 child->SetDrawsContent(true); 2682 child->SetDrawsContent(true);
2682 grand_child->SetDrawsContent(true); 2683 grand_child->SetDrawsContent(true);
(...skipping 19 matching lines...) Expand all
2702 SetLayerPropertiesForTesting(occluding_child.get(), identity_matrix, 2703 SetLayerPropertiesForTesting(occluding_child.get(), identity_matrix,
2703 gfx::Point3F(), gfx::PointF(), 2704 gfx::Point3F(), gfx::PointF(),
2704 gfx::Size(200, 200), false, false, false); 2705 gfx::Size(200, 200), false, false, false);
2705 2706
2706 host_impl.SetViewportSize(root->bounds()); 2707 host_impl.SetViewportSize(root->bounds());
2707 2708
2708 child->AddChild(grand_child.Pass()); 2709 child->AddChild(grand_child.Pass());
2709 root->AddChild(child.Pass()); 2710 root->AddChild(child.Pass());
2710 root->AddChild(occluding_child.Pass()); 2711 root->AddChild(occluding_child.Pass());
2711 host_impl.active_tree()->SetRootLayer(root.Pass()); 2712 host_impl.active_tree()->SetRootLayer(root.Pass());
2712 host_impl.InitializeRenderer(FakeOutputSurface::Create3d()); 2713 host_impl.InitializeRenderer(output_surface.get());
2713 bool update_lcd_text = false; 2714 bool update_lcd_text = false;
2714 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text); 2715 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text);
2715 2716
2716 LayerImpl* grand_child_ptr = 2717 LayerImpl* grand_child_ptr =
2717 host_impl.active_tree()->root_layer()->children()[0]->children()[0]; 2718 host_impl.active_tree()->root_layer()->children()[0]->children()[0];
2718 2719
2719 // Though all layers have invertible transforms, matrix multiplication using 2720 // Though all layers have invertible transforms, matrix multiplication using
2720 // floating-point math makes the draw transform uninvertible. 2721 // floating-point math makes the draw transform uninvertible.
2721 EXPECT_FALSE(grand_child_ptr->draw_transform().IsInvertible()); 2722 EXPECT_FALSE(grand_child_ptr->draw_transform().IsInvertible());
2722 2723
(...skipping 5182 matching lines...) Expand 10 before | Expand all | Expand 10 after
7905 gfx::PointF(), gfx::Size(30, 30), true, false, 7906 gfx::PointF(), gfx::Size(30, 30), true, false,
7906 false); 7907 false);
7907 7908
7908 ExecuteCalculateDrawProperties(root); 7909 ExecuteCalculateDrawProperties(root);
7909 7910
7910 EXPECT_EQ(gfx::Rect(-4, -4, 30, 30), test_layer->clip_rect()); 7911 EXPECT_EQ(gfx::Rect(-4, -4, 30, 30), test_layer->clip_rect());
7911 } 7912 }
7912 7913
7913 } // namespace 7914 } // namespace
7914 } // namespace cc 7915 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698