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

Unified Diff: cc/trees/layer_tree_host.h

Issue 22870016: Update the nine patch layer to use UI resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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 | « cc/test/layer_tree_json_parser.cc ('k') | 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 fff226a67b78706bab01a0cf8562a6a7768d458d..e2e33d2636b3062fa1802172807a3d9189672427 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -87,18 +87,35 @@ struct CC_EXPORT RendererCapabilities {
bool using_discard_framebuffer;
};
-struct CC_EXPORT UIResourceRequest {
+class CC_EXPORT UIResourceRequest {
+ public:
enum UIResourceRequestType {
UIResourceCreate,
UIResourceDelete,
UIResourceInvalidRequest
};
- UIResourceRequest();
+ UIResourceRequest(UIResourceRequestType type, UIResourceId id);
+ UIResourceRequest(UIResourceRequestType type,
+ UIResourceId id,
+ const UIResourceBitmap& bitmap);
+ UIResourceRequest(const UIResourceRequest& request);
+
~UIResourceRequest();
- UIResourceRequestType type;
- UIResourceId id;
- scoped_refptr<UIResourceBitmap> bitmap;
+
+ UIResourceRequestType GetType() const { return type_; }
+ UIResourceId GetId() const { return id_; }
+ UIResourceBitmap GetBitmap() const {
+ DCHECK(bitmap_);
+ return *bitmap_.get();
+ }
+
+ UIResourceRequest& operator=(const UIResourceRequest& request);
+
+ private:
+ UIResourceRequestType type_;
+ UIResourceId id_;
+ scoped_ptr<UIResourceBitmap> bitmap_;
};
class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) {
@@ -295,6 +312,8 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) {
// were evicted on the impl thread.
void RecreateUIResources();
+ virtual gfx::Size GetUIResourceSize(UIResourceId id) const;
+
bool UsingSharedMemoryResources();
int id() const { return tree_id_; }
@@ -331,7 +350,13 @@ class CC_EXPORT LayerTreeHost : NON_EXPORTED_BASE(public RateLimiterClient) {
bool AnimateLayersRecursive(Layer* current, base::TimeTicks time);
- typedef base::hash_map<UIResourceId, UIResourceClient*> UIResourceClientMap;
+ struct UIResourceClientData {
+ UIResourceClient* client;
+ gfx::Size size;
+ };
+
+ typedef base::hash_map<UIResourceId, UIResourceClientData>
+ UIResourceClientMap;
UIResourceClientMap ui_resource_client_map_;
int next_ui_resource_id_;
« no previous file with comments | « cc/test/layer_tree_json_parser.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698