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 label)
override;
42 const std::shared_ptr<Allocator>& transients_allocator)
const override;
45 bool ResizeTexture(
const std::shared_ptr<Texture>& source,
46 const std::shared_ptr<Texture>& destination)
override;
49 bool OnCopyTextureToTextureCommand(std::shared_ptr<Texture> source,
50 std::shared_ptr<Texture> destination,
53 std::string label)
override;
56 bool OnCopyTextureToBufferCommand(std::shared_ptr<Texture> source,
57 std::shared_ptr<DeviceBuffer> destination,
59 size_t destination_offset,
60 std::string label)
override;
62 bool OnCopyBufferToTextureCommand(
BufferView source,
63 std::shared_ptr<Texture> destination,
64 IRect destination_region,
67 bool convert_to_read)
override;
70 bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
71 std::string label)
override;
80 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_METAL_BLIT_PASS_MTL_H_