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

Unified Diff: cc/trees/layer_tree_host.h

Issue 60513007: Add SwapPromise support to LayerTreeHost and LayerTreeImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add comments for when to use QueueSwapPromise() Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698