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

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: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… 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
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl.h » ('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_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 2677 matching lines...) Expand 10 before | Expand all | Expand 10 after
2688 // deleted). 2688 // deleted).
2689 EXPECT_EQ(gfx::Rect(grand_child->bounds()), 2689 EXPECT_EQ(gfx::Rect(grand_child->bounds()),
2690 grand_child->visible_layer_rect()); 2690 grand_child->visible_layer_rect());
2691 } 2691 }
2692 2692
2693 TEST_F(LayerTreeHostCommonTest, 2693 TEST_F(LayerTreeHostCommonTest,
2694 OcclusionForLayerWithUninvertibleDrawTransform) { 2694 OcclusionForLayerWithUninvertibleDrawTransform) {
2695 FakeImplProxy proxy; 2695 FakeImplProxy proxy;
2696 TestSharedBitmapManager shared_bitmap_manager; 2696 TestSharedBitmapManager shared_bitmap_manager;
2697 TestTaskGraphRunner task_graph_runner; 2697 TestTaskGraphRunner task_graph_runner;
2698 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
2698 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, 2699 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager,
2699 &task_graph_runner); 2700 &task_graph_runner);
2700 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1); 2701 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1);
2701 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2); 2702 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2);
2702 scoped_ptr<LayerImpl> grand_child = 2703 scoped_ptr<LayerImpl> grand_child =
2703 LayerImpl::Create(host_impl.active_tree(), 3); 2704 LayerImpl::Create(host_impl.active_tree(), 3);
2704 scoped_ptr<LayerImpl> occluding_child = 2705 scoped_ptr<LayerImpl> occluding_child =
2705 LayerImpl::Create(host_impl.active_tree(), 4); 2706 LayerImpl::Create(host_impl.active_tree(), 4);
2706 child->SetDrawsContent(true); 2707 child->SetDrawsContent(true);
2707 grand_child->SetDrawsContent(true); 2708 grand_child->SetDrawsContent(true);
(...skipping 19 matching lines...) Expand all
2727 SetLayerPropertiesForTesting(occluding_child.get(), identity_matrix, 2728 SetLayerPropertiesForTesting(occluding_child.get(), identity_matrix,
2728 gfx::Point3F(), gfx::PointF(), 2729 gfx::Point3F(), gfx::PointF(),
2729 gfx::Size(200, 200), false, false, false); 2730 gfx::Size(200, 200), false, false, false);
2730 2731
2731 host_impl.SetViewportSize(root->bounds()); 2732 host_impl.SetViewportSize(root->bounds());
2732 2733
2733 child->AddChild(grand_child.Pass()); 2734 child->AddChild(grand_child.Pass());
2734 root->AddChild(child.Pass()); 2735 root->AddChild(child.Pass());
2735 root->AddChild(occluding_child.Pass()); 2736 root->AddChild(occluding_child.Pass());
2736 host_impl.active_tree()->SetRootLayer(root.Pass()); 2737 host_impl.active_tree()->SetRootLayer(root.Pass());
2737 host_impl.InitializeRenderer(FakeOutputSurface::Create3d()); 2738 host_impl.InitializeRenderer(output_surface.get());
2738 bool update_lcd_text = false; 2739 bool update_lcd_text = false;
2739 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text); 2740 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text);
2740 2741
2741 LayerImpl* grand_child_ptr = 2742 LayerImpl* grand_child_ptr =
2742 host_impl.active_tree()->root_layer()->children()[0]->children()[0]; 2743 host_impl.active_tree()->root_layer()->children()[0]->children()[0];
2743 2744
2744 // Though all layers have invertible transforms, matrix multiplication using 2745 // Though all layers have invertible transforms, matrix multiplication using
2745 // floating-point math makes the draw transform uninvertible. 2746 // floating-point math makes the draw transform uninvertible.
2746 EXPECT_FALSE(grand_child_ptr->draw_transform().IsInvertible()); 2747 EXPECT_FALSE(grand_child_ptr->draw_transform().IsInvertible());
2747 2748
(...skipping 5185 matching lines...) Expand 10 before | Expand all | Expand 10 after
7933 gfx::PointF(), gfx::Size(30, 30), true, false, 7934 gfx::PointF(), gfx::Size(30, 30), true, false,
7934 false); 7935 false);
7935 7936
7936 ExecuteCalculateDrawProperties(root); 7937 ExecuteCalculateDrawProperties(root);
7937 7938
7938 EXPECT_EQ(gfx::Rect(30, 30), test_layer->clip_rect()); 7939 EXPECT_EQ(gfx::Rect(30, 30), test_layer->clip_rect());
7939 } 7940 }
7940 7941
7941 } // namespace 7942 } // namespace
7942 } // namespace cc 7943 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698