Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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>
14
16
17class WindowSurface;
18
20
27
37
39public:
41
42 void postMessage(const Message& message) const;
43 void readMessage(Message* message) const;
44 void release();
45private:
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
MessageType
@ kRenderPicture
@ kInitialize
@ kDestroy
@ kUndefined
void postMessage(const Message &message) const
void readMessage(Message *message) const
Win32Message message
Message(MessageType t)
SkPicture * fPicture
ANativeWindow * fNativeWindow
MessageType fType
WindowSurface ** fWindowSurface
struct ANativeWindow ANativeWindow