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_
10 #include "cc/base/cc_export.h"
11 #include "cc/layers/layer_impl.h"
12 #include "cc/resources/video_resource_updater.h"
19 class VideoFrameProvider
;
20 class VideoFrameProviderClientImpl
;
22 class CC_EXPORT VideoLayerImpl
: public LayerImpl
{
24 static scoped_ptr
<VideoLayerImpl
> Create(LayerTreeImpl
* tree_impl
,
26 VideoFrameProvider
* provider
);
27 virtual ~VideoLayerImpl();
29 // LayerImpl implementation.
30 virtual scoped_ptr
<LayerImpl
> CreateLayerImpl(LayerTreeImpl
* tree_impl
)
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
);
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
);
69 #endif // CC_LAYERS_VIDEO_LAYER_IMPL_H_