| Index: ui/gl/gl_surface_ozone.cc
|
| diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc
|
| index 67ab131b7a8c261905ca7fe5bc0a5aef855e2adb..eecd06413876bdbceb9b0d7a50c26c5f40eb6559 100644
|
| --- a/ui/gl/gl_surface_ozone.cc
|
| +++ b/ui/gl/gl_surface_ozone.cc
|
| @@ -30,10 +30,10 @@ class GL_EXPORT GLSurfaceOzoneEGL : public NativeViewGLSurfaceEGL {
|
| ozone_surface_(ozone_surface.Pass()),
|
| widget_(widget) {}
|
|
|
| - virtual bool Initialize() override {
|
| + bool Initialize() override {
|
| return Initialize(ozone_surface_->CreateVSyncProvider());
|
| }
|
| - virtual bool Resize(const gfx::Size& size) override {
|
| + bool Resize(const gfx::Size& size) override {
|
| if (!ozone_surface_->ResizeNativeWindow(size)) {
|
| if (!ReinitializeNativeSurface() ||
|
| !ozone_surface_->ResizeNativeWindow(size))
|
| @@ -42,17 +42,17 @@ class GL_EXPORT GLSurfaceOzoneEGL : public NativeViewGLSurfaceEGL {
|
|
|
| return NativeViewGLSurfaceEGL::Resize(size);
|
| }
|
| - virtual bool SwapBuffers() override {
|
| + bool SwapBuffers() override {
|
| if (!NativeViewGLSurfaceEGL::SwapBuffers())
|
| return false;
|
|
|
| return ozone_surface_->OnSwapBuffers();
|
| }
|
| - virtual bool ScheduleOverlayPlane(int z_order,
|
| - OverlayTransform transform,
|
| - GLImage* image,
|
| - const Rect& bounds_rect,
|
| - const RectF& crop_rect) override {
|
| + bool ScheduleOverlayPlane(int z_order,
|
| + OverlayTransform transform,
|
| + GLImage* image,
|
| + const Rect& bounds_rect,
|
| + const RectF& crop_rect) override {
|
| return image->ScheduleOverlayPlane(
|
| widget_, z_order, transform, bounds_rect, crop_rect);
|
| }
|
| @@ -60,7 +60,7 @@ class GL_EXPORT GLSurfaceOzoneEGL : public NativeViewGLSurfaceEGL {
|
| private:
|
| using NativeViewGLSurfaceEGL::Initialize;
|
|
|
| - virtual ~GLSurfaceOzoneEGL() {
|
| + ~GLSurfaceOzoneEGL() override {
|
| Destroy(); // EGL surface must be destroyed before SurfaceOzone
|
| }
|
|
|
| @@ -107,7 +107,7 @@ class GL_EXPORT GLSurfaceOzoneSurfaceless : public SurfacelessEGL {
|
| ozone_surface_(ozone_surface.Pass()),
|
| widget_(widget) {}
|
|
|
| - virtual bool Initialize() override {
|
| + bool Initialize() override {
|
| if (!SurfacelessEGL::Initialize())
|
| return false;
|
| vsync_provider_ = ozone_surface_->CreateVSyncProvider();
|
| @@ -115,38 +115,48 @@ class GL_EXPORT GLSurfaceOzoneSurfaceless : public SurfacelessEGL {
|
| return false;
|
| return true;
|
| }
|
| - virtual bool Resize(const gfx::Size& size) override {
|
| + bool Resize(const gfx::Size& size) override {
|
| if (!ozone_surface_->ResizeNativeWindow(size))
|
| return false;
|
|
|
| return SurfacelessEGL::Resize(size);
|
| }
|
| - virtual bool SwapBuffers() override {
|
| + bool SwapBuffers() override {
|
| // TODO: this should be replaced by a fence when supported by the driver.
|
| glFlush();
|
| return ozone_surface_->OnSwapBuffers();
|
| }
|
| - virtual bool ScheduleOverlayPlane(int z_order,
|
| - OverlayTransform transform,
|
| - GLImage* image,
|
| - const Rect& bounds_rect,
|
| - const RectF& crop_rect) override {
|
| + bool ScheduleOverlayPlane(int z_order,
|
| + OverlayTransform transform,
|
| + GLImage* image,
|
| + const Rect& bounds_rect,
|
| + const RectF& crop_rect) override {
|
| return image->ScheduleOverlayPlane(
|
| widget_, z_order, transform, bounds_rect, crop_rect);
|
| }
|
| - virtual bool IsOffscreen() override { return false; }
|
| - virtual VSyncProvider* GetVSyncProvider() override {
|
| - return vsync_provider_.get();
|
| - }
|
| - virtual bool SupportsPostSubBuffer() override { return true; }
|
| - virtual bool PostSubBuffer(int x, int y, int width, int height) override {
|
| + bool IsOffscreen() override { return false; }
|
| + VSyncProvider* GetVSyncProvider() override { return vsync_provider_.get(); }
|
| + bool SupportsPostSubBuffer() override { return true; }
|
| + bool PostSubBuffer(int x, int y, int width, int height) override {
|
| // The actual sub buffer handling is handled at higher layers.
|
| SwapBuffers();
|
| return true;
|
| }
|
| + bool SwapBuffersAsync(const SwapCompletionCallback& callback) override {
|
| + // TODO: this should be replaced by a fence when supported by the driver.
|
| + glFlush();
|
| + return ozone_surface_->OnSwapBuffersAsync(callback);
|
| + }
|
| + bool PostSubBufferAsync(int x,
|
| + int y,
|
| + int width,
|
| + int height,
|
| + const SwapCompletionCallback& callback) override {
|
| + return SwapBuffersAsync(callback);
|
| + }
|
|
|
| private:
|
| - virtual ~GLSurfaceOzoneSurfaceless() {
|
| + ~GLSurfaceOzoneSurfaceless() override {
|
| Destroy(); // EGL surface must be destroyed before SurfaceOzone
|
| }
|
|
|
|
|