Index: cc/resources/scoped_ui_resource.h |
=================================================================== |
--- cc/resources/scoped_ui_resource.h (revision 0) |
+++ cc/resources/scoped_ui_resource.h (revision 0) |
@@ -0,0 +1,43 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CC_RESOURCES_SCOPED_UI_RESOURCE_H_ |
+#define CC_RESOURCES_SCOPED_UI_RESOURCE_H_ |
+ |
+#include "base/memory/ref_counted.h" |
+#include "cc/resources/ui_resource_bitmap.h" |
+#include "ui/gfx/size.h" |
+ |
+namespace cc { |
+ |
+class LayerTreeHost; |
+typedef int UIResourceId; |
aelias_OOO_until_Jul13
2013/07/25 23:45:11
I'm not sure every compiler out there is happy wit
powei
2013/07/26 23:07:27
Where should this definition live? It could be in
aelias_OOO_until_Jul13
2013/07/26 23:35:31
ui_resource_client.h seems OK.
|
+ |
+class ScopedUIResource : public base::RefCounted<ScopedUIResource> { |
aelias_OOO_until_Jul13
2013/07/25 23:45:11
I don't see a reason to refcount this class, pleas
powei
2013/07/26 23:07:27
Done. Switched back to client-based.
|
+ public: |
+ static scoped_refptr<ScopedUIResource> Create( |
+ LayerTreeHost* host, |
+ scoped_refptr<UIResourceBitmap> bitmap); |
+ |
+ ~ScopedUIResource() { ClearResource(); } |
aelias_OOO_until_Jul13
2013/07/25 23:45:11
This needs to call ReleaseResource, not ClearResou
powei
2013/07/26 23:07:27
Done.
|
+ |
+ void ClearResource(); |
+ void ResetResource(LayerTreeHost* host, |
aelias_OOO_until_Jul13
2013/07/25 23:45:11
On second thought, this method isn't needed after
powei
2013/07/26 23:07:27
Done.
|
+ scoped_refptr<UIResourceBitmap> bitmap); |
+ void ReleaseResource(LayerTreeHost* host); |
+ UIResourceId id() const { return id_; } |
+ |
+ protected: |
+ ScopedUIResource(LayerTreeHost* host, scoped_refptr<UIResourceBitmap> bitmap); |
+ |
+ UIResourceId id_; |
+ scoped_refptr<UIResourceBitmap> bitmap_; |
+ |
+ private: |
+ scoped_refptr<UIResourceBitmap> GetBitmap(bool resource_lost); |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_RESOURCES_SCOPED_UI_RESOURCE_H_ |
Property changes on: cc/resources/scoped_ui_resource.h |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |