Flutter Engine
 
Loading...
Searching...
No Matches
window_surface.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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.
4
6
9
10namespace flutter {
11namespace egl {
12
13WindowSurface::WindowSurface(EGLDisplay display,
14 EGLContext context,
15 EGLSurface surface,
16 size_t width,
17 size_t height)
18 : Surface(display, context, surface), width_(width), height_(height) {}
19
20bool WindowSurface::SetVSyncEnabled(bool enabled) {
22
23 if (::eglSwapInterval(display_, enabled ? 1 : 0) != EGL_TRUE) {
25 return false;
26 }
27
28 vsync_enabled_ = enabled;
29 return true;
30}
31
32size_t WindowSurface::width() const {
33 return width_;
34}
35
36size_t WindowSurface::height() const {
37 return height_;
38}
39
40bool WindowSurface::vsync_enabled() const {
41 return vsync_enabled_;
42}
43
44} // namespace egl
45} // namespace flutter
EGLDisplay display_
Definition surface.h:50
virtual bool IsCurrent() const
Definition surface.cc:43
VkSurfaceKHR surface
Definition main.cc:65
#define FML_DCHECK(condition)
Definition logging.h:122
int32_t height
int32_t width
#define WINDOWS_LOG_EGL_ERROR
Definition egl.h:19