1 // Copyright 2014 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 CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_
6 #define CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_
8 #include "content/common/android/surface_texture_manager.h"
10 #include "base/memory/singleton.h"
11 #include "content/common/android/surface_texture_peer.h"
12 #include "content/common/content_export.h"
16 class CONTENT_EXPORT BrowserSurfaceTextureManager
17 : public SurfaceTextureManager
,
18 public SurfaceTexturePeer
{
20 static BrowserSurfaceTextureManager
* GetInstance();
22 // Overridden from SurfaceTextureManager:
23 void RegisterSurfaceTexture(int surface_texture_id
,
25 gfx::SurfaceTexture
* surface_texture
) override
;
26 void UnregisterSurfaceTexture(int surface_texture_id
, int client_id
) override
;
27 gfx::AcceleratedWidget
AcquireNativeWidgetForSurfaceTexture(
28 int surface_texture_id
) override
;
30 // Overridden from SurfaceTexturePeer:
31 void EstablishSurfaceTexturePeer(
32 base::ProcessHandle render_process_handle
,
33 scoped_refptr
<gfx::SurfaceTexture
> surface_texture
,
35 int player_id
) override
;
38 friend struct DefaultSingletonTraits
<BrowserSurfaceTextureManager
>;
40 BrowserSurfaceTextureManager();
41 ~BrowserSurfaceTextureManager() override
;
43 DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceTextureManager
);
46 } // namespace content
48 #endif // CONTENT_BROWSER_ANDROID_BROWSER_SURFACE_TEXTURE_MANAGER_H_