20#pragma GCC diagnostic push
25#pragma GCC diagnostic ignored "-Wunguarded-availability-new"
39 const std::shared_ptr<Context>& context,
43 const std::shared_ptr<Context>& context,
45 std::optional<IRect> clip_rect = std::nullopt);
48 const std::shared_ptr<Context>& context,
50 std::optional<IRect> clip_rect,
52#pragma GCC diagnostic pop
57 id<MTLDrawable>
drawable()
const {
return drawable_; }
66 std::weak_ptr<Context> context_;
67 std::shared_ptr<Texture> resolve_texture_;
68 id<CAMetalDrawable> drawable_ = nil;
69 std::shared_ptr<Texture> source_texture_;
70 std::shared_ptr<Texture> destination_texture_;
71 bool requires_blit_ =
false;
72 std::optional<IRect> clip_rect_;
74 static bool ShouldPerformPartialRepaint(std::optional<IRect> damage_rect);
76 SurfaceMTL(
const std::weak_ptr<Context>& context,
78 std::shared_ptr<Texture> resolve_texture,
80 std::shared_ptr<Texture> source_texture,
81 std::shared_ptr<Texture> destination_texture,
83 std::optional<IRect> clip_rect);