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

Unified Diff: cc/trees/layer_tree_host_impl.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_impl.h
===================================================================
--- cc/trees/layer_tree_host_impl.h (revision 210393)
+++ cc/trees/layer_tree_host_impl.h (working copy)
@@ -24,7 +24,9 @@
#include "cc/output/output_surface_client.h"
#include "cc/output/renderer.h"
#include "cc/quads/render_pass.h"
+#include "cc/resources/resource_provider.h"
#include "cc/resources/tile_manager.h"
+#include "cc/resources/ui_resource_manager.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkPicture.h"
@@ -44,7 +46,6 @@
class MemoryHistory;
class RenderingStatsInstrumentation;
class RenderPassDrawQuad;
-class ResourceProvider;
class TopControlsManager;
struct RendererCapabilities;
@@ -77,6 +78,9 @@
virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) = 0;
virtual void DidActivatePendingTree() = 0;
+ virtual void UIResourceCreatedOnImplThread(UIResourceId uid) = 0;
+ virtual void UIResourceLostOnImplThread(UIResourceId uid) = 0;
+
protected:
virtual ~LayerTreeHostImplClient() {}
};
@@ -374,6 +378,13 @@
bool page_scale_animation_active() const { return !!page_scale_animation_; }
+ void CreateUIResource(UIResourceId uid,
+ scoped_refptr<UIResourceBitmap> bitmap,
+ bool async);
+ // Deletes a UI resource. May safely be called more than once.
+ void DeleteUIResource(UIResourceId uid);
+ ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const;
+
protected:
LayerTreeHostImpl(
const LayerTreeSettings& settings,
@@ -440,6 +451,10 @@
void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy);
void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy);
+ typedef base::hash_map<UIResourceId, ResourceProvider::ResourceId>
+ UIResourceMap;
+ UIResourceMap ui_resource_map_;
+
scoped_ptr<OutputSurface> output_surface_;
// |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile-

Powered by Google App Engine
This is Rietveld 408576698