Flutter Engine
The Flutter Engine
third_party
skia
modules
jetski
src
SurfaceThread.h
Go to the documentation of this file.
1
/*
2
* Copyright 2021 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
#ifndef JetSki_SurfaceThread_DEFINED
8
#define JetSki_SurfaceThread_DEFINED
9
10
#include <pthread.h>
11
#include <unistd.h>
12
#include <android/looper.h>
13
#include <
android/native_window.h
>
14
15
#include "
include/core/SkPictureRecorder.h
"
16
17
class
WindowSurface
;
18
19
#include "
modules/jetski/src/Surface.h
"
20
21
enum
MessageType
{
22
kUndefined
,
23
kInitialize
,
24
kDestroy
,
25
kRenderPicture
,
26
};
27
28
struct
Message
{
29
MessageType
fType
=
kUndefined
;
30
ANativeWindow
*
fNativeWindow
=
nullptr
;
31
SkPicture
*
fPicture
=
nullptr
;
32
WindowSurface
**
fWindowSurface
=
nullptr
;
33
34
Message
() {}
35
Message
(
MessageType
t) :
fType
(t) {}
36
};
37
38
class
SurfaceThread
{
39
public
:
40
SurfaceThread
();
41
42
void
postMessage
(
const
Message
&
message
)
const
;
43
void
readMessage
(
Message
*
message
)
const
;
44
void
release
();
45
private
:
46
static
void
* pthread_main(
void
* arg);
47
static
int
message_callback(
int
fd,
int
events,
void
*
data
);
48
// TODO: This has to be static, which is weird now, but fine in a singleton
49
// Switch to singleton design or find other way to break out of thread loop
50
bool
fRunning;
51
52
pthread_t fThread;
53
int
fPipe[2];
// acts as a Message queue, read from [0] write to [1]
54
};
55
56
#endif
VkLayout::kUndefined
@ kUndefined
SkPictureRecorder.h
MessageType
MessageType
Definition:
SurfaceThread.h:21
kRenderPicture
@ kRenderPicture
Definition:
SurfaceThread.h:25
kInitialize
@ kInitialize
Definition:
SurfaceThread.h:23
kDestroy
@ kDestroy
Definition:
SurfaceThread.h:24
kUndefined
@ kUndefined
Definition:
SurfaceThread.h:22
SkPicture
Definition:
SkPicture.h:44
SurfaceThread
Definition:
SurfaceThread.h:38
SurfaceThread::postMessage
void postMessage(const Message &message) const
Definition:
SurfaceThread.cpp:23
SurfaceThread::readMessage
void readMessage(Message *message) const
Definition:
SurfaceThread.cpp:27
SurfaceThread::release
void release()
Definition:
SurfaceThread.cpp:31
SurfaceThread::SurfaceThread
SurfaceThread()
Definition:
SurfaceThread.cpp:17
WindowSurface
Definition:
Surface.h:46
message
Win32Message message
Definition:
keyboard_unittests.cc:139
Surface.h
native_window.h
Message
Definition:
SurfaceThread.h:28
Message::Message
Message(MessageType t)
Definition:
SurfaceThread.h:35
Message::Message
Message()
Definition:
SurfaceThread.h:34
Message::fPicture
SkPicture * fPicture
Definition:
SurfaceThread.h:31
Message::fNativeWindow
ANativeWindow * fNativeWindow
Definition:
SurfaceThread.h:30
Message::fType
MessageType fType
Definition:
SurfaceThread.h:29
Message::fWindowSurface
WindowSurface ** fWindowSurface
Definition:
SurfaceThread.h:32
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
ANativeWindow
struct ANativeWindow ANativeWindow
Definition:
vulkan_native_surface_android.h:12
Generated on Sun Jun 23 2024 21:56:04 for Flutter Engine by
1.9.4