Chromium Code Reviews| Index: cc/trees/layer_tree_host.h |
| =================================================================== |
| --- cc/trees/layer_tree_host.h (revision 210393) |
| +++ cc/trees/layer_tree_host.h (working copy) |
| @@ -6,6 +6,7 @@ |
| #define CC_TREES_LAYER_TREE_HOST_H_ |
| #include <limits> |
| +#include <list> |
| #include <vector> |
| #include "base/basictypes.h" |
| @@ -23,6 +24,8 @@ |
| #include "cc/input/top_controls_state.h" |
| #include "cc/layers/layer_lists.h" |
| #include "cc/output/output_surface.h" |
| +#include "cc/resources/ui_resource_bitmap.h" |
| +#include "cc/resources/ui_resource_manager_client.h" |
| #include "cc/scheduler/rate_limiter.h" |
| #include "cc/trees/layer_tree_host_client.h" |
| #include "cc/trees/layer_tree_host_common.h" |
| @@ -82,6 +85,17 @@ |
| bool using_map_image; |
| }; |
| +enum UIResourceRequestType { |
| + UIResourceCreate, |
| + UIResourceDelete |
| +}; |
| + |
| +struct UIResourceRequest { |
| + UIResourceRequestType type; |
| + UIResourceId id; |
| + scoped_refptr<UIResourceBitmap> bitmap; |
| +}; |
| + |
| class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) { |
| public: |
| static scoped_ptr<LayerTreeHost> Create( |
| @@ -216,6 +230,9 @@ |
| void ApplyScrollAndScale(const ScrollAndScaleSet& info); |
| + void UIResourceReady(UIResourceId id); |
|
enne (OOO)
2013/07/22 23:09:15
Can you remove this if it isn't called anywhere?
powei
2013/07/24 02:28:29
Done.
|
| + void UIResourceLost(UIResourceId id); |
| + |
| void SetImplTransform(const gfx::Transform& transform); |
| void SetLatencyInfo(const ui::LatencyInfo& latency_info); |
| @@ -255,6 +272,11 @@ |
| bool in_paint_layer_contents() const { return in_paint_layer_contents_; } |
| + // UI Resource management |
|
enne (OOO)
2013/07/22 23:09:15
This comment doesn't really add much. Could you i
powei
2013/07/24 02:28:29
Done.
|
| + virtual UIResourceId CreateUIResource(const UIResourceCallback& content); |
| + // Deletes a UI resource. May safely be called more than once. |
| + virtual void DeleteUIResource(UIResourceId id); |
| + |
| protected: |
| LayerTreeHost(LayerTreeHostClient* client, const LayerTreeSettings& settings); |
| bool Initialize(scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
| @@ -281,6 +303,16 @@ |
| bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); |
| + // UIResourceCallback is used to retrieve the the bitmap of the resource |
| + // request. The boolean parameter indicates whether the retrieval is due |
| + // to lost resource (due to lost context) or not. |
| + typedef base::hash_map<UIResourceId, UIResourceCallback> UIResourceClientMap; |
| + UIResourceClientMap ui_resource_client_map_; |
| + int ui_resource_id_; |
| + |
| + typedef std::list<UIResourceRequest> UIResourceRequestQueue; |
| + UIResourceRequestQueue ui_resource_request_queue_; |
| + |
| void CalculateLCDTextMetricsCallback(Layer* layer); |
| bool animating_; |