Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / browser / renderer_host / image_transport_factory_android.h
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.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/native_widget_types.h"
10
11 namespace gfx {
12 class GLShareGroup;
13 }
14
15 namespace gpu {
16 namespace gles2 {
17 class GLES2Interface;
18 }
19 }
20
21 namespace content {
22 class GLHelper;
23 class GLContextLostListener;
24
25 class ImageTransportFactoryAndroidObserver {
26  public:
27   virtual ~ImageTransportFactoryAndroidObserver() {}
28   virtual void OnLostResources() = 0;
29 };
30
31 class ImageTransportFactoryAndroid {
32  public:
33   virtual ~ImageTransportFactoryAndroid();
34
35   static ImageTransportFactoryAndroid* GetInstance();
36
37   virtual GLHelper* GetGLHelper() = 0;
38   virtual uint32 GetChannelID() = 0;
39
40   static void AddObserver(ImageTransportFactoryAndroidObserver* observer);
41   static void RemoveObserver(ImageTransportFactoryAndroidObserver* observer);
42
43 protected:
44   ImageTransportFactoryAndroid();
45
46   scoped_ptr<GLContextLostListener> context_lost_listener_;
47 };
48
49 }  // namespace content
50
51 #endif  // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_