Chromium Code Reviews| 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 CONTENT_BROWSER_ANDROID_TRANSIENT_UI_RESOURCE_H_ | |
| 6 #define CONTENT_BROWSER_ANDROID_TRANSIENT_UI_RESOURCE_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "cc/resources/ui_resource_client.h" | |
| 10 #include "ui/gfx/size.h" | |
| 11 | |
| 12 namespace cc { | |
| 13 | |
| 14 class LayerTreeHost; | |
| 15 class UIResourceBitmap; | |
| 16 | |
| 17 } | |
| 18 | |
| 19 namespace content { | |
| 20 | |
| 21 // This UIResourceClient immediately frees the pixels after it has been queried | |
| 22 // once. Subsequent GetBitmap() calls will return a small holder. | |
|
no sievers
2014/01/28 20:47:22
Do we really need this class? The way this works,
powei
2014/01/29 13:53:17
Done.
| |
| 23 class TransientUIResource : public cc::UIResourceClient { | |
| 24 public: | |
| 25 static scoped_ptr<TransientUIResource> Create( | |
| 26 cc::LayerTreeHost* host, | |
| 27 const cc::UIResourceBitmap& bitmap); | |
| 28 virtual ~TransientUIResource(); | |
| 29 | |
| 30 // UIResourceClient implementation. | |
| 31 virtual cc::UIResourceBitmap GetBitmap(cc::UIResourceId uid, | |
| 32 bool resource_lost) OVERRIDE; | |
| 33 cc::UIResourceId id() { return id_; } | |
| 34 | |
| 35 protected: | |
| 36 TransientUIResource(cc::LayerTreeHost* host, | |
| 37 const cc::UIResourceBitmap& bitmap); | |
| 38 | |
| 39 scoped_ptr<cc::UIResourceBitmap> bitmap_; | |
| 40 cc::LayerTreeHost* host_; | |
| 41 cc::UIResourceId id_; | |
| 42 | |
| 43 private: | |
| 44 DISALLOW_COPY_AND_ASSIGN(TransientUIResource); | |
| 45 }; | |
| 46 | |
| 47 } // namespace content | |
| 48 | |
| 49 #endif // CONTENT_BROWSER_ANDROID_TRANSIENT_UI_RESOURCE_H_ | |
| OLD | NEW |