| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 : proxy_(NULL), | 49 : proxy_(NULL), |
| 50 output_surface_(CreateFakeOutputSurface()), | 50 output_surface_(CreateFakeOutputSurface()), |
| 51 queue_(make_scoped_ptr(new ResourceUpdateQueue)), | 51 queue_(make_scoped_ptr(new ResourceUpdateQueue)), |
| 52 fake_layer_impl_tree_host_client_(FakeLayerTreeHostClient::DIRECT_3D), | 52 fake_layer_impl_tree_host_client_(FakeLayerTreeHostClient::DIRECT_3D), |
| 53 occlusion_(NULL) { | 53 occlusion_(NULL) { |
| 54 settings_.max_partial_texture_updates = std::numeric_limits<size_t>::max(); | 54 settings_.max_partial_texture_updates = std::numeric_limits<size_t>::max(); |
| 55 settings_.layer_transforms_should_scale_layer_contents = true; | 55 settings_.layer_transforms_should_scale_layer_contents = true; |
| 56 } | 56 } |
| 57 | 57 |
| 58 virtual void SetUp() { | 58 virtual void SetUp() { |
| 59 layer_tree_host_ = LayerTreeHost::Create(&fake_layer_impl_tree_host_client_, | 59 layer_tree_host_ = LayerTreeHost::Create( |
| 60 settings_, | 60 &fake_layer_impl_tree_host_client_, settings_, scoped_ptr<Thread>()); |
| 61 scoped_ptr<Thread>(NULL)); | |
| 62 proxy_ = layer_tree_host_->proxy(); | 61 proxy_ = layer_tree_host_->proxy(); |
| 63 resource_manager_ = PrioritizedResourceManager::Create(proxy_); | 62 resource_manager_ = PrioritizedResourceManager::Create(proxy_); |
| 64 layer_tree_host_->InitializeOutputSurfaceIfNeeded(); | 63 layer_tree_host_->InitializeOutputSurfaceIfNeeded(); |
| 65 layer_tree_host_->SetRootLayer(Layer::Create()); | 64 layer_tree_host_->SetRootLayer(Layer::Create()); |
| 66 | 65 |
| 67 DebugScopedSetImplThreadAndMainThreadBlocked | 66 DebugScopedSetImplThreadAndMainThreadBlocked |
| 68 impl_thread_and_main_thread_blocked(proxy_); | 67 impl_thread_and_main_thread_blocked(proxy_); |
| 69 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); | 68 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); |
| 70 host_impl_ = make_scoped_ptr(new FakeLayerTreeHostImpl(proxy_)); | 69 host_impl_ = make_scoped_ptr(new FakeLayerTreeHostImpl(proxy_)); |
| 71 } | 70 } |
| (...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1846 // Invalidate the entire layer in layer space. When painting, the rect given | 1845 // Invalidate the entire layer in layer space. When painting, the rect given |
| 1847 // to webkit should match the layer's bounds. | 1846 // to webkit should match the layer's bounds. |
| 1848 layer->SetNeedsDisplayRect(layer_rect); | 1847 layer->SetNeedsDisplayRect(layer_rect); |
| 1849 layer->Update(queue_.get(), 0, NULL); | 1848 layer->Update(queue_.get(), 0, NULL); |
| 1850 | 1849 |
| 1851 EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect()); | 1850 EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect()); |
| 1852 } | 1851 } |
| 1853 | 1852 |
| 1854 } // namespace | 1853 } // namespace |
| 1855 } // namespace cc | 1854 } // namespace cc |
| OLD | NEW |