1 // Copyright (c) 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 CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/native_widget_types.h"
16 class WebGraphicsContext3D
;
21 class GLContextLostListener
;
23 class ImageTransportFactoryAndroidObserver
{
25 virtual ~ImageTransportFactoryAndroidObserver() {}
26 virtual void OnLostResources() = 0;
29 class ImageTransportFactoryAndroid
{
31 virtual ~ImageTransportFactoryAndroid();
33 static ImageTransportFactoryAndroid
* GetInstance();
35 virtual uint32_t InsertSyncPoint() = 0;
36 virtual void WaitSyncPoint(uint32_t sync_point
) = 0;
37 virtual uint32_t CreateTexture() = 0;
38 virtual void DeleteTexture(uint32_t id
) = 0;
39 virtual void AcquireTexture(
40 uint32 texture_id
, const signed char* mailbox_name
) = 0;
42 virtual blink::WebGraphicsContext3D
* GetContext3D() = 0;
43 virtual GLHelper
* GetGLHelper() = 0;
44 virtual uint32
GetChannelID() = 0;
46 static void AddObserver(ImageTransportFactoryAndroidObserver
* observer
);
47 static void RemoveObserver(ImageTransportFactoryAndroidObserver
* observer
);
50 ImageTransportFactoryAndroid();
52 scoped_ptr
<GLContextLostListener
> context_lost_listener_
;
55 } // namespace content
57 #endif // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_