Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Namespaces | Functions
render_pass.cc File Reference
#include "flutter/lib/gpu/render_pass.h"
#include "flutter/lib/gpu/formats.h"
#include "flutter/lib/gpu/render_pipeline.h"
#include "flutter/lib/gpu/shader.h"
#include "fml/memory/ref_ptr.h"
#include "impeller/core/buffer_view.h"
#include "impeller/core/formats.h"
#include "impeller/core/sampler_descriptor.h"
#include "impeller/core/shader_types.h"
#include "impeller/core/vertex_buffer.h"
#include "impeller/geometry/color.h"
#include "impeller/renderer/pipeline_library.h"
#include "tonic/converter/dart_converter.h"

Go to the source code of this file.

Namespaces

namespace  flutter
 
namespace  flutter::gpu
 

Functions

 flutter::gpu::IMPLEMENT_WRAPPERTYPEINFO (flutter_gpu, RenderPass)
 
static impeller::Color ToImpellerColor (uint32_t argb)
 
void InternalFlutterGpu_RenderPass_Initialize (Dart_Handle wrapper)
 
Dart_Handle InternalFlutterGpu_RenderPass_SetColorAttachment (flutter::gpu::RenderPass *wrapper, int color_attachment_index, int load_action, int store_action, int clear_color, flutter::gpu::Texture *texture, Dart_Handle resolve_texture_wrapper)
 
Dart_Handle InternalFlutterGpu_RenderPass_SetDepthStencilAttachment (flutter::gpu::RenderPass *wrapper, int depth_load_action, int depth_store_action, float depth_clear_value, int stencil_load_action, int stencil_store_action, int stencil_clear_value, flutter::gpu::Texture *texture)
 
Dart_Handle InternalFlutterGpu_RenderPass_Begin (flutter::gpu::RenderPass *wrapper, flutter::gpu::CommandBuffer *command_buffer)
 
void InternalFlutterGpu_RenderPass_BindPipeline (flutter::gpu::RenderPass *wrapper, flutter::gpu::RenderPipeline *pipeline)
 
template<typename TBuffer >
static void BindVertexBuffer (flutter::gpu::RenderPass *wrapper, TBuffer buffer, int offset_in_bytes, int length_in_bytes, int vertex_count)
 
void InternalFlutterGpu_RenderPass_BindVertexBufferDevice (flutter::gpu::RenderPass *wrapper, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes, int vertex_count)
 
void InternalFlutterGpu_RenderPass_BindVertexBufferHost (flutter::gpu::RenderPass *wrapper, flutter::gpu::HostBuffer *host_buffer, int offset_in_bytes, int length_in_bytes, int vertex_count)
 
template<typename TBuffer >
static void BindIndexBuffer (flutter::gpu::RenderPass *wrapper, TBuffer buffer, int offset_in_bytes, int length_in_bytes, int index_type, int index_count)
 
void InternalFlutterGpu_RenderPass_BindIndexBufferDevice (flutter::gpu::RenderPass *wrapper, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes, int index_type, int index_count)
 
void InternalFlutterGpu_RenderPass_BindIndexBufferHost (flutter::gpu::RenderPass *wrapper, flutter::gpu::HostBuffer *host_buffer, int offset_in_bytes, int length_in_bytes, int index_type, int index_count)
 
template<typename TBuffer >
static bool BindUniform (flutter::gpu::RenderPass *wrapper, flutter::gpu::Shader *shader, Dart_Handle uniform_name_handle, TBuffer buffer, int offset_in_bytes, int length_in_bytes)
 
bool InternalFlutterGpu_RenderPass_BindUniformDevice (flutter::gpu::RenderPass *wrapper, flutter::gpu::Shader *shader, Dart_Handle uniform_name_handle, flutter::gpu::DeviceBuffer *device_buffer, int offset_in_bytes, int length_in_bytes)
 
bool InternalFlutterGpu_RenderPass_BindUniformHost (flutter::gpu::RenderPass *wrapper, flutter::gpu::Shader *shader, Dart_Handle uniform_name_handle, flutter::gpu::HostBuffer *host_buffer, int offset_in_bytes, int length_in_bytes)
 
