Lots of random cleanups, mostly for native_theme_win.cc:
[chromium-blink-merge.git] / cc / layers / video_layer_impl.h
blobdd09589b5d72e6fa8f5d1e098e2a916f85aa8af8
1 // Copyright 2012 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.
5 #ifndef CC_LAYERS_VIDEO_LAYER_IMPL_H_
6 #define CC_LAYERS_VIDEO_LAYER_IMPL_H_
8 #include <vector>
10 #include "cc/base/cc_export.h"
11 #include "cc/layers/layer_impl.h"
12 #include "cc/resources/release_callback.h"
13 #include "cc/resources/video_resource_updater.h"
15 namespace media {
16 class VideoFrame;
19 namespace cc {
20 class VideoFrameProvider;
21 class VideoFrameProviderClientImpl;
23 class CC_EXPORT VideoLayerImpl : public LayerImpl {
24 public:
25 static scoped_ptr<VideoLayerImpl> Create(LayerTreeImpl* tree_impl,
26 int id,
27 VideoFrameProvider* provider);
28 virtual ~VideoLayerImpl();
30 // LayerImpl implementation.
31 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
32 OVERRIDE;
33 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
34 virtual bool WillDraw(DrawMode draw_mode,
35 ResourceProvider* resource_provider) OVERRIDE;
36 virtual void AppendQuads(RenderPass* render_pass,
37 const OcclusionTracker<LayerImpl>& occlusion_tracker,
38 AppendQuadsData* append_quads_data) OVERRIDE;
39 virtual void DidDraw(ResourceProvider* resource_provider) OVERRIDE;
40 virtual void DidBecomeActive() OVERRIDE;
41 virtual void ReleaseResources() OVERRIDE;
43 void SetNeedsRedraw();
45 void SetProviderClientImpl(
46 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl);
48 private:
49 VideoLayerImpl(LayerTreeImpl* tree_impl, int id);
51 virtual const char* LayerTypeAsString() const OVERRIDE;
53 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl_;
55 scoped_refptr<media::VideoFrame> frame_;
57 scoped_ptr<VideoResourceUpdater> updater_;
58 VideoFrameExternalResources::ResourceType frame_resource_type_;
59 std::vector<ResourceProvider::ResourceId> frame_resources_;
61 // TODO(danakj): Remove these, hide software path inside ResourceProvider and
62 // ExternalResource (aka TextureMailbox) classes.
63 std::vector<unsigned> software_resources_;
64 // Called once for each software resource.
65 ReleaseCallback software_release_callback_;
67 DISALLOW_COPY_AND_ASSIGN(VideoLayerImpl);
70 } // namespace cc
72 #endif // CC_LAYERS_VIDEO_LAYER_IMPL_H_