Flutter Engine
The Flutter Engine
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"
14
15namespace impeller {
16
17class 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 OnCopyTextureToTextureCommand(std::shared_ptr<Texture> source,
45 std::shared_ptr<Texture> destination,
46 IRect source_region,
47 IPoint destination_origin,
48 std::string label) override;
49
50 // |BlitPass|
51 bool OnCopyTextureToBufferCommand(std::shared_ptr<Texture> source,
52 std::shared_ptr<DeviceBuffer> destination,
53 IRect source_region,
54 size_t destination_offset,
55 std::string label) override;
56
57 // |BlitPass|
58 bool OnCopyBufferToTextureCommand(BufferView source,
59 std::shared_ptr<Texture> destination,
60 IRect destination_region,
61 std::string label,
62 uint32_t slice,
63 bool convert_to_read) override;
64
65 // |BlitPass|
66 bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
67 std::string label) override;
68
69 BlitPassGLES(const BlitPassGLES&) = delete;
70
71 BlitPassGLES& operator=(const BlitPassGLES&) = delete;
72};
73
74} // namespace impeller
75
76#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_PASS_GLES_H_
Blit passes encode blit into the underlying command buffer.
Definition: blit_pass.h:26
std::shared_ptr< ReactorGLES > Ref
Definition: reactor_gles.h:86
SkBitmap source
Definition: examples.cpp:28
FlTexture * texture