OLD | NEW |
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/layers/tiled_layer.h" | 5 #include "cc/layers/tiled_layer.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "cc/debug/overdraw_metrics.h" | 10 #include "cc/debug/overdraw_metrics.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 queue_(make_scoped_ptr(new ResourceUpdateQueue)), | 52 queue_(make_scoped_ptr(new ResourceUpdateQueue)), |
53 impl_thread_("ImplThread"), | 53 impl_thread_("ImplThread"), |
54 fake_layer_tree_host_client_(FakeLayerTreeHostClient::DIRECT_3D), | 54 fake_layer_tree_host_client_(FakeLayerTreeHostClient::DIRECT_3D), |
55 occlusion_(NULL) { | 55 occlusion_(NULL) { |
56 settings_.max_partial_texture_updates = std::numeric_limits<size_t>::max(); | 56 settings_.max_partial_texture_updates = std::numeric_limits<size_t>::max(); |
57 settings_.layer_transforms_should_scale_layer_contents = true; | 57 settings_.layer_transforms_should_scale_layer_contents = true; |
58 } | 58 } |
59 | 59 |
60 virtual void SetUp() { | 60 virtual void SetUp() { |
61 impl_thread_.Start(); | 61 impl_thread_.Start(); |
62 layer_tree_host_ = LayerTreeHost::Create(&fake_layer_tree_host_client_, | 62 layer_tree_host_ = LayerTreeHost::CreateThreaded( |
63 NULL, | 63 &fake_layer_tree_host_client_, |
64 settings_, | 64 NULL, |
65 impl_thread_.message_loop_proxy()); | 65 settings_, |
| 66 impl_thread_.message_loop_proxy()); |
66 proxy_ = layer_tree_host_->proxy(); | 67 proxy_ = layer_tree_host_->proxy(); |
67 resource_manager_ = PrioritizedResourceManager::Create(proxy_); | 68 resource_manager_ = PrioritizedResourceManager::Create(proxy_); |
68 layer_tree_host_->SetLayerTreeHostClientReady(); | 69 layer_tree_host_->SetLayerTreeHostClientReady(); |
69 layer_tree_host_->InitializeOutputSurfaceIfNeeded(); | 70 layer_tree_host_->InitializeOutputSurfaceIfNeeded(); |
70 layer_tree_host_->SetRootLayer(Layer::Create()); | 71 layer_tree_host_->SetRootLayer(Layer::Create()); |
71 | 72 |
72 CHECK(output_surface_->BindToClient(&output_surface_client_)); | 73 CHECK(output_surface_->BindToClient(&output_surface_client_)); |
73 | 74 |
74 DebugScopedSetImplThreadAndMainThreadBlocked | 75 DebugScopedSetImplThreadAndMainThreadBlocked |
75 impl_thread_and_main_thread_blocked(proxy_); | 76 impl_thread_and_main_thread_blocked(proxy_); |
(...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 // Invalidate the entire layer in layer space. When painting, the rect given | 1947 // Invalidate the entire layer in layer space. When painting, the rect given |
1947 // to webkit should match the layer's bounds. | 1948 // to webkit should match the layer's bounds. |
1948 layer->SetNeedsDisplayRect(layer_rect); | 1949 layer->SetNeedsDisplayRect(layer_rect); |
1949 layer->Update(queue_.get(), NULL); | 1950 layer->Update(queue_.get(), NULL); |
1950 | 1951 |
1951 EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect()); | 1952 EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect()); |
1952 } | 1953 } |
1953 | 1954 |
1954 } // namespace | 1955 } // namespace |
1955 } // namespace cc | 1956 } // namespace cc |
OLD | NEW |