5 #ifndef FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_BLIT_PASS_MTL_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_BLIT_PASS_MTL_H_
8 #include <Metal/Metal.h>
22 id<MTLBlitCommandEncoder> encoder_ = nil;
23 id<MTLCommandBuffer> buffer_ = nil;
24 id<MTLDevice> device_ = nil;
25 bool is_valid_ =
false;
26 bool is_metal_trace_active_ =
false;
30 mutable bool did_finish_encoding_ =
false;
32 explicit BlitPassMTL(id<MTLCommandBuffer> buffer, id<MTLDevice> device);
35 bool IsValid()
const override;
38 void OnSetLabel(std::string_view label)
override;
41 bool EncodeCommands()
const override;
44 bool ResizeTexture(
const std::shared_ptr<Texture>& source,
45 const std::shared_ptr<Texture>& destination)
override;
48 bool OnCopyTextureToTextureCommand(std::shared_ptr<Texture> source,
49 std::shared_ptr<Texture> destination,
52 std::string_view label)
override;
55 bool OnCopyTextureToBufferCommand(std::shared_ptr<Texture> source,
56 std::shared_ptr<DeviceBuffer> destination,
58 size_t destination_offset,
59 std::string_view label)
override;
61 bool OnCopyBufferToTextureCommand(
BufferView source,
62 std::shared_ptr<Texture> destination,
63 IRect destination_region,
64 std::string_view label,
67 bool convert_to_read)
override;
70 bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
71 std::string_view label)
override;
Blit passes encode blit into the underlying command buffer.