5#ifndef FLUTTER_SHELL_GPU_GPU_SURFACE_METAL_IMPELLER_H_
6#define FLUTTER_SHELL_GPU_GPU_SURFACE_METAL_IMPELLER_H_
8#include <Metal/Metal.h>
10#include "flutter/flow/surface.h"
11#include "flutter/fml/macros.h"
12#include "flutter/fml/platform/darwin/scoped_nsobject.h"
13#include "flutter/impeller/aiks/aiks_context.h"
14#include "flutter/impeller/renderer/backend/metal/context_mtl.h"
15#include "flutter/impeller/renderer/renderer.h"
16#include "flutter/shell/gpu/gpu_surface_metal_delegate.h"
25 const std::shared_ptr<impeller::Context>& context,
26 bool render_to_surface =
true);
32 bool IsValid()
override;
39 std::shared_ptr<impeller::Renderer> impeller_renderer_;
40 std::shared_ptr<impeller::AiksContext> aiks_context_;
46 bool render_to_surface_ =
true;
47 bool disable_partial_repaint_ =
false;
50 std::shared_ptr<std::map<uintptr_t, SkIRect>> damage_ =
51 std::make_shared<std::map<uintptr_t, SkIRect>>();
54 std::unique_ptr<SurfaceFrame> AcquireFrame(
55 const SkISize& frame_size)
override;
57 std::unique_ptr<SurfaceFrame> AcquireFrameFromCAMetalLayer(
60 std::unique_ptr<SurfaceFrame> AcquireFrameFromMTLTexture(
64 SkMatrix GetRootTransformation()
const override;
70 std::unique_ptr<GLContextResult> MakeRenderContextCurrent()
override;
73 bool AllowsDrawingWhenGpuDisabled()
const override;
76 bool EnableRasterCache()
const override;
79 std::shared_ptr<impeller::AiksContext> GetAiksContext()
const override;
Abstract Base Class that represents where we will be rendering content.
#define IMPELLER_CA_METAL_LAYER_AVAILABLE
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
SK_API GrDirectContext * GetContext(const SkImage *src)
A screenshot of the surface's raw data.