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

Side by Side Diff: cc/trees/layer_tree_host_common.h

Issue 365463003: Implement scroll handler latency tracking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments. Created 6 years, 5 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 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_
6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ 6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_
7 7
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "cc/base/cc_export.h" 13 #include "cc/base/cc_export.h"
14 #include "cc/base/scoped_ptr_vector.h" 14 #include "cc/base/scoped_ptr_vector.h"
15 #include "cc/layers/layer_lists.h" 15 #include "cc/layers/layer_lists.h"
16 #include "ui/gfx/rect.h" 16 #include "ui/gfx/rect.h"
17 #include "ui/gfx/transform.h" 17 #include "ui/gfx/transform.h"
18 #include "ui/gfx/vector2d.h" 18 #include "ui/gfx/vector2d.h"
19 19
20 namespace ui {
21 struct LatencyInfo;
22 }
23
20 namespace cc { 24 namespace cc {
21 25
22 class LayerImpl; 26 class LayerImpl;
23 class Layer; 27 class Layer;
24 28
25 class CC_EXPORT LayerTreeHostCommon { 29 class CC_EXPORT LayerTreeHostCommon {
26 public: 30 public:
27 static gfx::Rect CalculateVisibleRect(const gfx::Rect& target_surface_rect, 31 static gfx::Rect CalculateVisibleRect(const gfx::Rect& target_surface_rect,
28 const gfx::Rect& layer_bound_rect, 32 const gfx::Rect& layer_bound_rect,
29 const gfx::Transform& transform); 33 const gfx::Transform& transform);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 gfx::Vector2d scroll_delta; 136 gfx::Vector2d scroll_delta;
133 }; 137 };
134 }; 138 };
135 139
136 struct CC_EXPORT ScrollAndScaleSet { 140 struct CC_EXPORT ScrollAndScaleSet {
137 ScrollAndScaleSet(); 141 ScrollAndScaleSet();
138 ~ScrollAndScaleSet(); 142 ~ScrollAndScaleSet();
139 143
140 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls; 144 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls;
141 float page_scale_delta; 145 float page_scale_delta;
146 std::vector<ui::LatencyInfo> latency_infos;
danakj 2014/07/08 16:49:07 this should be a ScopedPtrVector<SwapPromise>
Sami 2014/07/09 13:28:55 Done.
142 }; 147 };
143 148
144 template <typename LayerType> 149 template <typename LayerType>
145 bool LayerTreeHostCommon::RenderSurfaceContributesToTarget( 150 bool LayerTreeHostCommon::RenderSurfaceContributesToTarget(
146 LayerType* layer, 151 LayerType* layer,
147 int target_surface_layer_id) { 152 int target_surface_layer_id) {
148 // A layer will either contribute its own content, or its render surface's 153 // A layer will either contribute its own content, or its render surface's
149 // content, to the target surface. The layer contributes its surface's content 154 // content, to the target surface. The layer contributes its surface's content
150 // when both the following are true: 155 // when both the following are true:
151 // (1) The layer actually has a render surface, and 156 // (1) The layer actually has a render surface, and
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 false, 250 false,
246 render_surface_layer_list, 251 render_surface_layer_list,
247 0) { 252 0) {
248 DCHECK(root_layer); 253 DCHECK(root_layer);
249 DCHECK(render_surface_layer_list); 254 DCHECK(render_surface_layer_list);
250 } 255 }
251 256
252 } // namespace cc 257 } // namespace cc
253 258
254 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ 259 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698