summaryrefslogtreecommitdiffstats
path: root/cc/resources/scoped_ui_resource.h
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-13 23:58:04 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-13 23:58:04 +0000
commit20c8fc354c6716440d1f051a84c74f57f473d1e0 (patch)
tree793e6e9800e3d3704447098a25e73aa7b0fd8b22 /cc/resources/scoped_ui_resource.h
parent3b6107cf3d5377e793b84ff57ce82cda16ab5d44 (diff)
downloadchromium_src-20c8fc354c6716440d1f051a84c74f57f473d1e0.zip
chromium_src-20c8fc354c6716440d1f051a84c74f57f473d1e0.tar.gz
chromium_src-20c8fc354c6716440d1f051a84c74f57f473d1e0.tar.bz2
Revert 223162 "Update the nine patch layer to use UI resources"
Breaks GpuMemoryTest.SingleWindowDoesNotExceedLimit on gpu bots. One example: http://build.chromium.org/p/chromium.gpu/builders/Mac%2010.8%20Debug%20%28Intel%29/builds/11092/steps/content_browsertests/logs/SingleWindowDoesNotExceedLimit > Update the nine patch layer to use UI resources > > The old nine-patch layer used priority resource manager for requesting textures. > This patch updates the nine-patch layer to use the UI resource manager. > this patch clarifies the semantics of the aperture in both image and layer > The new semantics corresponds to existing logic on the android-side. > > Changes have been made to UIResourceBitmap to use SkPixelRef as ref-counted > of the bitmap content. > > The android-side changes: > https://gerrit-int.chromium.org/#/c/43103/ > > BUG=276482,276487,290215 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=222732 > > Review URL: https://chromiumcodereview.appspot.com/22870016 TBR=powei@chromium.org Review URL: https://codereview.chromium.org/23740010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223180 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources/scoped_ui_resource.h')
-rw-r--r--cc/resources/scoped_ui_resource.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/cc/resources/scoped_ui_resource.h b/cc/resources/scoped_ui_resource.h
index c257e1e..a4525e6 100644
--- a/cc/resources/scoped_ui_resource.h
+++ b/cc/resources/scoped_ui_resource.h
@@ -15,27 +15,28 @@ namespace cc {
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);
+
+ // An empty default contructor for testing.
+ ScopedUIResource();
- UIResourceBitmap bitmap_;
+ scoped_refptr<UIResourceBitmap> bitmap_;
LayerTreeHost* host_;
UIResourceId id_;