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

Unified Diff: cc/trees/layer_tree_host.h

Issue 23548022: [cc] Evict UIResources when the renderer is not visible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix RenderTreePriority bug Created 7 years, 3 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
« no previous file with comments | « no previous file | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.h
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index e362f84b4ca09789afc7c0ea734edab6f5039e9a..aec2d5fa28503ed45f56c759646c37d109f8a1a3 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -90,6 +90,7 @@ struct CC_EXPORT UIResourceRequest {
enum UIResourceRequestType {
UIResourceCreate,
UIResourceDelete,
+ UIResourceEvictionRecreated,
aelias_OOO_until_Jul13 2013/09/09 22:52:37 Why is it necessary to track this in a different c
ccameron 2013/09/09 23:22:04 I strongly prefer that this be done explicitly --
UIResourceInvalidRequest
};
@@ -98,6 +99,7 @@ struct CC_EXPORT UIResourceRequest {
UIResourceRequestType type;
UIResourceId id;
scoped_refptr<UIResourceBitmap> bitmap;
+ uint64 eviction_count_recreated;
};
class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) {
@@ -287,6 +289,13 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) {
// Deletes a UI resource. May safely be called more than once.
virtual void DeleteUIResource(UIResourceId id);
+ // Record the eviction count sent by the LayerTreeHostImpl at BeginFrame.
+ // If the value of |ui_resource_eviction_count| is greater than the value of
+ // |ui_resource_eviction_count_recreated_| then add the recreation
+ // of all UI resources to the UIResourceRequestQueue and return true.
+ // Otherwise return false.
+ bool SetUIResourceEvictionCount(uint64 ui_resource_eviction_count);
+
bool UsingSharedMemoryResources();
int id() const { return tree_id_; }
@@ -323,14 +332,13 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) {
bool AnimateLayersRecursive(Layer* current, base::TimeTicks time);
- void RecreateUIResources(bool resource_lost);
-
typedef base::hash_map<UIResourceId, UIResourceClient*> UIResourceClientMap;
UIResourceClientMap ui_resource_client_map_;
int next_ui_resource_id_;
typedef std::list<UIResourceRequest> UIResourceRequestQueue;
UIResourceRequestQueue ui_resource_request_queue_;
+ uint64 ui_resource_eviction_count_recreated_;
aelias_OOO_until_Jul13 2013/09/09 22:52:37 It doesn't make sense to me to use a count here.
ccameron 2013/09/09 23:22:04 This isn't the number of resource that have been e
aelias_OOO_until_Jul13 2013/09/09 23:44:30 I agree with your reasoning that a bool is insuffi
void CalculateLCDTextMetricsCallback(Layer* layer);
« no previous file with comments | « no previous file | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698