Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
impeller
toolkit
android
native_window.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 "
impeller/toolkit/android/native_window.h
"
6
7
namespace
impeller::android
{
8
9
NativeWindow::NativeWindow
(
ANativeWindow
*
window
) : window_(
window
) {
10
if
(window_.
get
()) {
11
GetProcTable
().ANativeWindow_acquire(window_.
get
());
12
}
13
}
14
15
NativeWindow::~NativeWindow
() =
default
;
16
17
bool
NativeWindow::IsValid
()
const
{
18
return
window_.
is_valid
();
19
}
20
21
ISize
NativeWindow::GetSize
()
const
{
22
if
(!
IsValid
()) {
23
return
{};
24
}
25
const
int32_t
width
= ANativeWindow_getWidth(window_.
get
());
26
const
int32_t
height
= ANativeWindow_getHeight(window_.
get
());
27
return
ISize::MakeWH
(std::max(
width
, 0), std::max(
height
, 0));
28
}
29
30
ANativeWindow
*
NativeWindow::GetHandle
()
const
{
31
return
window_.
get
();
32
}
33
34
}
// namespace impeller::android
fml::UniqueObject::is_valid
bool is_valid() const
Definition
unique_object.h:89
fml::UniqueObject::get
const T & get() const
Definition
unique_object.h:87
impeller::android::NativeWindow::GetSize
ISize GetSize() const
Definition
native_window.cc:21
impeller::android::NativeWindow::IsValid
bool IsValid() const
Definition
native_window.cc:17
impeller::android::NativeWindow::GetHandle
ANativeWindow * GetHandle() const
Definition
native_window.cc:30
impeller::android::NativeWindow::~NativeWindow
~NativeWindow()
impeller::android::NativeWindow::NativeWindow
NativeWindow(ANativeWindow *window)
Definition
native_window.cc:9
window
GLFWwindow * window
Definition
main.cc:45
impeller::android
Definition
choreographer.cc:9
impeller::android::GetProcTable
const ProcTable & GetProcTable()
Definition
proc_table.cc:12
native_window.h
height
int32_t height
Definition
serialization_callbacks.cc:1
width
int32_t width
Definition
serialization_callbacks.cc:0
impeller::TSize< int64_t >
impeller::TSize< int64_t >::MakeWH
static constexpr TSize MakeWH(Type width, Type height)
Definition
size.h:34
ANativeWindow
struct ANativeWindow ANativeWindow
Definition
vulkan_native_surface_android.h:12
Generated on Fri Apr 26 2024 06:14:15 for Flutter Engine by
1.9.8