| Index: trunk/src/cc/resources/scoped_ui_resource.h
|
| ===================================================================
|
| --- trunk/src/cc/resources/scoped_ui_resource.h (revision 223178)
|
| +++ trunk/src/cc/resources/scoped_ui_resource.h (working copy)
|
| @@ -15,27 +15,28 @@
|
|
|
| class LayerTreeHost;
|
|
|
| -// ScopedUIResource creates an UIResource from a bitmap and a LayerTreeHost.
|
| -// This class holds a pointer to the host so that when the instance goes out of
|
| -// scope, the created resource is deleted. On a GetBitmap call from the
|
| -// UIResource manager, ScopeUIResource always returns the reference to the
|
| -// initially given bitmap regardless of whether the request was due to lost
|
| -// resource or not.
|
| class CC_EXPORT ScopedUIResource : public UIResourceClient {
|
| public:
|
| - static scoped_ptr<ScopedUIResource> Create(LayerTreeHost* host,
|
| - const UIResourceBitmap& bitmap);
|
| + static scoped_ptr<ScopedUIResource> Create(
|
| + LayerTreeHost* host,
|
| + scoped_refptr<UIResourceBitmap> bitmap);
|
| virtual ~ScopedUIResource();
|
|
|
| + gfx::Size GetSize() const;
|
| +
|
| // UIResourceClient implementation.
|
| - virtual UIResourceBitmap GetBitmap(UIResourceId uid,
|
| - bool resource_lost) OVERRIDE;
|
| + virtual scoped_refptr<UIResourceBitmap> GetBitmap(
|
| + UIResourceId uid,
|
| + bool resource_lost) OVERRIDE;
|
| UIResourceId id() { return id_; }
|
|
|
| protected:
|
| - ScopedUIResource(LayerTreeHost* host, const UIResourceBitmap& bitmap);
|
| + ScopedUIResource(LayerTreeHost* host, scoped_refptr<UIResourceBitmap> bitmap);
|
|
|
| - UIResourceBitmap bitmap_;
|
| + // An empty default contructor for testing.
|
| + ScopedUIResource();
|
| +
|
| + scoped_refptr<UIResourceBitmap> bitmap_;
|
| LayerTreeHost* host_;
|
| UIResourceId id_;
|
|
|
|
|