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

Unified 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 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_impl.h
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index 1b40b926faaa6a2c37a9e7f1ca00f213b9891499..9ff9efbd07c3b26575b969a11af540b74ad150a3 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -11,6 +11,7 @@
#include "base/containers/hash_tables.h"
#include "base/values.h"
+#include "cc/base/swap_promise.h"
#include "cc/layers/layer_impl.h"
#include "cc/resources/ui_resource_client.h"
#include "ui/events/latency_info.h"
@@ -207,6 +208,17 @@ class CC_EXPORT LayerTreeImpl {
const ui::LatencyInfo& GetLatencyInfo();
void ClearLatencyInfo();
+ // 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,
+ // and a swap_aborted_callback to be called when the swap buffer is aborted (
+ // e.g. the next frame generated does not have actual damage).
+ void QueueSwapPromise(const SwapPromise& swap_promise);
+
+ void TakeSwapPromise(std::vector<SwapPromise>* new_swap_promise);
+ void FinishSwapPromise();
+ void BreakSwapPromise(const std::string& msg);
+
void DidModifyTilePriorities();
ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const;
@@ -269,6 +281,8 @@ class CC_EXPORT LayerTreeImpl {
ui::LatencyInfo latency_info_;
+ std::vector<SwapPromise> swap_promise_list_;
+
UIResourceRequestQueue ui_resource_request_queue_;
private:

Powered by Google App Engine
This is Rietveld 408576698