Separate projection mode from rest of touch HUD
[chromium-blink-merge.git] / cc / layers / video_layer_impl.h
blobb07187115edfa250ba3ab57bf3656f8232f33ea3
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/video_resource_updater.h"
14 namespace media {
15 class VideoFrame;
18 namespace cc {
19 class VideoFrameProvider;
20 class VideoFrameProviderClientImpl;
22 class CC_EXPORT VideoLayerImpl : public LayerImpl {
23 public:
24 static scoped_ptr<VideoLayerImpl> Create(LayerTreeImpl* tree_impl,
25 int id,
26 VideoFrameProvider* provider);
27 virtual ~VideoLayerImpl();
29 // LayerImpl implementation.
30 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
31 OVERRIDE;
32 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
33 virtual bool WillDraw(DrawMode draw_mode,
34 ResourceProvider* resource_provider) OVERRIDE;
35 virtual void AppendQuads(QuadSink* quad_sink,
36 AppendQuadsData* append_quads_data) OVERRIDE;
37 virtual void DidDraw(ResourceProvider* resource_provider) OVERRIDE;
38 virtual void DidBecomeActive() OVERRIDE;
39 virtual void DidLoseOutputSurface() OVERRIDE;
41 void SetNeedsRedraw();
43 void SetProviderClientImpl(
44 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl);
46 private:
47 VideoLayerImpl(LayerTreeImpl* tree_impl, int id);
49 virtual const char* LayerTypeAsString() const OVERRIDE;
51 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl_;
53 scoped_refptr<media::VideoFrame> frame_;
55 scoped_ptr<VideoResourceUpdater> updater_;
56 VideoFrameExternalResources::ResourceType frame_resource_type_;
57 std::vector<ResourceProvider::ResourceId> frame_resources_;
59 // TODO(danakj): Remove these, hide software path inside ResourceProvider and
60 // ExternalResource (aka TextureMailbox) classes.
61 std::vector<unsigned> software_resources_;
62 TextureMailbox::ReleaseCallback software_release_callback_;
64 DISALLOW_COPY_AND_ASSIGN(VideoLayerImpl);
67 } // namespace cc
69 #endif // CC_LAYERS_VIDEO_LAYER_IMPL_H_