| 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 <memory>
9
10 #include "flutter/impeller/base/config.h"
11 #include "flutter/impeller/renderer/backend/gles/reactor_gles.h"
12 #include "flutter/impeller/renderer/blit_pass.h"
13 #include "impeller/renderer/backend/gles/blit_command_gles.h"
14
15 namespace impeller {
16
17 class BlitPassGLES final : public BlitPass,
18 public std::enable_shared_from_this<BlitPassGLES> {
19 public:
20 // |BlitPass|
21 ~BlitPassGLES() override;
22
23 private:
24 friend class CommandBufferGLES;
25
26 std::vector<std::unique_ptr<BlitEncodeGLES>> commands_;
27 ReactorGLES::Ref reactor_;
28 std::string label_;
29 bool is_valid_ = false;
30
31 explicit BlitPassGLES(ReactorGLES::Ref reactor);
32
33 // |BlitPass|
34 bool IsValid() const override;
35
36 // |BlitPass|
37 void OnSetLabel(std::string label) override;
38
39 // |BlitPass|
40 bool EncodeCommands(
41 const std::shared_ptr<Allocator>& transients_allocator) 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 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 label) override;
60
61 // |BlitPass|
62 bool OnCopyBufferToTextureCommand(BufferView source,
63 std::shared_ptr<Texture> destination,
64 IRect destination_region,
65 std::string label,
66 uint32_t slice,
67 bool convert_to_read) override;
68
69 // |BlitPass|
70 bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
71 std::string label) override;
72
73 BlitPassGLES(const BlitPassGLES&) = delete;
74
75 BlitPassGLES& operator=(const BlitPassGLES&) = delete;
76 };
77
78 } // namespace impeller
79
80 #endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_PASS_GLES_H_
impeller::ReactorGLES::Ref
std::shared_ptr< ReactorGLES > Ref
Definition: reactor_gles.h:86
impeller::BlitPass
Blit passes encode blit into the underlying command buffer.
Definition: blit_pass.h:26
impeller::CommandBufferGLES
Definition: command_buffer_gles.h:14
impeller::BlitPassGLES::~BlitPassGLES
~BlitPassGLES() override
blit_pass.h
blit_command_gles.h
impeller::BufferView
Definition: buffer_view.h:15
reactor_gles.h
impeller::BlitPassGLES
Definition: blit_pass_gles.h:17
impeller::TPoint< int64_t >
config.h
impeller
Definition: allocation.cc:12
impeller::TRect
Definition: rect.h:122