Home | History | Annotate | Download | only in renderer_host
      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 blink {
     16 class WebGraphicsContext3D;
     17 }
     18 
     19 namespace content {
     20 class GLHelper;
     21 class GLContextLostListener;
     22 
     23 class ImageTransportFactoryAndroidObserver {
     24  public:
     25   virtual ~ImageTransportFactoryAndroidObserver() {}
     26   virtual void OnLostResources() = 0;
     27 };
     28 
     29 class ImageTransportFactoryAndroid {
     30  public:
     31   virtual ~ImageTransportFactoryAndroid();
     32 
     33   static ImageTransportFactoryAndroid* GetInstance();
     34 
     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;
     41 
     42   virtual blink::WebGraphicsContext3D* GetContext3D() = 0;
     43   virtual GLHelper* GetGLHelper() = 0;
     44   virtual uint32 GetChannelID() = 0;
     45 
     46   static void AddObserver(ImageTransportFactoryAndroidObserver* observer);
     47   static void RemoveObserver(ImageTransportFactoryAndroidObserver* observer);
     48 
     49 protected:
     50   ImageTransportFactoryAndroid();
     51 
     52   scoped_ptr<GLContextLostListener> context_lost_listener_;
     53 };
     54 
     55 }  // namespace content
     56 
     57 #endif  // CONTENT_BROWSER_RENDERER_HOST_IMAGE_TRANSPORT_FACTORY_ANDROID_H_
     58