5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SURFACE_MTL_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SURFACE_MTL_H_
8 #include <QuartzCore/CAMetalLayer.h>
19 #pragma GCC diagnostic push
24 #pragma GCC diagnostic ignored "-Wunguarded-availability-new"
38 const std::shared_ptr<Context>& context,
42 const std::shared_ptr<Context>& context,
44 std::optional<IRect> clip_rect = std::nullopt);
47 const std::shared_ptr<Context>& context,
48 id<MTLTexture> texture,
49 std::optional<IRect> clip_rect,
51 #pragma GCC diagnostic pop
56 id<MTLDrawable>
drawable()
const {
return drawable_; }
65 std::weak_ptr<Context> context_;
66 std::shared_ptr<Texture> resolve_texture_;
67 id<CAMetalDrawable> drawable_ = nil;
68 std::shared_ptr<Texture> source_texture_;
69 std::shared_ptr<Texture> destination_texture_;
70 bool requires_blit_ =
false;
71 std::optional<IRect> clip_rect_;
73 static bool ShouldPerformPartialRepaint(std::optional<IRect> damage_rect);
75 SurfaceMTL(
const std::weak_ptr<Context>& context,
77 std::shared_ptr<Texture> resolve_texture,
79 std::shared_ptr<Texture> source_texture,
80 std::shared_ptr<Texture> destination_texture,
82 std::optional<IRect> clip_rect);
91 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SURFACE_MTL_H_