bool InternalFlutterGpu_RenderPass_BindTexture (flutter::gpu::RenderPass *wrapper, flutter::gpu::Shader *shader, Dart_Handle uniform_name_handle, flutter::gpu::Texture *texture, int min_filter, int mag_filter, int mip_filter, int width_address_mode, int height_address_mode)
 
void InternalFlutterGpu_RenderPass_ClearBindings (flutter::gpu::RenderPass *wrapper)
 
void InternalFlutterGpu_RenderPass_SetColorBlendEnable (flutter::gpu::RenderPass *wrapper, int color_attachment_index, bool enable)
 
void InternalFlutterGpu_RenderPass_SetColorBlendEquation (flutter::gpu::RenderPass *wrapper, int color_attachment_index, int color_blend_operation, int source_color_blend_factor, int destination_color_blend_factor, int alpha_blend_operation, int source_alpha_blend_factor, int destination_alpha_blend_factor)
 
void InternalFlutterGpu_RenderPass_SetDepthWriteEnable (flutter::gpu::RenderPass *wrapper, bool enable)
 
void InternalFlutterGpu_RenderPass_SetDepthCompareOperation (flutter::gpu::RenderPass *wrapper, int compare_operation)
 
bool InternalFlutterGpu_RenderPass_Draw (flutter::gpu::RenderPass *wrapper)
 

Function Documentation

◆ BindIndexBuffer()

template<typename TBuffer >
static void BindIndexBuffer ( flutter::gpu::RenderPass wrapper,
TBuffer  buffer,
int  offset_in_bytes,
int  length_in_bytes,
int  index_type,
int  index_count 
)
static

Definition at line 321 of file render_pass.cc.

326 {
327 auto& vertex_buffer = wrapper->GetVertexBuffer();
328 vertex_buffer.index_buffer = impeller::BufferView{
329 .buffer = buffer,
330 .range = impeller::Range(offset_in_bytes, length_in_bytes),
331 };
332 vertex_buffer.index_type = flutter::gpu::ToImpellerIndexType(index_type);
333 vertex_buffer.vertex_count = index_count;
334}
impeller::VertexBuffer & GetVertexBuffer()
static const uint8_t buffer[]
constexpr impeller::IndexType ToImpellerIndexType(FlutterGPUIndexType value)
Definition formats.h:387
std::shared_ptr< const DeviceBuffer > buffer
Definition buffer_view.h:16
BufferView index_buffer
The index buffer binding used by the vertex shader stage.

◆ BindUniform()

template<typename TBuffer >
static bool BindUniform ( flutter::gpu::RenderPass wrapper,
flutter::gpu::Shader shader,
Dart_Handle  uniform_name_handle,
TBuffer  buffer,
int  offset_in_bytes,
int  length_in_bytes 
)
static

Definition at line 366 of file render_pass.cc.

371 {
372 auto& command = wrapper->GetCommand();
373
374 auto uniform_name = tonic::StdStringFromDart(uniform_name_handle);
375 const flutter::gpu::Shader::UniformBinding* uniform_struct =
376 shader->GetUniformStruct(uniform_name);
377 // TODO(bdero): Return an error string stating that no uniform struct with
378 // this name exists and throw an exception.
379 if (!uniform_struct) {
380 return false;
381 }
382
383 return command.BindResource(
385 uniform_struct->slot, uniform_struct->metadata,
387 .buffer = buffer,
388 .range = impeller::Range(offset_in_bytes, length_in_bytes),
389 });
390}
impeller::Command & GetCommand()
const Shader::UniformBinding * GetUniformStruct(const std::string &name) const
Definition shader.cc:95
impeller::ShaderStage GetShaderStage() const
Definition shader.cc:91
std::string StdStringFromDart(Dart_Handle handle)
list command
Definition valgrind.py:24
impeller::ShaderMetadata metadata
Definition shader.h:30
impeller::ShaderUniformSlot slot
Definition shader.h:29

◆ BindVertexBuffer()

template<typename TBuffer >
static void BindVertexBuffer ( flutter::gpu::RenderPass wrapper,
TBuffer  buffer,
int  offset_in_bytes,
int  length_in_bytes,
int  vertex_count 
)
static

Definition at line 269 of file render_pass.cc.

