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 
14 namespace impeller {
15 
16 /// @brief A wrapper around data provided by a drawAtlas call.
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 
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  const 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_
A wrapper around data provided by a drawAtlas call.
const std::shared_ptr< Texture > & GetAtlas() const override
BlendMode GetBlendMode() const override
VertexBuffer CreateBlendVertexBuffer(HostBuffer &host_buffer) const override
const SamplerDescriptor & GetSamplerDescriptor() const override
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)
bool ShouldUseBlend() const override
Whether the blend shader should be used.
bool ShouldSkip() const override
Rect ComputeBoundingBox() const override
VertexBuffer CreateSimpleVertexBuffer(HostBuffer &host_buffer) const override
flutter::DlRect DlRect
Definition: dl_dispatcher.h:25
BlendMode
Definition: color.h:58