#include "base/compiler_specific.h"
#include "base/time/time.h"
-#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/size.h"
+#include "ui/gfx/vsync_provider.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_surface.h"
-#include "ui/gl/vsync_provider.h"
namespace gfx {
+// Get default EGL display for GLSurfaceEGL (differs by platform).
+EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay();
+
// Interface for EGL surface.
class GL_EXPORT GLSurfaceEGL : public GLSurface {
public:
static const char* GetEGLExtensions();
static bool HasEGLExtension(const char* name);
static bool IsCreateContextRobustnessSupported();
+ static bool IsEGLSurfacelessContextSupported();
protected:
virtual ~GLSurfaceEGL();
// Encapsulates an EGL surface bound to a view.
class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL {
public:
- explicit NativeViewGLSurfaceEGL(gfx::AcceleratedWidget window);
+ explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window);
// Implement GLSurface.
virtual EGLConfig GetConfig() OVERRIDE;
virtual bool SwapBuffers() OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE;
virtual EGLSurface GetHandle() OVERRIDE;
- virtual std::string GetExtensions() OVERRIDE;
+ virtual bool SupportsPostSubBuffer() OVERRIDE;
virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
virtual VSyncProvider* GetVSyncProvider() OVERRIDE;
// Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider.
// Takes ownership of the VSyncProvider.
- virtual bool Initialize(VSyncProvider* sync_provider);
+ virtual bool Initialize(scoped_ptr<VSyncProvider> sync_provider);
protected:
virtual ~NativeViewGLSurfaceEGL();
- void SetHandle(EGLSurface surface);
+
+ EGLNativeWindowType window_;
private:
- gfx::AcceleratedWidget window_;
EGLSurface surface_;
bool supports_post_sub_buffer_;
EGLConfig config_;
+ gfx::Size size_;
scoped_ptr<VSyncProvider> vsync_provider_;