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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 1292773003: Queue latency info swap promises in a separate already-active queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compilation Created 5 years, 4 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
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_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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698