Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
lib
web_ui
skwasm
wrappers.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_LIB_WEB_UI_SKWASM_WRAPPERS_H_
6
#define FLUTTER_LIB_WEB_UI_SKWASM_WRAPPERS_H_
7
8
#include <emscripten/html5_webgl.h>
9
#include "
third_party/skia/include/core/SkCanvas.h
"
10
#include "
third_party/skia/include/core/SkSurface.h
"
11
#include "
third_party/skia/modules/skparagraph/include/FontCollection.h
"
12
#include "
third_party/skia/modules/skparagraph/include/TypefaceFontProvider.h
"
13
14
namespace
Skwasm
{
15
16
struct
SurfaceWrapper
{
17
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE
context
;
18
sk_sp<GrDirectContext>
grContext
;
19
sk_sp<SkSurface>
surface
;
20
};
21
22
inline
void
makeCurrent
(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE handle) {
23
if
(!handle)
24
return
;
25
26
int
result
= emscripten_webgl_make_context_current(handle);
27
if
(
result
!= EMSCRIPTEN_RESULT_SUCCESS) {
28
printf(
"make_context failed: %d"
,
result
);
29
}
30
}
31
32
struct
FlutterFontCollection
{
33
sk_sp<skia::textlayout::FontCollection>
collection
;
34
sk_sp<skia::textlayout::TypefaceFontProvider>
provider
;
35
};
36
37
}
// namespace Skwasm
38
39
#endif
// FLUTTER_LIB_WEB_UI_SKWASM_WRAPPERS_H_
FontCollection.h
SkCanvas.h
SkSurface.h
TypefaceFontProvider.h
sk_sp
Definition
SkRefCnt.h:220
result
GAsyncResult * result
Definition
fl_text_input_plugin.cc:106
Skwasm
Definition
helpers.h:12
Skwasm::makeCurrent
void makeCurrent(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE handle)
Definition
wrappers.h:22
Skwasm::FlutterFontCollection
Definition
wrappers.h:32
Skwasm::FlutterFontCollection::provider
sk_sp< skia::textlayout::TypefaceFontProvider > provider
Definition
wrappers.h:34
Skwasm::FlutterFontCollection::collection
sk_sp< skia::textlayout::FontCollection > collection
Definition
wrappers.h:33
Skwasm::SurfaceWrapper
Definition
wrappers.h:16
Skwasm::SurfaceWrapper::grContext
sk_sp< GrDirectContext > grContext
Definition
wrappers.h:18
Skwasm::SurfaceWrapper::surface
sk_sp< SkSurface > surface
Definition
wrappers.h:19
Skwasm::SurfaceWrapper::context
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context
Definition
wrappers.h:17
Generated on Fri Apr 26 2024 06:14:17 for Flutter Engine by
1.9.8