Chromium Code Reviews| Index: cc/trees/layer_tree_host.h |
| diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h |
| index c79f3e515f15a5c54dfaaef35ca4da8ff370caf5..111f8441de376989b97477b28bcdc012b19eab2c 100644 |
| --- a/cc/trees/layer_tree_host.h |
| +++ b/cc/trees/layer_tree_host.h |
| @@ -20,6 +20,7 @@ |
| #include "cc/animation/animation_events.h" |
| #include "cc/base/cc_export.h" |
| #include "cc/base/scoped_ptr_vector.h" |
| +#include "cc/base/swap_promise.h" |
| #include "cc/debug/micro_benchmark.h" |
| #include "cc/debug/micro_benchmark_controller.h" |
| #include "cc/input/input_handler.h" |
| @@ -328,6 +329,18 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) { |
| scoped_ptr<base::Value> value, |
| const MicroBenchmark::DoneCallback& callback); |
| + // Call this function when you expect there to be a swap buffer and want to |
| + // have something done when the swap buffer actaully happens. Provide a |
| + // did_swap_callback in the SwapPromise to be called when swap buffer happens, |
|
jamesr
2013/11/12 03:15:04
what thread will these callbacks be invoked on?
Yufeng Shen (Slow to review)
2013/11/13 21:05:04
Please see the comments in thread_proxy.cc
|
| + // and a swap_aborted_callback to be called when the swap buffer is aborted ( |
|
jamesr
2013/11/12 03:15:04
what about when the context is lost? see LayerTree
Yufeng Shen (Slow to review)
2013/11/13 21:05:04
We started an email thread "Swap Promises" discuss
|
| + // e.g. the next commit aborts, the next frame generated does not have actual |
| + // damage). |
| + void QueueSwapPromise(const SwapPromise& swap_promise); |
| + |
| + bool HasQueuedSwapPromise(); |
| + void FinishSwapPromise(); |
| + void BreakSwapPromise(const std::string& msg); |
| + |
| protected: |
| LayerTreeHost(LayerTreeHostClient* client, |
| SharedBitmapManager* manager, |
| @@ -474,6 +487,8 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) { |
| SharedBitmapManager* shared_bitmap_manager_; |
| + std::vector<SwapPromise> swap_promise_list_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| }; |