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

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: Use different return value for failed draw in test, to avoid NOTREACHED() Created 5 years, 3 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
« no previous file with comments | « cc/trees/latency_info_swap_promise_monitor.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6865 matching lines...) Expand 10 before | Expand all | Expand 10 after
6876 6876
6877 const std::vector<ui::LatencyInfo>& metadata_latency_before = 6877 const std::vector<ui::LatencyInfo>& metadata_latency_before =
6878 fake_output_surface->last_sent_frame().metadata.latency_info; 6878 fake_output_surface->last_sent_frame().metadata.latency_info;
6879 EXPECT_TRUE(metadata_latency_before.empty()); 6879 EXPECT_TRUE(metadata_latency_before.empty());
6880 6880
6881 ui::LatencyInfo latency_info; 6881 ui::LatencyInfo latency_info;
6882 latency_info.AddLatencyNumber( 6882 latency_info.AddLatencyNumber(
6883 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, 0); 6883 ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT, 0, 0);
6884 scoped_ptr<SwapPromise> swap_promise( 6884 scoped_ptr<SwapPromise> swap_promise(
6885 new LatencyInfoSwapPromise(latency_info)); 6885 new LatencyInfoSwapPromise(latency_info));
6886 host_impl_->active_tree()->QueueSwapPromise(swap_promise.Pass()); 6886 host_impl_->active_tree()->QueuePinnedSwapPromise(swap_promise.Pass());
6887 host_impl_->SetNeedsRedraw(); 6887 host_impl_->SetNeedsRedraw();
6888 6888
6889 gfx::Rect full_frame_damage(host_impl_->DrawViewportSize()); 6889 gfx::Rect full_frame_damage(host_impl_->DrawViewportSize());
6890 LayerTreeHostImpl::FrameData frame; 6890 LayerTreeHostImpl::FrameData frame;
6891 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); 6891 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
6892 host_impl_->DrawLayers(&frame); 6892 host_impl_->DrawLayers(&frame);
6893 host_impl_->DidDrawAllLayers(frame); 6893 host_impl_->DidDrawAllLayers(frame);
6894 EXPECT_TRUE(host_impl_->SwapBuffers(frame)); 6894 EXPECT_TRUE(host_impl_->SwapBuffers(frame));
6895 6895
6896 const std::vector<ui::LatencyInfo>& metadata_latency_after = 6896 const std::vector<ui::LatencyInfo>& metadata_latency_after =
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
8409 // Hold an unowned pointer to the output surface to use for mock expectations. 8409 // Hold an unowned pointer to the output surface to use for mock expectations.
8410 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); 8410 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get();
8411 8411
8412 CreateHostImpl(DefaultSettings(), output_surface.Pass()); 8412 CreateHostImpl(DefaultSettings(), output_surface.Pass());
8413 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); 8413 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1);
8414 host_impl_->BeginCommit(); 8414 host_impl_->BeginCommit();
8415 } 8415 }
8416 8416
8417 } // namespace 8417 } // namespace
8418 } // namespace cc 8418 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/latency_info_swap_promise_monitor.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698