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