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

Unified Diff: cc/layers/ui_resource_layer.h

Issue 664173002: Prevent recreation of UI resource holder when created with resource ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added unit test, going back to patch #5 Created 6 years, 1 month 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/layers/ui_resource_layer.cc » ('j') | cc/layers/ui_resource_layer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/ui_resource_layer.h
diff --git a/cc/layers/ui_resource_layer.h b/cc/layers/ui_resource_layer.h
index 3bfd9b2f109d1d0e995060d4d63141f21772d96b..3b3fdb1ddb5998a89b4dfc1e089299c4e46093d3 100644
--- a/cc/layers/ui_resource_layer.h
+++ b/cc/layers/ui_resource_layer.h
@@ -26,9 +26,14 @@ class CC_EXPORT UIResourceLayer : public Layer {
void SetBitmap(const SkBitmap& skbitmap);
- // An alternative way of setting the resource to allow for sharing.
+ // An alternative way of setting the resource to allow for sharing. If you use
+ // this method, you are responsible for updating the ID if the layer moves
+ // between compositors.
void SetUIResourceId(UIResourceId resource_id);
+ // Exposed for testing.
+ UIResourceId GetUIResourceId();
danakj 2014/11/20 16:38:08 If it's just for testing, you could expose it with
Changwan Ryu 2014/11/20 20:52:26 Done.
+
// Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1).
void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right);
@@ -43,6 +48,7 @@ class CC_EXPORT UIResourceLayer : public Layer {
public:
virtual UIResourceId id() = 0;
virtual ~UIResourceHolder();
+ virtual bool NeedsRecreation() = 0;
};
protected:
@@ -62,8 +68,6 @@ class CC_EXPORT UIResourceLayer : public Layer {
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
void RecreateUIResourceHolder();
-
-
DISALLOW_COPY_AND_ASSIGN(UIResourceLayer);
};
« no previous file with comments | « no previous file | cc/layers/ui_resource_layer.cc » ('j') | cc/layers/ui_resource_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698