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

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: rework SwapPromise() interface to have virtual DidSwap() & DidNotSwap() interface 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..6f7bdcbc02cc236c14970516eff59a34ee28d928 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -15,12 +15,14 @@
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#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 +288,15 @@ 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.
+ // LTH will take the ownership of |swap_promise|.
danakj 2013/11/13 23:22:09 Spell out LayerTreeHost.
Yufeng Shen (Slow to review) 2013/11/14 22:09:55 Done.
+ void QueueSwapPromise(SwapPromise* swap_promise);
danakj 2013/11/13 23:22:09 If ownership passes, why is this a raw pointer and
Yufeng Shen (Slow to review) 2013/11/14 22:09:55 Done.
+
+ bool HasQueuedSwapPromise();
+ void FinishSwapPromise();
+ void BreakSwapPromise(SwapPromise::DidNotSwapReason reason);
+
protected:
LayerTreeHost(LayerTreeHostClient* client,
SharedBitmapManager* manager,
@@ -433,6 +444,8 @@ class CC_EXPORT LayerTreeHost {
SharedBitmapManager* shared_bitmap_manager_;
+ ScopedVector<SwapPromise> swap_promise_list_;
danakj 2013/11/13 23:22:09 ScopedPtrVector?
Yufeng Shen (Slow to review) 2013/11/14 22:09:55 Done.
+
DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
};

Powered by Google App Engine
This is Rietveld 408576698