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

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

Issue 60513007: Add SwapPromise support to LayerTreeHost and LayerTreeImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add OVERRIDE to TestSwapPromise::DidNotSwap Created 7 years 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/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_
6 #define CC_TREES_LAYER_TREE_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_IMPL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/containers/hash_tables.h" 12 #include "base/containers/hash_tables.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "cc/base/scoped_ptr_vector.h"
15 #include "cc/base/swap_promise.h"
14 #include "cc/layers/layer_impl.h" 16 #include "cc/layers/layer_impl.h"
15 #include "cc/resources/ui_resource_client.h" 17 #include "cc/resources/ui_resource_client.h"
16 #include "ui/events/latency_info.h" 18 #include "ui/events/latency_info.h"
17 19
18 #if defined(COMPILER_GCC) 20 #if defined(COMPILER_GCC)
19 namespace BASE_HASH_NAMESPACE { 21 namespace BASE_HASH_NAMESPACE {
20 template<> 22 template<>
21 struct hash<cc::LayerImpl*> { 23 struct hash<cc::LayerImpl*> {
22 size_t operator()(cc::LayerImpl* ptr) const { 24 size_t operator()(cc::LayerImpl* ptr) const {
23 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); 25 return hash<size_t>()(reinterpret_cast<size_t>(ptr));
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Useful for debug assertions, probably shouldn't be used for anything else. 204 // Useful for debug assertions, probably shouldn't be used for anything else.
203 Proxy* proxy() const; 205 Proxy* proxy() const;
204 206
205 void SetRootLayerScrollOffsetDelegate( 207 void SetRootLayerScrollOffsetDelegate(
206 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); 208 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate);
207 209
208 void SetLatencyInfo(const ui::LatencyInfo& latency_info); 210 void SetLatencyInfo(const ui::LatencyInfo& latency_info);
209 const ui::LatencyInfo& GetLatencyInfo(); 211 const ui::LatencyInfo& GetLatencyInfo();
210 void ClearLatencyInfo(); 212 void ClearLatencyInfo();
211 213
214 // Call this function when you expect there to be a swap buffer.
215 // See swap_promise.h for how to use SwapPromise.
216 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise);
217
218 // Take the |new_swap_promise| and append it to |swap_promise_list_|.
219 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise);
220 void FinishSwapPromises();
221 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason);
222
212 void DidModifyTilePriorities(); 223 void DidModifyTilePriorities();
213 224
214 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; 225 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const;
215 void ProcessUIResourceRequestQueue(); 226 void ProcessUIResourceRequestQueue();
216 227
217 bool IsUIResourceOpaque(UIResourceId uid) const; 228 bool IsUIResourceOpaque(UIResourceId uid) const;
218 229
219 void AddLayerWithCopyOutputRequest(LayerImpl* layer); 230 void AddLayerWithCopyOutputRequest(LayerImpl* layer);
220 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer); 231 void RemoveLayerWithCopyOutputRequest(LayerImpl* layer);
221 const std::vector<LayerImpl*> LayersWithCopyOutputRequest() const; 232 const std::vector<LayerImpl*> LayersWithCopyOutputRequest() const;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 bool needs_update_draw_properties_; 275 bool needs_update_draw_properties_;
265 276
266 // In impl-side painting mode, this is true when the tree may contain 277 // In impl-side painting mode, this is true when the tree may contain
267 // structural differences relative to the active tree. 278 // structural differences relative to the active tree.
268 bool needs_full_tree_sync_; 279 bool needs_full_tree_sync_;
269 280
270 bool next_activation_forces_redraw_; 281 bool next_activation_forces_redraw_;
271 282
272 ui::LatencyInfo latency_info_; 283 ui::LatencyInfo latency_info_;
273 284
285 ScopedPtrVector<SwapPromise> swap_promise_list_;
286
274 UIResourceRequestQueue ui_resource_request_queue_; 287 UIResourceRequestQueue ui_resource_request_queue_;
275 288
276 private: 289 private:
277 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 290 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
278 }; 291 };
279 292
280 } // namespace cc 293 } // namespace cc
281 294
282 #endif // CC_TREES_LAYER_TREE_IMPL_H_ 295 #endif // CC_TREES_LAYER_TREE_IMPL_H_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698