Flutter Engine
 
Loading...
Searching...
No Matches
gpu_surface_noop.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_GPU_GPU_SURFACE_NOOP_H_
6#define FLUTTER_SHELL_GPU_GPU_SURFACE_NOOP_H_
7
8#include <Metal/Metal.h>
9
11
12namespace flutter {
13
14/// @brief A rendering surface that accepts rendering intent but does not render
15/// anything.
16///
17/// This is useful for running on platforms that need an engine instance and
18/// don't have the required drivers.
19class GPUSurfaceNoop : public Surface {
20 public:
21 explicit GPUSurfaceNoop();
22
23 // |Surface|
25
26 // |Surface|
27 bool IsValid() override;
28
29 // |Surface|
30 Surface::SurfaceData GetSurfaceData() const override;
31
32 private:
33 // |Surface|
34 std::unique_ptr<SurfaceFrame> AcquireFrame(
35 const DlISize& frame_size) override;
36
37 std::unique_ptr<SurfaceFrame> AcquireFrameFromCAMetalLayer(
38 const DlISize& frame_size);
39
40 std::unique_ptr<SurfaceFrame> AcquireFrameFromMTLTexture(
41 const DlISize& frame_size);
42
43 // |Surface|
44 DlMatrix GetRootTransformation() const override;
45
46 // |Surface|
47 GrDirectContext* GetContext() override;
48
49 // |Surface|
50 std::unique_ptr<GLContextResult> MakeRenderContextCurrent() override;
51
52 // |Surface|
53 bool AllowsDrawingWhenGpuDisabled() const override;
54
55 // |Surface|
56 bool EnableRasterCache() const override;
57
58 // |Surface|
59 std::shared_ptr<impeller::AiksContext> GetAiksContext() const override;
60
61 GPUSurfaceNoop(const GPUSurfaceNoop&) = delete;
62
63 GPUSurfaceNoop& operator=(const GPUSurfaceNoop&) = delete;
64};
65
66} // namespace flutter
67
68#endif // FLUTTER_SHELL_GPU_GPU_SURFACE_NOOP_H_
A rendering surface that accepts rendering intent but does not render anything.
Surface::SurfaceData GetSurfaceData() const override
Abstract Base Class that represents where we will be rendering content.
Definition surface.h:26
A screenshot of the surface's raw data.
Definition surface.h:29
A 4x4 matrix using column-major storage.
Definition matrix.h:37