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 CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_IMPL_H_ |
7 | 7 |
8 #include "content/renderer/media/android/stream_texture_factory_android.h" | 8 #include "content/renderer/media/android/stream_texture_factory_android.h" |
9 | 9 |
10 namespace blink { | 10 namespace cc { |
11 class WebGraphicsContext3D; | 11 class ContextProvider; |
12 } | 12 } |
13 | 13 |
| 14 namespace gpu { |
| 15 namespace gles2 { |
| 16 class GLES2Interface; |
| 17 } // namespace gles2 |
| 18 } // namespace gpu |
| 19 |
| 20 |
14 namespace content { | 21 namespace content { |
15 | 22 |
16 class GpuChannelHost; | 23 class GpuChannelHost; |
17 | 24 |
18 class StreamTextureFactoryImpl : public StreamTextureFactory { | 25 class StreamTextureFactoryImpl : public StreamTextureFactory { |
19 public: | 26 public: |
20 StreamTextureFactoryImpl(blink::WebGraphicsContext3D* context, | 27 StreamTextureFactoryImpl( |
21 GpuChannelHost* channel, | 28 const scoped_refptr<cc::ContextProvider>& context_provider, |
22 int view_id); | 29 GpuChannelHost* channel, |
| 30 int view_id); |
23 virtual ~StreamTextureFactoryImpl(); | 31 virtual ~StreamTextureFactoryImpl(); |
24 | 32 |
25 // StreamTextureFactory implementation. | 33 // StreamTextureFactory implementation. |
26 virtual StreamTextureProxy* CreateProxy() OVERRIDE; | 34 virtual StreamTextureProxy* CreateProxy() OVERRIDE; |
27 virtual void EstablishPeer(int32 stream_id, int player_id) OVERRIDE; | 35 virtual void EstablishPeer(int32 stream_id, int player_id) OVERRIDE; |
28 virtual unsigned CreateStreamTexture( | 36 virtual unsigned CreateStreamTexture( |
29 unsigned texture_target, | 37 unsigned texture_target, |
30 unsigned* texture_id, | 38 unsigned* texture_id, |
31 gpu::Mailbox* texture_mailbox, | 39 gpu::Mailbox* texture_mailbox, |
32 unsigned* texture_mailbox_sync_point) OVERRIDE; | 40 unsigned* texture_mailbox_sync_point) OVERRIDE; |
33 virtual void DestroyStreamTexture(unsigned texture_id) OVERRIDE; | 41 virtual void DestroyStreamTexture(unsigned texture_id) OVERRIDE; |
34 virtual void SetStreamTextureSize(int32 texture_id, | 42 virtual void SetStreamTextureSize(int32 texture_id, |
35 const gfx::Size& size) OVERRIDE; | 43 const gfx::Size& size) OVERRIDE; |
36 virtual blink::WebGraphicsContext3D* Context3d() OVERRIDE; | 44 virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE; |
37 | 45 |
38 private: | 46 private: |
39 blink::WebGraphicsContext3D* context_; | 47 scoped_refptr<cc::ContextProvider> context_provider_; |
40 scoped_refptr<GpuChannelHost> channel_; | 48 scoped_refptr<GpuChannelHost> channel_; |
41 int view_id_; | 49 int view_id_; |
42 | 50 |
43 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactoryImpl); | 51 DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureFactoryImpl); |
44 }; | 52 }; |
45 | 53 |
46 } // namespace content | 54 } // namespace content |
47 | 55 |
48 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_IMPL_H_ | 56 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_IMPL_H_ |
OLD | NEW |