40 const uint8_t*
data =
static_cast<const uint8_t*
>(source_bytes.
data());
44 auto mapping = std::make_shared<fml::DataMapping>(copy);
51 auto& task_runners = dart_state->GetTaskRunners();
53 task_runners.GetRasterTaskRunner()->PostTask(
55 if (!
texture->SetContents(mapping)) {
56 FML_LOG(ERROR) <<
"Failed to set texture contents.";
61 if (!texture_->SetContents(mapping)) {
impeller::Context & GetContext()
Texture(std::shared_ptr< impeller::Texture > texture)
size_t GetBytesPerTexel()
std::shared_ptr< impeller::Texture > GetTexture()
Dart_Handle AsImage() const
void SetCoordinateSystem(impeller::TextureCoordinateSystem coordinate_system)
bool Overwrite(Context &gpu_context, const tonic::DartByteData &source_bytes)
virtual BackendType GetBackendType() const =0
Get the graphics backend of an Impeller context.
virtual void DisposeThreadLocalCachedResources()
virtual std::shared_ptr< Allocator > GetResourceAllocator() const =0
Returns the allocator used to create textures and buffers on the device.
uint32_t uint32_t * format
bool InternalFlutterGpu_Texture_Initialize(Dart_Handle wrapper, flutter::gpu::Context *gpu_context, int storage_mode, int format, int width, int height, int sample_count, int coordinate_system, int texture_type, bool enable_render_target_usage, bool enable_shader_read_usage, bool enable_shader_write_usage)
void InternalFlutterGpu_Texture_SetCoordinateSystem(flutter::gpu::Texture *wrapper, int coordinate_system)
Dart_Handle InternalFlutterGpu_Texture_AsImage(flutter::gpu::Texture *wrapper)
bool InternalFlutterGpu_Texture_Overwrite(flutter::gpu::Texture *texture, flutter::gpu::Context *gpu_context, Dart_Handle source_byte_data)
int InternalFlutterGpu_Texture_BytesPerTexel(flutter::gpu::Texture *wrapper)
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...