| Flutter Impeller |

dl_atlas_geometry.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_DISPLAY_LIST_DL_ATLAS_GEOMETRY_H_
6 #define FLUTTER_IMPELLER_DISPLAY_LIST_DL_ATLAS_GEOMETRY_H_
7
8 #include "display_list/dl_color.h"
9 #include "display_list/image/dl_image.h"
10 #include "impeller/core/sampler_descriptor.h"
11 #include "impeller/entity/contents/atlas_contents.h"
12 #include "impeller/geometry/color.h"
13
14 namespace impeller {
15
16 /// @brief A wrapper around data provided by a drawAtlas call.
17 class DlAtlasGeometry : public AtlasGeometry {
18 public:
19 DlAtlasGeometry(const std::shared_ptr<Texture>& atlas,
20 const RSTransform* xform,
21 const flutter::DlRect* tex,
22 const flutter::DlColor* colors,
23 size_t count,
24 BlendMode mode,
25 const SamplerDescriptor& sampling,
26 std::optional<Rect> cull_rect);
27
28 ~DlAtlasGeometry();
29
30 /// @brief Whether the blend shader should be used.
31 bool ShouldUseBlend() const override;
32
33 bool ShouldSkip() const override;
34
35 VertexBuffer CreateSimpleVertexBuffer(HostBuffer& host_buffer) const override;
36
37 VertexBuffer CreateBlendVertexBuffer(HostBuffer& host_buffer) const override;
38
39 Rect ComputeBoundingBox() const override;
40
41 std::shared_ptr<Texture> GetAtlas() const override;
42
43 const SamplerDescriptor& GetSamplerDescriptor() const override;
44
45 BlendMode GetBlendMode() const override;
46
47 private:
48 const std::shared_ptr<Texture> atlas_;
49 const RSTransform* xform_;
50 const flutter::DlRect* tex_;
51 const flutter::DlColor* colors_;
52 size_t count_;
53 BlendMode mode_;
54 SamplerDescriptor sampling_;
55 mutable std::optional<Rect> cull_rect_;
56 };
57
58 } // namespace impeller
59
60 #endif // FLUTTER_IMPELLER_DISPLAY_LIST_DL_ATLAS_GEOMETRY_H_
impeller::DlAtlasGeometry::CreateSimpleVertexBuffer
VertexBuffer CreateSimpleVertexBuffer(HostBuffer &host_buffer) const override
Definition: dl_atlas_geometry.cc:70
impeller::DlAtlasGeometry::GetBlendMode
BlendMode GetBlendMode() const override
Definition: dl_atlas_geometry.cc:66
impeller::DlAtlasGeometry::CreateBlendVertexBuffer
VertexBuffer CreateBlendVertexBuffer(HostBuffer &host_buffer) const override
Definition: dl_atlas_geometry.cc:103
impeller::BlendMode
BlendMode
Definition: color.h:58
impeller::HostBuffer
Definition: host_buffer.h:28
impeller::VertexBuffer
Definition: vertex_buffer.h:15
impeller::DlAtlasGeometry
A wrapper around data provided by a drawAtlas call.
Definition: dl_atlas_geometry.h:17
impeller::SamplerDescriptor
Definition: sampler_descriptor.h:14
impeller::AtlasGeometry
Definition: atlas_contents.h:19
impeller::DlAtlasGeometry::DlAtlasGeometry
DlAtlasGeometry(const std::shared_ptr< Texture > &atlas, const RSTransform *xform, const flutter::DlRect *tex, const flutter::DlColor *colors, size_t count, BlendMode mode, const SamplerDescriptor &sampling, std::optional< Rect > cull_rect)
Definition: dl_atlas_geometry.cc:18
impeller::DlAtlasGeometry::GetAtlas
std::shared_ptr< Texture > GetAtlas() const override
Definition: dl_atlas_geometry.cc:58
impeller::RSTransform
Definition: rstransform.h:20
impeller::DlRect
flutter::DlRect DlRect
Definition: dl_dispatcher.h:25
impeller::DlAtlasGeometry::ComputeBoundingBox
Rect ComputeBoundingBox() const override
Definition: dl_atlas_geometry.cc:45
atlas_contents.h
sampler_descriptor.h
impeller::DlAtlasGeometry::ShouldSkip
bool ShouldSkip() const override
Definition: dl_atlas_geometry.cc:41
impeller::DlAtlasGeometry::ShouldUseBlend
bool ShouldUseBlend() const override
Whether the blend shader should be used.
Definition: dl_atlas_geometry.cc:37
color.h
impeller::DlAtlasGeometry::GetSamplerDescriptor
const SamplerDescriptor & GetSamplerDescriptor() const override
Definition: dl_atlas_geometry.cc:62
impeller::DlAtlasGeometry::~DlAtlasGeometry
~DlAtlasGeometry()
impeller
Definition: allocation.cc:12
impeller::TRect
Definition: rect.h:122