Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
impeller::scene::Mesh Class Referencefinal

#include <mesh.h>

Classes

struct  Primitive
 

Public Member Functions

 Mesh ()
 
 ~Mesh ()
 
 Mesh (Mesh &&mesh)
 
Meshoperator= (Mesh &&mesh)
 
void AddPrimitive (Primitive mesh_)
 
std::vector< Primitive > & GetPrimitives ()
 
bool Render (SceneEncoder &encoder, const Matrix &transform, const std::shared_ptr< Texture > &joints) const
 

Detailed Description

Definition at line 21 of file mesh.h.

Constructor & Destructor Documentation

◆ Mesh() [1/2]

impeller::scene::Mesh::Mesh ( )
default

◆ ~Mesh()

impeller::scene::Mesh::~Mesh ( )
default

◆ Mesh() [2/2]

impeller::scene::Mesh::Mesh ( Mesh &&  mesh)
default

Member Function Documentation

◆ AddPrimitive()

void impeller::scene::Mesh::AddPrimitive ( Primitive  mesh_)

Definition at line 21 of file mesh.cc.

21 {
22 if (mesh.geometry == nullptr) {
23 VALIDATION_LOG << "Mesh geometry cannot be null.";
24 }
25 if (mesh.material == nullptr) {
26 VALIDATION_LOG << "Mesh material cannot be null.";
27 }
28
29 primitives_.push_back(std::move(mesh));
30}
SkMesh mesh
Definition SkRecords.h:345
#define VALIDATION_LOG
Definition validation.h:73

◆ GetPrimitives()

std::vector< Mesh::Primitive > & impeller::scene::Mesh::GetPrimitives ( )

Definition at line 32 of file mesh.cc.

32 {
33 return primitives_;
34}

◆ operator=()

Mesh & impeller::scene::Mesh::operator= ( Mesh &&  mesh)
default

◆ Render()

bool impeller::scene::Mesh::Render ( SceneEncoder encoder,
const Matrix transform,
const std::shared_ptr< Texture > &  joints 
) const

Definition at line 36 of file mesh.cc.

38 {
39 for (const auto& mesh : primitives_) {
40 mesh.geometry->SetJointsTexture(joints);
41 SceneCommand command = {
42 .label = "Mesh Primitive",
43 .transform = transform,
44 .geometry = mesh.geometry.get(),
45 .material = mesh.material.get(),
46 };
47 encoder.Add(command);
48 }
49 return true;
50}
list command
Definition valgrind.py:24
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition p3.cpp:47

The documentation for this class was generated from the following files: