Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
android_surface_mock.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_ANDROID_SURFACE_ANDROID_SURFACE_MOCK_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_SURFACE_ANDROID_SURFACE_MOCK_H_
7
8#include "flutter/shell/gpu/gpu_surface_gl_skia.h"
9#include "flutter/shell/platform/android/surface/android_surface.h"
10#include "gmock/gmock.h"
11
12namespace flutter {
13
14//------------------------------------------------------------------------------
15/// Mock for |AndroidSurface|. This implementation can be used in unit
16/// tests without requiring the Android toolchain.
17///
19 public AndroidSurface {
20 public:
21 MOCK_METHOD(bool, IsValid, (), (const, override));
22
23 MOCK_METHOD(void, TeardownOnScreenContext, (), (override));
24
25 MOCK_METHOD(std::unique_ptr<Surface>,
27 (GrDirectContext * gr_context),
28 (override));
29
30 MOCK_METHOD(bool, OnScreenSurfaceResize, (const SkISize& size), (override));
31
33
35
39 (override));
40
41 // |GPUSurfaceGLDelegate|
42 std::unique_ptr<GLContextResult> GLContextMakeCurrent() override;
43
44 // |GPUSurfaceGLDelegate|
45 bool GLContextClearCurrent() override;
46
47 // |GPUSurfaceGLDelegate|
48 bool GLContextPresent(const GLPresentInfo& present_info) override;
49
50 // |GPUSurfaceGLDelegate|
51 GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override;
52};
53
54} // namespace flutter
55
56#endif // FLUTTER_SHELL_PLATFORM_ANDROID_SURFACE_ANDROID_SURFACE_MOCK_H_
bool GLContextPresent(const GLPresentInfo &present_info) override
MOCK_METHOD(bool, SetNativeWindow,(fml::RefPtr< AndroidNativeWindow > window),(override))
MOCK_METHOD(bool, ResourceContextClearCurrent,(),(override))
std::unique_ptr< GLContextResult > GLContextMakeCurrent() override
MOCK_METHOD(std::unique_ptr< Surface >, CreateGPUSurface,(GrDirectContext *gr_context),(override))
MOCK_METHOD(void, TeardownOnScreenContext,(),(override))
MOCK_METHOD(bool, ResourceContextMakeCurrent,(),(override))
MOCK_METHOD(bool, IsValid,(),(const, override))
MOCK_METHOD(bool, OnScreenSurfaceResize,(const SkISize &size),(override))
GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override
virtual bool IsValid() const =0
virtual std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context=nullptr)=0
virtual void TeardownOnScreenContext()=0
virtual bool OnScreenSurfaceResize(const SkISize &size)=0
virtual bool ResourceContextClearCurrent()=0
virtual bool SetNativeWindow(fml::RefPtr< AndroidNativeWindow > window)=0
virtual bool ResourceContextMakeCurrent()=0
GLFWwindow * window
Definition main.cc:45
it will be possible to load the file into Perfetto s trace viewer 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
Definition switches.h:259