273 {
274 auto& vertex_buffer = wrapper->GetVertexBuffer();
275 vertex_buffer.vertex_buffer = impeller::BufferView{
276 .buffer = buffer,
277 .range = impeller::Range(offset_in_bytes, length_in_bytes),
278 };
279 // If the index type is set, then the `vertex_count` becomes the index
280 // count... So don't overwrite the count if it's already been set when binding
281 // the index buffer.
282 // TODO(bdero): Consider just doing a more traditional API with
283 // draw(vertexCount) and drawIndexed(indexCount). This is fine,
284 // but overall it would be a bit more explicit and we wouldn't
285 // have to document this behavior where the presence of the index
286 // buffer always takes precedent.
287 if (vertex_buffer.index_type == impeller::IndexType::kNone) {
288 vertex_buffer.vertex_count = vertex_count;
289 }
290}
@ kNone
Does not use the index buffer.

◆ InternalFlutterGpu_RenderPass_Begin()

Dart_Handle InternalFlutterGpu_RenderPass_Begin ( flutter::gpu::RenderPass wrapper,
flutter::gpu::CommandBuffer command_buffer 
)

Definition at line 252 of file render_pass.cc.

254 {
255 if (!wrapper->Begin(*command_buffer)) {
256 return tonic::ToDart("Failed to begin RenderPass");
257 }
258 return Dart_Null();
259}
bool Begin(flutter::gpu::CommandBuffer &command_buffer)
DART_EXPORT Dart_Handle Dart_Null(void)
Dart_Handle ToDart(const T &object)

◆ InternalFlutterGpu_RenderPass_BindIndexBufferDevice()

void InternalFlutterGpu_RenderPass_BindIndexBufferDevice ( flutter::gpu::RenderPass wrapper,
flutter::gpu::DeviceBuffer device_buffer,
int  offset_in_bytes,
int  length_in_bytes,
int  index_type,
int  index_count 
)

Definition at line 336 of file render_pass.cc.

342 {
343 BindIndexBuffer(wrapper, device_buffer->GetBuffer(), offset_in_bytes,
344 length_in_bytes, index_type, index_count);
345}
std::shared_ptr< impeller::DeviceBuffer > GetBuffer()
static void BindIndexBuffer(flutter::gpu::RenderPass *wrapper, TBuffer buffer, int offset_in_bytes, int length_in_bytes, int index_type, int index_count)

◆ InternalFlutterGpu_RenderPass_BindIndexBufferHost()

void InternalFlutterGpu_RenderPass_BindIndexBufferHost ( flutter::gpu::RenderPass wrapper,
flutter::gpu::HostBuffer host_buffer,
int  offset_in_bytes,
int  length_in_bytes,
int  index_type,
int  index_count 
)

Definition at line 347 of file render_pass.cc.

353 {
354 auto view = host_buffer->GetBufferViewForOffset(offset_in_bytes);
355 if (!view.has_value()) {
357 << "Failed to bind index buffer due to invalid HostBuffer offset: "
358 << offset_in_bytes;
359 return;
360 }
361 BindIndexBuffer(wrapper, view->buffer, view->range.offset, view->range.length,
362 index_type, index_count);
363}
std::optional< impeller::BufferView > GetBufferViewForOffset(size_t offset)
#define FML_LOG(severity)
Definition logging.h:82
#define ERROR(message)

◆ InternalFlutterGpu_RenderPass_BindPipeline()

void InternalFlutterGpu_RenderPass_BindPipeline ( flutter::gpu::RenderPass wrapper,
flutter::gpu::RenderPipeline pipeline 
)

Definition at line 261 of file render_pass.cc.

263 {
265 wrapper->SetPipeline(std::move(ref));
266}
void SetPipeline(fml::RefPtr< RenderPipeline > pipeline)

◆ InternalFlutterGpu_RenderPass_BindTexture()

bool InternalFlutterGpu_RenderPass_BindTexture ( flutter::gpu::RenderPass wrapper,
flutter::gpu::Shader shader,
Dart_Handle  uniform_name_handle,
flutter::gpu::Texture texture,
int  min_filter,
int  mag_filter,
int  mip_filter,
int  width_address_mode,
int  height_address_mode 
)

Definition at line 422 of file render_pass.cc.

