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 UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_
6 #define UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/gfx/overlay_transform.h"
11 #include "ui/ozone/ozone_base_export.h"
21 // The platform-specific part of an EGL surface.
23 // This class owns any bits that the ozone implementation needs freed when
24 // the EGL surface is destroyed.
25 class OZONE_BASE_EXPORT SurfaceOzoneEGL
{
27 virtual ~SurfaceOzoneEGL() {}
29 // Returns the EGL native window for rendering onto this surface.
30 // This can be used to to create a GLSurface.
31 virtual intptr_t /* EGLNativeWindowType */ GetNativeWindow() = 0;
33 // Attempts to resize the EGL native window to match the viewport
35 virtual bool ResizeNativeWindow(const gfx::Size
& viewport_size
) = 0;
37 // Called after we swap buffers. This is usually a no-op but can
38 // be used to present the new front buffer if the platform requires this.
39 virtual bool OnSwapBuffers() = 0;
41 // Returns a gfx::VsyncProvider for this surface. Note that this may be
42 // called after we have entered the sandbox so if there are operations (e.g.
43 // opening a file descriptor providing vsync events) that must be done
44 // outside of the sandbox, they must have been completed in
45 // InitializeHardware. Returns an empty scoped_ptr on error.
46 virtual scoped_ptr
<gfx::VSyncProvider
> CreateVSyncProvider() = 0;
51 #endif // UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_