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
10
namespace
flutter
{
11
namespace
egl {
12
13
WindowSurface::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
20
bool
WindowSurface::SetVSyncEnabled(
bool
enabled) {
21
FML_DCHECK
(
IsCurrent
());
22
23
if
(::eglSwapInterval(
display_
, enabled ? 1 : 0) != EGL_TRUE) {
24
WINDOWS_LOG_EGL_ERROR
;
25
return
false
;
26
}
27
28
vsync_enabled_ = enabled;
29
return
true
;
30
}
31
32
size_t
WindowSurface::width()
const
{
33
return
width_;
34
}
35
36
size_t
WindowSurface::height()
const
{
37
return
height_;
38
}
39
40
bool
WindowSurface::vsync_enabled()
const
{
41
return
vsync_enabled_;
42
}
43
44
}
// namespace egl
45
}
// namespace flutter
flutter::egl::Surface
Definition
surface.h:18
flutter::egl::Surface::display_
EGLDisplay display_
Definition
surface.h:50
flutter::egl::Surface::IsCurrent
virtual bool IsCurrent() const
Definition
surface.cc:43
surface
VkSurfaceKHR surface
Definition
main.cc:65
logging.h
FML_DCHECK
#define FML_DCHECK(condition)
Definition
logging.h:122
flutter
Definition
asset_manager.cc:10
height
int32_t height
Definition
serialization_callbacks.cc:1
width
int32_t width
Definition
serialization_callbacks.cc:0
egl.h
WINDOWS_LOG_EGL_ERROR
#define WINDOWS_LOG_EGL_ERROR
Definition
egl.h:19
window_surface.h
shell
platform
windows
egl
window_surface.cc
Generated on Thu Nov 6 2025 16:11:28 for Flutter Engine by
1.9.8