431 {
432 auto& command = wrapper->GetCommand();
433
434 auto uniform_name = tonic::StdStringFromDart(uniform_name_handle);
435 const impeller::SampledImageSlot* image_slot =
436 shader->GetUniformTexture(uniform_name);
437 // TODO(bdero): Return an error string stating that no uniform texture with
438 // this name exists and throw an exception.
439 if (!image_slot) {
440 return false;
441 }
442
443 impeller::SamplerDescriptor sampler_desc;
444 sampler_desc.min_filter = flutter::gpu::ToImpellerMinMagFilter(min_filter);
445 sampler_desc.mag_filter = flutter::gpu::ToImpellerMinMagFilter(mag_filter);
446 sampler_desc.mip_filter = flutter::gpu::ToImpellerMipFilter(mip_filter);
447 sampler_desc.width_address_mode =
449 sampler_desc.height_address_mode =
451 const std::unique_ptr<const impeller::Sampler>& sampler =
452 wrapper->GetContext()->GetSamplerLibrary()->GetSampler(sampler_desc);
453
454 return command.BindResource(
456 *image_slot, impeller::ShaderMetadata{}, texture->GetTexture(), sampler);
457}
const std::shared_ptr< const impeller::Context > & GetContext() const
const impeller::SampledImageSlot * GetUniformTexture(const std::string &name) const
Definition shader.cc:104
FlTexture * texture
constexpr impeller::SamplerAddressMode ToImpellerSamplerAddressMode(FlutterGPUSamplerAddressMode value)
Definition formats.h:365
constexpr impeller::MipFilter ToImpellerMipFilter(FlutterGPUMipFilter value)
Definition formats.h:346
constexpr impeller::MinMagFilter ToImpellerMinMagFilter(FlutterGPUMinMagFilter value)
Definition formats.h:327
Metadata required to bind a combined texture and sampler.
SamplerAddressMode width_address_mode
SamplerAddressMode height_address_mode

◆ InternalFlutterGpu_RenderPass_BindUniformDevice()

bool InternalFlutterGpu_RenderPass_BindUniformDevice ( flutter::gpu::RenderPass wrapper,
flutter::gpu::Shader shader,
Dart_Handle  uniform_name_handle,
flutter::gpu::DeviceBuffer device_buffer,
int  offset_in_bytes,
int  length_in_bytes 
)

Definition at line 392 of file render_pass.cc.

398 {
399 return BindUniform(wrapper, shader, uniform_name_handle,
400 device_buffer->GetBuffer(), offset_in_bytes,
401 length_in_bytes);
402}
static bool BindUniform(flutter::gpu::RenderPass *wrapper, flutter::gpu::Shader *shader, Dart_Handle uniform_name_handle, TBuffer buffer, int offset_in_bytes, int length_in_bytes)

◆ InternalFlutterGpu_RenderPass_BindUniformHost()

bool InternalFlutterGpu_RenderPass_BindUniformHost ( flutter::gpu::RenderPass wrapper,
flutter::gpu::Shader shader,
Dart_Handle  uniform_name_handle,
flutter::gpu::HostBuffer host_buffer,
int  offset_in_bytes,
int  length_in_bytes 
)

Definition at line 404 of file render_pass.cc.

410 {
411 auto view = host_buffer->GetBufferViewForOffset(offset_in_bytes);
412 if (!view.has_value()) {
414 << "Failed to bind index buffer due to invalid HostBuffer offset: "
415 << offset_in_bytes;
416 return false;
417 }
418 return BindUniform(wrapper, shader, uniform_name_handle, view->buffer,
419 view->range.offset, view->range.length);
420}

◆ InternalFlutterGpu_RenderPass_BindVertexBufferDevice()

void InternalFlutterGpu_RenderPass_BindVertexBufferDevice ( flutter::gpu::RenderPass wrapper,
flutter::gpu::DeviceBuffer device_buffer,
int  offset_in_bytes,
int  length_in_bytes,
int  vertex_count 
)

Definition at line 292 of file render_pass.cc.

297 {
298 BindVertexBuffer(wrapper, device_buffer->GetBuffer(), offset_in_bytes,
299 length_in_bytes, vertex_count);
300}
static void BindVertexBuffer(flutter::gpu::RenderPass *wrapper, TBuffer buffer, int offset_in_bytes, int length_in_bytes, int vertex_count)

◆ InternalFlutterGpu_RenderPass_BindVertexBufferHost()

