Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1117)

Unified Diff: ui/ozone/platform/wayland/wayland_egl_surface.h

Issue 1704243003: ozone/platform/wayland: Implement SurfaceOzoneEGL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, fix scoped_ptr NULL check, make use_wayland_egl default to true Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/wayland/wayland.gypi ('k') | ui/ozone/platform/wayland/wayland_egl_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/wayland_egl_surface.h
diff --git a/ui/ozone/platform/wayland/wayland_egl_surface.h b/ui/ozone/platform/wayland/wayland_egl_surface.h
new file mode 100644
index 0000000000000000000000000000000000000000..c36b949a46add89a14f25c4c0628a762b024c38c
--- /dev/null
+++ b/ui/ozone/platform/wayland/wayland_egl_surface.h
@@ -0,0 +1,49 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_EGL_SURFACE_H_
+#define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_EGL_SURFACE_H_
+
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/vsync_provider.h"
+#include "ui/ozone/public/surface_ozone_egl.h"
+
+struct wl_egl_window;
+
+namespace ui {
+
+class WaylandWindow;
+
+struct EGLWindowDeleter {
+ void operator()(wl_egl_window* egl_window);
+};
+
+class WaylandEGLSurface : public SurfaceOzoneEGL {
+ public:
+ WaylandEGLSurface(WaylandWindow* window, const gfx::Size& size);
+ ~WaylandEGLSurface() override;
+
+ bool Initialize();
+
+ // SurfaceOzoneEGL
+ intptr_t GetNativeWindow() override;
+ bool ResizeNativeWindow(const gfx::Size& viewport_size) override;
+ bool OnSwapBuffers() override;
+ void OnSwapBuffersAsync(const SwapCompletionCallback& callback) override;
+ scoped_ptr<gfx::VSyncProvider> CreateVSyncProvider() override;
+ void* /* EGLConfig */ GetEGLSurfaceConfig(
+ const EglConfigCallbacks& egl) override;
+
+ private:
+ WaylandWindow* window_;
+
+ gfx::Size size_;
+ scoped_ptr<wl_egl_window, EGLWindowDeleter> egl_window_;
+
+ DISALLOW_COPY_AND_ASSIGN(WaylandEGLSurface);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_WAYLAND_WAYLAND_EGL_SURFACE_H_
« no previous file with comments | « ui/ozone/platform/wayland/wayland.gypi ('k') | ui/ozone/platform/wayland/wayland_egl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698