Flutter Engine
 
Loading...
Searching...
No Matches
test_gl_surface.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_TESTING_TEST_GL_SURFACE_H_
6#define FLUTTER_TESTING_TEST_GL_SURFACE_H_
7
8#include <cstdint>
9
11#include "flutter/fml/macros.h"
13#include "third_party/skia/include/core/SkSurface.h"
14#include "third_party/skia/include/gpu/ganesh/GrDirectContext.h"
15
16namespace flutter::testing {
17
19 public:
20 explicit TestGLOnscreenOnlySurface(DlISize surface_size);
21
22 explicit TestGLOnscreenOnlySurface(std::shared_ptr<TestEGLContext> context,
24
26
27 const DlISize& GetSurfaceSize() const;
28
29 bool MakeCurrent();
30
31 bool ClearCurrent();
32
33 bool Present();
34
35 uint32_t GetFramebuffer(uint32_t width, uint32_t height) const;
36
37 void* GetProcAddress(const char* name) const;
38
39 sk_sp<SkSurface> GetOnscreenSurface();
40
41 sk_sp<GrDirectContext> GetGrContext();
42
43 sk_sp<GrDirectContext> CreateGrContext();
44
45 sk_sp<SkImage> GetRasterSurfaceSnapshot();
46
47 uint32_t GetWindowFBOId() const;
48
49 protected:
50 using EGLSurface = void*;
51
53 std::shared_ptr<TestEGLContext> egl_context_;
55
56 sk_sp<GrDirectContext> skia_context_;
57
59};
60
62 public:
63 explicit TestGLSurface(DlISize surface_size);
64
65 explicit TestGLSurface(std::shared_ptr<TestEGLContext> egl_context,
66 DlISize surface_size);
67
69
71
72 private:
73 using EGLSurface = void*;
74
75 EGLSurface offscreen_surface_;
76
78};
79
80} // namespace flutter::testing
81
82#endif // FLUTTER_TESTING_TEST_GL_SURFACE_H_
void * GetProcAddress(const char *name) const
std::shared_ptr< TestEGLContext > egl_context_
TestGLOnscreenOnlySurface(DlISize surface_size)
FML_DISALLOW_COPY_AND_ASSIGN(TestGLOnscreenOnlySurface)
uint32_t GetFramebuffer(uint32_t width, uint32_t height) const
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
DEF_SWITCHES_START aot vmservice shared library name
Definition switch_defs.h:27
int32_t height
int32_t width