Flutter Engine
The Flutter Engine
vertices_contents.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_VERTICES_CONTENTS_H_
6#define FLUTTER_IMPELLER_ENTITY_CONTENTS_VERTICES_CONTENTS_H_
7
8#include <memory>
9
15
16namespace impeller {
17
18/// A vertices contents for (optional) per-color vertices + texture and any
19/// blend mode.
21 public:
23
25
27 std::function<std::shared_ptr<Texture>(const ContentContext& renderer)>;
28
29 void SetGeometry(std::shared_ptr<VerticesGeometry> geometry);
30
31 void SetAlpha(Scalar alpha);
32
33 void SetBlendMode(BlendMode blend_mode);
34
35 void SetTexture(std::shared_ptr<Texture> texture);
36
37 void SetLazyTexture(const LazyTexture& lazy_texture);
38
40
41 void SetTileMode(Entity::TileMode tile_mode_x, Entity::TileMode tile_mode_y);
42
44
45 // |Contents|
46 std::optional<Rect> GetCoverage(const Entity& entity) const override;
47
48 // |Contents|
49 bool Render(const ContentContext& renderer,
50 const Entity& entity,
51 RenderPass& pass) const override;
52
53 private:
54 Scalar alpha_ = 1.0;
55 std::shared_ptr<VerticesGeometry> geometry_;
56 std::shared_ptr<Texture> texture_;
57 BlendMode blend_mode_ = BlendMode::kSource;
58 SamplerDescriptor descriptor_ = {};
61 Matrix inverse_matrix_ = {};
62 LazyTexture lazy_texture_;
63
65
67 delete;
68};
69
70} // namespace impeller
71
72#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_VERTICES_CONTENTS_H_
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:33
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
void SetBlendMode(BlendMode blend_mode)
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
void SetTileMode(Entity::TileMode tile_mode_x, Entity::TileMode tile_mode_y)
void SetLazyTexture(const LazyTexture &lazy_texture)
std::function< std::shared_ptr< Texture >(const ContentContext &renderer)> LazyTexture
void SetTexture(std::shared_ptr< Texture > texture)
void SetGeometry(std::shared_ptr< VerticesGeometry > geometry)
void SetSamplerDescriptor(SamplerDescriptor descriptor)
FlTexture * texture
float Scalar
Definition: scalar.h:18
BlendMode
Definition: color.h:59
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition: p3.cpp:47
A 4x4 matrix using column-major storage.
Definition: matrix.h:37