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 present_with_transaction_ = present_with_transaction;
75 frame_boundary_ = frame_boundary;
79 std::weak_ptr<Context> context_;
80 std::shared_ptr<Texture> resolve_texture_;
81 id<CAMetalDrawable> drawable_ = nil;
82 std::shared_ptr<Texture> source_texture_;
83 std::shared_ptr<Texture> destination_texture_;
84 bool requires_blit_ =
false;
85 std::optional<IRect> clip_rect_;
86 bool frame_boundary_ =
false;
87 bool present_with_transaction_ =
false;
88 mutable bool prepared_ =
false;
90 static bool ShouldPerformPartialRepaint(std::optional<IRect> damage_rect);
92 SurfaceMTL(
const std::weak_ptr<Context>& context,
94 std::shared_ptr<Texture> resolve_texture,
96 std::shared_ptr<Texture> source_texture,
97 std::shared_ptr<Texture> destination_texture,
99 std::optional<IRect> clip_rect);
108 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_SURFACE_MTL_H_