Flutter Engine
The 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
10#include "flutter/fml/macros.h"
11
14
15namespace flutter {
16namespace testing {
17
19 public:
20 explicit TestGLSurface(SkISize surface_size);
21
23
24 const SkISize& GetSurfaceSize() const;
25
26 bool MakeCurrent();
27
28 bool ClearCurrent();
29
30 bool Present();
31
32 uint32_t GetFramebuffer(uint32_t width, uint32_t height) const;
33
35
36 void* GetProcAddress(const char* name) const;
37
39
41
43
45
46 uint32_t GetWindowFBOId() const;
47
48 private:
49 // Importing the EGL.h pulls in platform headers which are problematic
50 // (especially X11 which #defineds types like Bool). Any TUs importing
51 // this header then become susceptible to failures because of platform
52 // specific craziness. Don't expose EGL internals via this header.
53 using EGLDisplay = void*;
54 using EGLContext = void*;
55 using EGLSurface = void*;
56
57 const SkISize surface_size_;
58 EGLDisplay display_;
59 EGLContext onscreen_context_;
60 EGLContext offscreen_context_;
61 EGLSurface onscreen_surface_;
62 EGLSurface offscreen_surface_;
64
66};
67
68} // namespace testing
69} // namespace flutter
70
71#endif // FLUTTER_TESTING_TEST_GL_SURFACE_H_
uint32_t GetFramebuffer(uint32_t width, uint32_t height) const
sk_sp< GrDirectContext > GetGrContext()
void * GetProcAddress(const char *name) const
sk_sp< GrDirectContext > CreateGrContext()
sk_sp< SkImage > GetRasterSurfaceSnapshot()
const SkISize & GetSurfaceSize() const
sk_sp< SkSurface > GetOnscreenSurface()
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
DEF_SWITCHES_START aot vmservice shared library name
Definition switches.h:32
int32_t height
int32_t width