Flutter Engine
The 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
5#include "flutter/shell/platform/windows/egl/window_surface.h"
6
7#include "flutter/fml/logging.h"
8#include "flutter/shell/platform/windows/egl/egl.h"
9
10namespace flutter {
11namespace egl {
12
14 EGLContext context,
15 EGLSurface surface,
16 size_t width,
17 size_t height)
18 : Surface(display, context, surface), width_(width), height_(height) {}
19
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
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
virtual bool vsync_enabled() const
virtual size_t height() const
virtual size_t width() const
virtual bool SetVSyncEnabled(bool enabled)
WindowSurface(EGLDisplay display, EGLContext context, EGLSurface surface, size_t width, size_t height)
VkSurfaceKHR surface
Definition main.cc:49
#define FML_DCHECK(condition)
Definition logging.h:103
int32_t height
int32_t width
#define WINDOWS_LOG_EGL_ERROR
Definition egl.h:19