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

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: address Dana's comments 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 339ae4e3e0d62e635aa9bc02239ab8213d23320e..82cc00362821642b986766e1640d6568430d2f06 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -21,6 +21,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"
@@ -286,6 +287,14 @@ class CC_EXPORT LayerTreeHost {
scoped_ptr<base::Value> value,
const MicroBenchmark::DoneCallback& callback);
+ // Call this function when you expect there to be a swap buffer.
+ // See swap_promise.h for how to use SwapPromise.
+ // LayerTreeHost will take the ownership of |swap_promise|.
+ void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise);
+
+ void FinishSwapPromises();
+ void BreakSwapPromises(SwapPromise::DidNotSwapReason reason);
+
protected:
LayerTreeHost(LayerTreeHostClient* client,
SharedBitmapManager* manager,
@@ -433,6 +442,8 @@ class CC_EXPORT LayerTreeHost {
SharedBitmapManager* shared_bitmap_manager_;
+ ScopedPtrVector<SwapPromise> swap_promise_list_;
+
DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
};

Powered by Google App Engine
This is Rietveld 408576698