OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_RESOURCES_SCOPED_UI_RESOURCE_H_ |
| 6 #define CC_RESOURCES_SCOPED_UI_RESOURCE_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "cc/resources/ui_resource_bitmap.h" |
| 10 #include "cc/resources/ui_resource_client.h" |
| 11 #include "ui/gfx/size.h" |
| 12 |
| 13 namespace cc { |
| 14 |
| 15 class LayerTreeHost; |
| 16 |
| 17 class ScopedUIResource : public UIResourceClient { |
| 18 public: |
| 19 ScopedUIResource(LayerTreeHost* host, scoped_refptr<UIResourceBitmap> bitmap); |
| 20 virtual ~ScopedUIResource(); |
| 21 |
| 22 virtual scoped_refptr<UIResourceBitmap> Create(bool resource_lost); |
| 23 UIResourceId id() { return id_; } |
| 24 |
| 25 protected: |
| 26 // An empty default contructor for testing. |
| 27 ScopedUIResource() {} |
| 28 |
| 29 scoped_refptr<UIResourceBitmap> bitmap_; |
| 30 LayerTreeHost* host_; |
| 31 UIResourceId id_; |
| 32 |
| 33 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(ScopedUIResource); |
| 35 }; |
| 36 |
| 37 } // namespace cc |
| 38 |
| 39 #endif // CC_RESOURCES_SCOPED_UI_RESOURCE_H_ |
OLD | NEW |