Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
compositor_opengl.h
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#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_COMPOSITOR_OPENGL_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_COMPOSITOR_OPENGL_H_
7
8#include <memory>
9
10#include "flutter/fml/macros.h"
11#include "flutter/impeller/renderer/backend/gles/proc_table_gles.h"
12#include "flutter/shell/platform/embedder/embedder.h"
13#include "flutter/shell/platform/windows/compositor.h"
14#include "flutter/shell/platform/windows/flutter_windows_engine.h"
15
16namespace flutter {
17
18// Enables the Flutter engine to render content on Windows using OpenGL.
20 public:
23
24 /// |Compositor|
26 FlutterBackingStore* result) override;
27
28 /// |Compositor|
29 bool CollectBackingStore(const FlutterBackingStore* store) override;
30
31 /// |Compositor|
32 bool Present(FlutterWindowsView* view,
33 const FlutterLayer** layers,
34 size_t layers_count) override;
35
36 private:
37 // The Flutter engine that manages the views to render.
38 FlutterWindowsEngine* engine_;
39
40 private:
41 // The compositor initializes itself lazily once |CreateBackingStore| is
42 // called. True if initialization completed successfully.
43 bool is_initialized_ = false;
44
45 // Function used to resolve GLES functions.
46 impeller::ProcTableGLES::Resolver resolver_ = nullptr;
47
48 // Table of resolved GLES functions. Null until the compositor is initialized.
49 std::unique_ptr<impeller::ProcTableGLES> gl_ = nullptr;
50
51 // The OpenGL texture target format for backing stores. Invalid value until
52 // the compositor is initialized.
53 uint32_t format_ = 0;
54
55 // Initialize the compositor. This must run on the raster thread.
56 bool Initialize();
57
58 // Clear the view's surface and removes any previously presented layers.
59 bool Clear(FlutterWindowsView* view);
60
62};
63
64} // namespace flutter
65
66#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_COMPOSITOR_OPENGL_H_
SI void store(P *ptr, const T &val)
bool Present(FlutterWindowsView *view, const FlutterLayer **layers, size_t layers_count) override
|Compositor|
bool CreateBackingStore(const FlutterBackingStoreConfig &config, FlutterBackingStore *result) override
|Compositor|
bool CollectBackingStore(const FlutterBackingStore *store) override
|Compositor|
std::function< void *(const char *function_name)> Resolver
FlutterEngine engine
Definition main.cc:68
GAsyncResult * result
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27