void InternalFlutterGpu_RenderPass_BindVertexBufferHost ( flutter::gpu::RenderPass wrapper,
flutter::gpu::HostBuffer host_buffer,
int  offset_in_bytes,
int  length_in_bytes,
int  vertex_count 
)

Definition at line 302 of file render_pass.cc.

307 {
308 std::optional<impeller::BufferView> view =
309 host_buffer->GetBufferViewForOffset(offset_in_bytes);
310 if (!view.has_value()) {
312 << "Failed to bind vertex buffer due to invalid HostBuffer offset: "
313 << offset_in_bytes;
314 return;
315 }
316 BindVertexBuffer(wrapper, view->buffer, view->range.offset,
317 view->range.length, vertex_count);
318}

◆ InternalFlutterGpu_RenderPass_ClearBindings()

void InternalFlutterGpu_RenderPass_ClearBindings ( flutter::gpu::RenderPass wrapper)

Definition at line 459 of file render_pass.cc.

460 {
461 auto& command = wrapper->GetCommand();
462 command.vertex_buffer = {};
463 command.vertex_bindings = {};
464 command.fragment_bindings = {};
465}

◆ InternalFlutterGpu_RenderPass_Draw()

bool InternalFlutterGpu_RenderPass_Draw ( flutter::gpu::RenderPass wrapper)

Definition at line 514 of file render_pass.cc.

514 {
515 return wrapper->Draw();
516}

◆ InternalFlutterGpu_RenderPass_Initialize()

void InternalFlutterGpu_RenderPass_Initialize ( Dart_Handle  wrapper)

Exports

Definition at line 194 of file render_pass.cc.

194 {
195 auto res = fml::MakeRefCounted<flutter::gpu::RenderPass>();
196 res->AssociateWithDartWrapper(wrapper);
197}

◆ InternalFlutterGpu_RenderPass_SetColorAttachment()

Dart_Handle InternalFlutterGpu_RenderPass_SetColorAttachment ( flutter::gpu::RenderPass wrapper,
int  color_attachment_index,
int  load_action,
int  store_action,
int  clear_color,
flutter::gpu::Texture texture,
Dart_Handle  resolve_texture_wrapper 
)

Definition at line 199 of file render_pass.cc.

206 {
208 desc.load_action = flutter::gpu::ToImpellerLoadAction(load_action);
209 desc.store_action = flutter::gpu::ToImpellerStoreAction(store_action);
210 desc.clear_color = ToImpellerColor(static_cast<uint32_t>(clear_color));
211 desc.texture = texture->GetTexture();
212 if (!Dart_IsNull(resolve_texture_wrapper)) {
213 flutter::gpu::Texture* resolve_texture =
215 resolve_texture_wrapper);
216 desc.resolve_texture = resolve_texture->GetTexture();
217 }
218 wrapper->GetRenderTarget().SetColorAttachment(desc, color_attachment_index);
219 return Dart_Null();
220}
impeller::RenderTarget & GetRenderTarget()
std::shared_ptr< impeller::Texture > GetTexture()
Definition texture.cc:26
RenderTarget & SetColorAttachment(const ColorAttachment &attachment, size_t index)
DART_EXPORT bool Dart_IsNull(Dart_Handle object)
static impeller::Color ToImpellerColor(uint32_t argb)
constexpr impeller::LoadAction ToImpellerLoadAction(FlutterGPULoadAction value)
Definition formats.h:247
constexpr impeller::StoreAction ToImpellerStoreAction(FlutterGPUStoreAction value)
Definition formats.h:270

◆ InternalFlutterGpu_RenderPass_SetColorBlendEnable()

void InternalFlutterGpu_RenderPass_SetColorBlendEnable ( flutter::gpu::RenderPass wrapper,
int  color_attachment_index,
bool  enable 
)

Definition at line 467 of file render_pass.cc.

470 {
471 auto& color = wrapper->GetColorAttachmentDescriptor(color_attachment_index);
472 color.blending_enabled = enable;
473}
SkColor4f color
impeller::ColorAttachmentDescriptor & GetColorAttachmentDescriptor(size_t color_attachment_index)

◆ InternalFlutterGpu_RenderPass_SetColorBlendEquation()

