#ifndef CC_RESOURCES_SCOPED_UI_RESOURCE_H_
#define CC_RESOURCES_SCOPED_UI_RESOURCE_H_
#include "base/memory/ref_counted.h"
#include "cc/base/cc_export.h"
#include "cc/resources/ui_resource_bitmap.h"
#include "cc/resources/ui_resource_client.h"
#include "ui/gfx/size.h"
namespace cc {
class LayerTreeHost;
class CC_EXPORT ScopedUIResource : public UIResourceClient {
public:
static scoped_ptr<ScopedUIResource> Create(LayerTreeHost* host,
const UIResourceBitmap& bitmap);
virtual ~ScopedUIResource();
virtual UIResourceBitmap GetBitmap(UIResourceId uid,
bool resource_lost) OVERRIDE;
UIResourceId id() { return id_; }
protected:
ScopedUIResource(LayerTreeHost* host, const UIResourceBitmap& bitmap);
UIResourceBitmap bitmap_;
LayerTreeHost* host_;
UIResourceId id_;
private:
DISALLOW_COPY_AND_ASSIGN(ScopedUIResource);
};
}
#endif