Flutter Impeller
blit_pass_gles.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_RENDERER_BACKEND_GLES_BLIT_PASS_GLES_H_
6 #define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_PASS_GLES_H_
7 
8 #include <cstdint>
9 #include <memory>
10 
15 
16 namespace impeller {
17 
18 class BlitPassGLES final : public BlitPass,
19  public std::enable_shared_from_this<BlitPassGLES> {
20  public:
21  // |BlitPass|
22  ~BlitPassGLES() override;
23 
24  private:
25  friend class CommandBufferGLES;
26 
27  std::vector<std::unique_ptr<BlitEncodeGLES>> commands_;
28  std::shared_ptr<ReactorGLES> reactor_;
29  std::string label_;
30  bool is_valid_ = false;
31 
32  explicit BlitPassGLES(std::shared_ptr<ReactorGLES> reactor);
33 
34  // |BlitPass|
35  bool IsValid() const override;
36 
37  // |BlitPass|
38  void OnSetLabel(std::string_view label) override;
39 
40  // |BlitPass|
41  bool EncodeCommands() const override;
42 
43  // |BlitPass|
44  bool ResizeTexture(const std::shared_ptr<Texture>& source,
45  const std::shared_ptr<Texture>& destination) override;
46 
47  // |BlitPass|
48  bool OnCopyTextureToTextureCommand(std::shared_ptr<Texture> source,
49  std::shared_ptr<Texture> destination,
50  IRect source_region,
51  IPoint destination_origin,
52  std::string_view label) override;
53 
54  // |BlitPass|
55  bool OnCopyTextureToBufferCommand(std::shared_ptr<Texture> source,
56  std::shared_ptr<DeviceBuffer> destination,
57  IRect source_region,
58  size_t destination_offset,
59  std::string_view label) override;
60 
61  // |BlitPass|
62  bool OnCopyBufferToTextureCommand(BufferView source,
63  std::shared_ptr<Texture> destination,
64  IRect destination_region,
65  std::string_view label,
66  uint32_t mip_level,
67  uint32_t slice,
68  bool convert_to_read) override;
69 
70  // |BlitPass|
71  bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
72  std::string_view label) override;
73 
74  BlitPassGLES(const BlitPassGLES&) = delete;
75 
76  BlitPassGLES& operator=(const BlitPassGLES&) = delete;
77 };
78 
79 } // namespace impeller
80 
81 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_PASS_GLES_H_
Blit passes encode blit into the underlying command buffer.
Definition: blit_pass.h:27