| 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 6789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6800 | 6800 |
| 6801 const std::vector<ui::LatencyInfo>& metadata_latency_before = | 6801 const std::vector<ui::LatencyInfo>& metadata_latency_before = |
| 6802 fake_output_surface->last_sent_frame().metadata.latency_info; | 6802 fake_output_surface->last_sent_frame().metadata.latency_info; |
| 6803 EXPECT_TRUE(metadata_latency_before.empty()); | 6803 EXPECT_TRUE(metadata_latency_before.empty()); |
| 6804 | 6804 |
| 6805 ui::LatencyInfo latency_info; | 6805 ui::LatencyInfo latency_info; |
| 6806 latency_info.AddLatencyNumber( | 6806 latency_info.AddLatencyNumber( |
| 6807 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, 0); | 6807 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, 0); |
| 6808 scoped_ptr<SwapPromise> swap_promise( | 6808 scoped_ptr<SwapPromise> swap_promise( |
| 6809 new LatencyInfoSwapPromise(latency_info)); | 6809 new LatencyInfoSwapPromise(latency_info)); |
| 6810 host_impl_->active_tree()->QueueSwapPromise(swap_promise.Pass()); | 6810 host_impl_->active_tree()->QueuePinnedSwapPromise(swap_promise.Pass()); |
| 6811 host_impl_->SetNeedsRedraw(); | 6811 host_impl_->SetNeedsRedraw(); |
| 6812 | 6812 |
| 6813 gfx::Rect full_frame_damage(host_impl_->DrawViewportSize()); | 6813 gfx::Rect full_frame_damage(host_impl_->DrawViewportSize()); |
| 6814 LayerTreeHostImpl::FrameData frame; | 6814 LayerTreeHostImpl::FrameData frame; |
| 6815 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 6815 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
| 6816 host_impl_->DrawLayers(&frame); | 6816 host_impl_->DrawLayers(&frame); |
| 6817 host_impl_->DidDrawAllLayers(frame); | 6817 host_impl_->DidDrawAllLayers(frame); |
| 6818 EXPECT_TRUE(host_impl_->SwapBuffers(frame)); | 6818 EXPECT_TRUE(host_impl_->SwapBuffers(frame)); |
| 6819 | 6819 |
| 6820 const std::vector<ui::LatencyInfo>& metadata_latency_after = | 6820 const std::vector<ui::LatencyInfo>& metadata_latency_after = |
| (...skipping 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8288 // Hold an unowned pointer to the output surface to use for mock expectations. | 8288 // Hold an unowned pointer to the output surface to use for mock expectations. |
| 8289 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); | 8289 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); |
| 8290 | 8290 |
| 8291 CreateHostImpl(DefaultSettings(), output_surface.Pass()); | 8291 CreateHostImpl(DefaultSettings(), output_surface.Pass()); |
| 8292 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); | 8292 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); |
| 8293 host_impl_->BeginCommit(); | 8293 host_impl_->BeginCommit(); |
| 8294 } | 8294 } |
| 8295 | 8295 |
| 8296 } // namespace | 8296 } // namespace |
| 8297 } // namespace cc | 8297 } // namespace cc |
| OLD | NEW |