OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 5 #ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 15 #include "cc/resources/release_callback.h" |
15 #include "cc/resources/texture_mailbox.h" | 16 #include "cc/resources/texture_mailbox.h" |
16 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
17 | 18 |
18 namespace media { | 19 namespace media { |
19 class SkCanvasVideoRenderer; | 20 class SkCanvasVideoRenderer; |
20 class VideoFrame; | 21 class VideoFrame; |
21 } | 22 } |
22 | 23 |
23 namespace cc { | 24 namespace cc { |
24 class ContextProvider; | 25 class ContextProvider; |
(...skipping 16 matching lines...) Expand all Loading... |
41 HOLE, | 42 HOLE, |
42 #endif | 43 #endif |
43 | 44 |
44 // TODO(danakj): Remove this and abstract TextureMailbox into | 45 // TODO(danakj): Remove this and abstract TextureMailbox into |
45 // "ExternalResource" that can hold a hardware or software backing. | 46 // "ExternalResource" that can hold a hardware or software backing. |
46 SOFTWARE_RESOURCE | 47 SOFTWARE_RESOURCE |
47 }; | 48 }; |
48 | 49 |
49 ResourceType type; | 50 ResourceType type; |
50 std::vector<TextureMailbox> mailboxes; | 51 std::vector<TextureMailbox> mailboxes; |
| 52 std::vector<ReleaseCallback> release_callbacks; |
51 | 53 |
52 // TODO(danakj): Remove these too. | 54 // TODO(danakj): Remove these too. |
53 std::vector<unsigned> software_resources; | 55 std::vector<unsigned> software_resources; |
54 TextureMailbox::ReleaseCallback software_release_callback; | 56 ReleaseCallback software_release_callback; |
55 | 57 |
56 VideoFrameExternalResources(); | 58 VideoFrameExternalResources(); |
57 ~VideoFrameExternalResources(); | 59 ~VideoFrameExternalResources(); |
58 }; | 60 }; |
59 | 61 |
60 // VideoResourceUpdater is by the video system to produce frame content as | 62 // VideoResourceUpdater is by the video system to produce frame content as |
61 // resources consumable by the compositor. | 63 // resources consumable by the compositor. |
62 class CC_EXPORT VideoResourceUpdater | 64 class CC_EXPORT VideoResourceUpdater |
63 : public base::SupportsWeakPtr<VideoResourceUpdater> { | 65 : public base::SupportsWeakPtr<VideoResourceUpdater> { |
64 public: | 66 public: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 112 |
111 std::vector<unsigned> all_resources_; | 113 std::vector<unsigned> all_resources_; |
112 std::vector<PlaneResource> recycled_resources_; | 114 std::vector<PlaneResource> recycled_resources_; |
113 | 115 |
114 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 116 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); |
115 }; | 117 }; |
116 | 118 |
117 } // namespace cc | 119 } // namespace cc |
118 | 120 |
119 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 121 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
OLD | NEW |