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

Side by Side Diff: content/renderer/media/android/stream_texture_factory_android_synchronous_impl.h

Issue 23234003: Support stream textures with the synchronous compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_SYNCHRONOU S_IMPL_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_SYNCHRONOU S_IMPL_H_
6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_SYNCHRONOU S_IMPL_H_ 6 #define CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_SYNCHRONOU S_IMPL_H_
7 7
8 #include "base/memory/ref_counted.h"
8 #include "content/renderer/media/android/stream_texture_factory_android.h" 9 #include "content/renderer/media/android/stream_texture_factory_android.h"
9 10
11 namespace gfx {
12 class SurfaceTextureBridge;
13 }
14
15 namespace WebKit {
16 class WebGraphicsContext3D;
17 }
18
10 namespace content { 19 namespace content {
11 20
12 // Factory for when using synchronous compositor in Android WebView. 21 // Factory for when using synchronous compositor in Android WebView.
13 class StreamTextureFactorySynchronousImpl : public StreamTextureFactory { 22 class StreamTextureFactorySynchronousImpl : public StreamTextureFactory {
14 public: 23 public:
15 StreamTextureFactorySynchronousImpl(); 24 class ContextProvider : public base::RefCounted<ContextProvider> {
25 public:
26 virtual scoped_refptr<gfx::SurfaceTextureBridge> GetSurfaceTexture(
27 uint32 stream_id) = 0;
28
29 virtual WebKit::WebGraphicsContext3D* Context3d() = 0;
30
31 protected:
32 friend class base::RefCounted<ContextProvider>;
33 virtual ~ContextProvider() {}
34 };
35
36 StreamTextureFactorySynchronousImpl(ContextProvider* context_provider,
37 int view_id);
16 virtual ~StreamTextureFactorySynchronousImpl(); 38 virtual ~StreamTextureFactorySynchronousImpl();
17 39
18 virtual StreamTextureProxy* CreateProxy() OVERRIDE; 40 virtual StreamTextureProxy* CreateProxy() OVERRIDE;
19 virtual void EstablishPeer(int32 stream_id, int player_id) OVERRIDE; 41 virtual void EstablishPeer(int32 stream_id, int player_id) OVERRIDE;
20 virtual unsigned CreateStreamTexture( 42 virtual unsigned CreateStreamTexture(
21 unsigned texture_target, 43 unsigned texture_target,
22 unsigned* texture_id, 44 unsigned* texture_id,
23 gpu::Mailbox* texture_mailbox, 45 gpu::Mailbox* texture_mailbox,
24 unsigned* texture_mailbox_sync_point) OVERRIDE; 46 unsigned* texture_mailbox_sync_point) OVERRIDE;
25 virtual void DestroyStreamTexture(unsigned texture_id) OVERRIDE; 47 virtual void DestroyStreamTexture(unsigned texture_id) OVERRIDE;
26 virtual void SetStreamTextureSize(int32 texture_id, 48 virtual void SetStreamTextureSize(int32 stream_id,
27 const gfx::Size& size) OVERRIDE; 49 const gfx::Size& size) OVERRIDE;
28 50
29 private: 51 private:
52 scoped_refptr<ContextProvider> context_provider_;
53 int view_id_;
54
30 DISALLOW_COPY_AND_ASSIGN(StreamTextureFactorySynchronousImpl); 55 DISALLOW_COPY_AND_ASSIGN(StreamTextureFactorySynchronousImpl);
31 }; 56 };
32 57
33 } // namespace content 58 } // namespace content
34 59
35 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_SYNCHRO NOUS_IMPL_H_ 60 #endif // CONTENT_RENDERER_MEDIA_ANDROID_STREAM_TEXTURE_FACTORY_ANDROID_SYNCHRO NOUS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698