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

Unified Diff: cc/trees/layer_tree_host.h

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 5 months 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
===================================================================
--- cc/trees/layer_tree_host.h (revision 210393)
+++ cc/trees/layer_tree_host.h (working copy)
@@ -7,6 +7,7 @@
#include <limits>
#include <vector>
+#include <list>
#include "base/basictypes.h"
#include "base/cancelable_callback.h"
@@ -23,6 +24,7 @@
#include "cc/input/top_controls_state.h"
#include "cc/layers/layer_lists.h"
#include "cc/output/output_surface.h"
+#include "cc/resources/ui_resource_manager.h"
#include "cc/scheduler/rate_limiter.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_common.h"
@@ -62,6 +64,7 @@
class ResourceProvider;
class ResourceUpdateQueue;
class TopControlsManager;
+
aelias_OOO_until_Jul13 2013/07/10 23:07:22 nit: unnecessary spacing change
powei 2013/07/11 23:54:44 Done.
struct RenderingStats;
struct ScrollAndScaleSet;
@@ -255,6 +258,17 @@
bool in_paint_layer_contents() const { return in_paint_layer_contents_; }
+ // UI Resource management
+ UIResourceId CreateUIResource(scoped_refptr<UIResourceBitmap> bitmap,
+ UIResourceManagerClient* client);
+ void UpdateUIResource(UIResourceId uid,
aelias_OOO_until_Jul13 2013/07/10 23:07:22 I think we can delete this for simplicity, there a
powei 2013/07/11 23:54:44 Done.
+ scoped_refptr<UIResourceBitmap> bitmap,
+ gfx::Rect update_region);
+ // Deletes a UI resource. May safely be called more than once.
+ void DeleteUIResource(UIResourceId id);
+ void UIResourceReady(UIResourceId id);
aelias_OOO_until_Jul13 2013/07/10 23:07:22 Put these two into the "// LayerTreeHost interface
powei 2013/07/11 23:54:44 On 2013/07/10 23:07:22, aelias wrote: > Put these
+ void UIResourceLost(UIResourceId id);
+
protected:
LayerTreeHost(LayerTreeHostClient* client, const LayerTreeSettings& settings);
bool Initialize(scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner);
@@ -281,6 +295,22 @@
bool AnimateLayersRecursive(Layer* current, base::TimeTicks time);
+ typedef base::hash_map<UIResourceId, UIResourceManagerClient* >
+ UIResourceClientMap;
+ UIResourceClientMap ui_resource_client_map_;
+ int ui_resource_counter_;
+
+ struct UIResourceRequest {
+ UIResourceId id;
+ scoped_refptr<UIResourceBitmap> bitmap;
+ bool async;
+ };
+ typedef std::list<UIResourceRequest> UIResourceRequestQueue;
+ UIResourceRequestQueue ui_resource_request_queue_;
+
+ typedef std::list<UIResourceId> UIResourceRemoveQueue;
+ UIResourceRemoveQueue ui_resource_remove_queue_;
+
void CalculateLCDTextMetricsCallback(Layer* layer);
bool animating_;

Powered by Google App Engine
This is Rietveld 408576698