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

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

Issue 240163005: Deliver IPC messages together with SwapCompositorFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 if (layer == OuterViewportScrollLayer()) 889 if (layer == OuterViewportScrollLayer())
890 return outer_viewport_offset; 890 return outer_viewport_offset;
891 891
892 inner_viewport_offset = delegate_offset - outer_viewport_offset; 892 inner_viewport_offset = delegate_offset - outer_viewport_offset;
893 893
894 return inner_viewport_offset; 894 return inner_viewport_offset;
895 } 895 }
896 896
897 void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) { 897 void LayerTreeImpl::QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise) {
898 DCHECK(swap_promise); 898 DCHECK(swap_promise);
899 if (swap_promise_list_.size() > kMaxQueuedSwapPromiseNumber)
900 BreakSwapPromises(SwapPromise::SWAP_PROMISE_LIST_OVERFLOW);
901 swap_promise_list_.push_back(swap_promise.Pass()); 899 swap_promise_list_.push_back(swap_promise.Pass());
902 } 900 }
903 901
904 void LayerTreeImpl::PassSwapPromises( 902 void LayerTreeImpl::PassSwapPromises(
905 ScopedPtrVector<SwapPromise>* new_swap_promise) { 903 ScopedPtrVector<SwapPromise>* new_swap_promise) {
906 swap_promise_list_.insert_and_take(swap_promise_list_.end(), 904 swap_promise_list_.insert_and_take(swap_promise_list_.end(),
907 *new_swap_promise); 905 *new_swap_promise);
908 new_swap_promise->clear(); 906 new_swap_promise->clear();
909 } 907 }
910 908
911 void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) { 909 void LayerTreeImpl::FinishSwapPromises(CompositorFrameMetadata* metadata) {
912 for (size_t i = 0; i < swap_promise_list_.size(); i++) 910 for (size_t i = 0; i < swap_promise_list_.size(); i++)
913 swap_promise_list_[i]->DidSwap(metadata); 911 swap_promise_list_[i]->DidSwap(source_frame_number(), metadata);
914 swap_promise_list_.clear(); 912 swap_promise_list_.clear();
915 } 913 }
916 914
917 void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { 915 void LayerTreeImpl::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
918 for (size_t i = 0; i < swap_promise_list_.size(); i++) 916 for (size_t i = 0; i < swap_promise_list_.size(); i++)
919 swap_promise_list_[i]->DidNotSwap(reason); 917 swap_promise_list_[i]->DidNotSwap(reason);
920 swap_promise_list_.clear(); 918 swap_promise_list_.clear();
921 } 919 }
922 920
923 void LayerTreeImpl::DidModifyTilePriorities() { 921 void LayerTreeImpl::DidModifyTilePriorities() {
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion( 1267 LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion(
1270 const gfx::PointF& screen_space_point) { 1268 const gfx::PointF& screen_space_point) {
1271 FindTouchEventLayerFunctor func = {screen_space_point}; 1269 FindTouchEventLayerFunctor func = {screen_space_point};
1272 FindClosestMatchingLayerDataForRecursion data_for_recursion; 1270 FindClosestMatchingLayerDataForRecursion data_for_recursion;
1273 FindClosestMatchingLayer( 1271 FindClosestMatchingLayer(
1274 screen_space_point, root_layer(), func, &data_for_recursion); 1272 screen_space_point, root_layer(), func, &data_for_recursion);
1275 return data_for_recursion.closest_match; 1273 return data_for_recursion.closest_match;
1276 } 1274 }
1277 1275
1278 } // namespace cc 1276 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698