| 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 6483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6494 | 6494 |
| 6495 const std::vector<ui::LatencyInfo>& metadata_latency_before = | 6495 const std::vector<ui::LatencyInfo>& metadata_latency_before = |
| 6496 fake_output_surface->last_sent_frame().metadata.latency_info; | 6496 fake_output_surface->last_sent_frame().metadata.latency_info; |
| 6497 EXPECT_TRUE(metadata_latency_before.empty()); | 6497 EXPECT_TRUE(metadata_latency_before.empty()); |
| 6498 | 6498 |
| 6499 ui::LatencyInfo latency_info; | 6499 ui::LatencyInfo latency_info; |
| 6500 latency_info.AddLatencyNumber( | 6500 latency_info.AddLatencyNumber( |
| 6501 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, 0); | 6501 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, 0); |
| 6502 scoped_ptr<SwapPromise> swap_promise( | 6502 scoped_ptr<SwapPromise> swap_promise( |
| 6503 new LatencyInfoSwapPromise(latency_info)); | 6503 new LatencyInfoSwapPromise(latency_info)); |
| 6504 host_impl_->active_tree()->QueueSwapPromise(swap_promise.Pass()); | 6504 host_impl_->active_tree()->QueuePromise(swap_promise.Pass()); |
| 6505 host_impl_->SetNeedsRedraw(); | 6505 host_impl_->SetNeedsRedraw(); |
| 6506 | 6506 |
| 6507 gfx::Rect full_frame_damage(host_impl_->DrawViewportSize()); | 6507 gfx::Rect full_frame_damage(host_impl_->DrawViewportSize()); |
| 6508 LayerTreeHostImpl::FrameData frame; | 6508 LayerTreeHostImpl::FrameData frame; |
| 6509 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 6509 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
| 6510 host_impl_->DrawLayers(&frame); | 6510 host_impl_->DrawLayers(&frame); |
| 6511 host_impl_->DidDrawAllLayers(frame); | 6511 host_impl_->DidDrawAllLayers(frame); |
| 6512 EXPECT_TRUE(host_impl_->SwapBuffers(frame)); | 6512 EXPECT_TRUE(host_impl_->SwapBuffers(frame)); |
| 6513 | 6513 |
| 6514 const std::vector<ui::LatencyInfo>& metadata_latency_after = | 6514 const std::vector<ui::LatencyInfo>& metadata_latency_after = |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7680 EXPECT_FALSE(controller.begin_frame_args().IsValid()); | 7680 EXPECT_FALSE(controller.begin_frame_args().IsValid()); |
| 7681 | 7681 |
| 7682 begin_frame_args = CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); | 7682 begin_frame_args = CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
| 7683 EXPECT_FALSE(controller.begin_frame_args().IsValid()); | 7683 EXPECT_FALSE(controller.begin_frame_args().IsValid()); |
| 7684 host_impl_->WillBeginImplFrame(begin_frame_args); | 7684 host_impl_->WillBeginImplFrame(begin_frame_args); |
| 7685 EXPECT_TRUE(controller.begin_frame_args().IsValid()); | 7685 EXPECT_TRUE(controller.begin_frame_args().IsValid()); |
| 7686 } | 7686 } |
| 7687 | 7687 |
| 7688 } // namespace | 7688 } // namespace |
| 7689 } // namespace cc | 7689 } // namespace cc |
| OLD | NEW |