void InternalFlutterGpu_RenderPass_SetColorBlendEquation ( flutter::gpu::RenderPass wrapper,
int  color_attachment_index,
int  color_blend_operation,
int  source_color_blend_factor,
int  destination_color_blend_factor,
int  alpha_blend_operation,
int  source_alpha_blend_factor,
int  destination_alpha_blend_factor 
)

Definition at line 475 of file render_pass.cc.

483 {
484 auto& color = wrapper->GetColorAttachmentDescriptor(color_attachment_index);
485 color.color_blend_op =
486 flutter::gpu::ToImpellerBlendOperation(color_blend_operation);
487 color.src_color_blend_factor =
488 flutter::gpu::ToImpellerBlendFactor(source_color_blend_factor);
489 color.dst_color_blend_factor =
490 flutter::gpu::ToImpellerBlendFactor(destination_color_blend_factor);
491 color.alpha_blend_op =
492 flutter::gpu::ToImpellerBlendOperation(alpha_blend_operation);
493 color.src_alpha_blend_factor =
494 flutter::gpu::ToImpellerBlendFactor(source_alpha_blend_factor);
495 color.dst_alpha_blend_factor =
496 flutter::gpu::ToImpellerBlendFactor(destination_alpha_blend_factor);
497}
constexpr impeller::BlendFactor ToImpellerBlendFactor(FlutterGPUBlendFactor value)
Definition formats.h:179
constexpr impeller::BlendOperation ToImpellerBlendOperation(FlutterGPUBlendOperation value)
Definition formats.h:225

◆ InternalFlutterGpu_RenderPass_SetDepthCompareOperation()

void InternalFlutterGpu_RenderPass_SetDepthCompareOperation ( flutter::gpu::RenderPass wrapper,
int  compare_operation 
)

Definition at line 506 of file render_pass.cc.

508 {
509 auto& depth = wrapper->GetDepthAttachmentDescriptor();
510 depth.depth_compare =
512}
impeller::DepthAttachmentDescriptor & GetDepthAttachmentDescriptor()
constexpr impeller::CompareFunction ToImpellerCompareFunction(FlutterGPUCompareFunction value)
Definition formats.h:439

◆ InternalFlutterGpu_RenderPass_SetDepthStencilAttachment()

Dart_Handle InternalFlutterGpu_RenderPass_SetDepthStencilAttachment ( flutter::gpu::RenderPass wrapper,
int  depth_load_action,
int  depth_store_action,
float  depth_clear_value,
int  stencil_load_action,
int  stencil_store_action,
int  stencil_clear_value,
flutter::gpu::Texture texture 
)

Definition at line 222 of file render_pass.cc.

230 {
231 {
233 desc.load_action = flutter::gpu::ToImpellerLoadAction(depth_load_action);
234 desc.store_action = flutter::gpu::ToImpellerStoreAction(depth_store_action);
235 desc.clear_depth = depth_clear_value;
236 desc.texture = texture->GetTexture();
237 wrapper->GetRenderTarget().SetDepthAttachment(desc);
238 }
239 {
241 desc.load_action = flutter::gpu::ToImpellerLoadAction(stencil_load_action);
242 desc.store_action =
243 flutter::gpu::ToImpellerStoreAction(stencil_store_action);
244 desc.clear_stencil = stencil_clear_value;
245 desc.texture = texture->GetTexture();
246 wrapper->GetRenderTarget().SetStencilAttachment(desc);
247 }
248
249 return Dart_Null();
250}
RenderTarget & SetDepthAttachment(std::optional< DepthAttachment > attachment)
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)

◆ InternalFlutterGpu_RenderPass_SetDepthWriteEnable()

void InternalFlutterGpu_RenderPass_SetDepthWriteEnable ( flutter::gpu::RenderPass wrapper,
bool  enable 
)

Definition at line 499 of file render_pass.cc.

501 {
502 auto& depth = wrapper->GetDepthAttachmentDescriptor();
503 depth.depth_write_enabled = true;
504}

◆ ToImpellerColor()

static impeller::Color ToImpellerColor ( uint32_t  argb)
static

Definition at line 183 of file render_pass.cc.

183 {
184 return impeller::Color::MakeRGBA8((argb >> 16) & 0xFF, // R
185 (argb >> 8) & 0xFF, // G
186 argb & 0xFF, // B
187 argb >> 24); // A
188}
static constexpr Color MakeRGBA8(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Definition color.h:154