Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: cc/resources/video_resource_updater.h

Issue 20185002: ContextProvider in OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: contextprovider: don't access Context3d() in OutputSurface contructors, it's not bound yet Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/resources/tile_manager_unittest.cc ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/texture_mailbox.h" 15 #include "cc/resources/texture_mailbox.h"
16 #include "ui/gfx/size.h" 16 #include "ui/gfx/size.h"
17 17
18 namespace media { 18 namespace media {
19 class SkCanvasVideoRenderer; 19 class SkCanvasVideoRenderer;
20 class VideoFrame; 20 class VideoFrame;
21 } 21 }
22 22
23 namespace cc { 23 namespace cc {
24 class ContextProvider;
24 class ResourceProvider; 25 class ResourceProvider;
25 26
26 class CC_EXPORT VideoFrameExternalResources { 27 class CC_EXPORT VideoFrameExternalResources {
27 public: 28 public:
28 // Specifies what type of data is contained in the mailboxes, as well as how 29 // Specifies what type of data is contained in the mailboxes, as well as how
29 // many mailboxes will be present. 30 // many mailboxes will be present.
30 enum ResourceType { 31 enum ResourceType {
31 NONE, 32 NONE,
32 YUV_RESOURCE, 33 YUV_RESOURCE,
33 RGB_RESOURCE, 34 RGB_RESOURCE,
(...skipping 20 matching lines...) Expand all
54 55
55 VideoFrameExternalResources(); 56 VideoFrameExternalResources();
56 ~VideoFrameExternalResources(); 57 ~VideoFrameExternalResources();
57 }; 58 };
58 59
59 // VideoResourceUpdater is by the video system to produce frame content as 60 // VideoResourceUpdater is by the video system to produce frame content as
60 // resources consumable by the compositor. 61 // resources consumable by the compositor.
61 class CC_EXPORT VideoResourceUpdater 62 class CC_EXPORT VideoResourceUpdater
62 : public base::SupportsWeakPtr<VideoResourceUpdater> { 63 : public base::SupportsWeakPtr<VideoResourceUpdater> {
63 public: 64 public:
64 explicit VideoResourceUpdater(ResourceProvider* resource_provider); 65 explicit VideoResourceUpdater(ContextProvider* context_provider,
66 ResourceProvider* resource_provider);
65 ~VideoResourceUpdater(); 67 ~VideoResourceUpdater();
66 68
67 VideoFrameExternalResources CreateExternalResourcesFromVideoFrame( 69 VideoFrameExternalResources CreateExternalResourcesFromVideoFrame(
68 const scoped_refptr<media::VideoFrame>& video_frame); 70 const scoped_refptr<media::VideoFrame>& video_frame);
69 71
70 private: 72 private:
71 struct PlaneResource { 73 struct PlaneResource {
72 unsigned resource_id; 74 unsigned resource_id;
73 gfx::Size resource_size; 75 gfx::Size resource_size;
74 unsigned resource_format; 76 unsigned resource_format;
(...skipping 20 matching lines...) Expand all
95 unsigned resource_id; 97 unsigned resource_id;
96 gfx::Size resource_size; 98 gfx::Size resource_size;
97 unsigned resource_format; 99 unsigned resource_format;
98 gpu::Mailbox mailbox; 100 gpu::Mailbox mailbox;
99 }; 101 };
100 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater, 102 static void RecycleResource(base::WeakPtr<VideoResourceUpdater> updater,
101 RecycleResourceData data, 103 RecycleResourceData data,
102 unsigned sync_point, 104 unsigned sync_point,
103 bool lost_resource); 105 bool lost_resource);
104 106
107 ContextProvider* context_provider_;
105 ResourceProvider* resource_provider_; 108 ResourceProvider* resource_provider_;
106 scoped_ptr<media::SkCanvasVideoRenderer> video_renderer_; 109 scoped_ptr<media::SkCanvasVideoRenderer> video_renderer_;
107 110
108 std::vector<unsigned> all_resources_; 111 std::vector<unsigned> all_resources_;
109 std::vector<PlaneResource> recycled_resources_; 112 std::vector<PlaneResource> recycled_resources_;
110 113
111 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); 114 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater);
112 }; 115 };
113 116
114 } // namespace cc 117 } // namespace cc
115 118
116 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ 119 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_
OLDNEW
« no previous file with comments | « cc/resources/tile_manager_unittest.cc ('k') | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698