1 // Copyright 2014 Intel Corporation. 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 #include "ozone/wayland/egl/surface_ozone_wayland.h"
7 #include "ozone/ui/gfx/vsync_provider_wayland.h"
8 #include "ozone/wayland/display.h"
9 #include "ozone/wayland/window.h"
11 namespace ozonewayland {
13 SurfaceOzoneWayland::SurfaceOzoneWayland(unsigned handle)
17 SurfaceOzoneWayland::~SurfaceOzoneWayland() {
18 WaylandDisplay::GetInstance()->DestroyWindow(handle_);
19 WaylandDisplay::GetInstance()->FlushDisplay();
22 intptr_t SurfaceOzoneWayland::GetNativeWindow() {
23 return WaylandDisplay::GetInstance()->GetNativeWindow(handle_);
26 bool SurfaceOzoneWayland::ResizeNativeWindow(
27 const gfx::Size& viewport_size) {
28 WaylandWindow* window = WaylandDisplay::GetInstance()->GetWindow(handle_);
30 window->Resize(viewport_size.width(), viewport_size.height());
34 bool SurfaceOzoneWayland::OnSwapBuffers() {
38 scoped_ptr<gfx::VSyncProvider> SurfaceOzoneWayland::CreateVSyncProvider() {
39 return scoped_ptr<gfx::VSyncProvider>(new gfx::WaylandSyncProvider());
42 } // namespace ozonewayland