Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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/fml/macros.h"
11#include "flutter/impeller/base/config.h"
12#include "flutter/impeller/renderer/backend/gles/reactor_gles.h"
13#include "flutter/impeller/renderer/blit_pass.h"
15
16namespace impeller {
17
18class 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 ReactorGLES::Ref reactor_;
29 std::string label_;
30 bool is_valid_ = false;
31
32 explicit BlitPassGLES(ReactorGLES::Ref reactor);
33
34 // |BlitPass|
35 bool IsValid() const override;
36
37 // |BlitPass|
38 void OnSetLabel(std::string label) override;
39
40 // |BlitPass|
41 bool EncodeCommands(
42 const std::shared_ptr<Allocator>& transients_allocator) const override;
43
44 // |BlitPass|
45 bool OnCopyTextureToTextureCommand(std::shared_ptr<Texture> source,
46 std::shared_ptr<Texture> destination,
47 IRect source_region,
48 IPoint destination_origin,
49 std::string label) override;
50
51 // |BlitPass|
52 bool OnCopyTextureToBufferCommand(std::shared_ptr<Texture> source,
53 std::shared_ptr<DeviceBuffer> destination,
54 IRect source_region,
55 size_t destination_offset,
56 std::string label) override;
57
58 // |BlitPass|
60 std::shared_ptr<Texture> destination,
61 IPoint destination_origin,
62 std::string label) override {
64 return false;
65 }
66 // |BlitPass|
67 bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
68 std::string label) override;
69
70 BlitPassGLES(const BlitPassGLES&) = delete;
71
72 BlitPassGLES& operator=(const BlitPassGLES&) = delete;
73};
74
75} // namespace impeller
76
77#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_BLIT_PASS_GLES_H_
#define IMPELLER_UNIMPLEMENTED
Definition config.h:25
bool OnCopyTextureToBufferCommand(std::shared_ptr< Texture > source, std::shared_ptr< DeviceBuffer > destination, IRect source_region, size_t destination_offset, std::string label) override
void OnSetLabel(std::string label) override
bool OnGenerateMipmapCommand(std::shared_ptr< Texture > texture, std::string label) override
bool OnCopyBufferToTextureCommand(BufferView source, std::shared_ptr< Texture > destination, IPoint destination_origin, std::string label) override
bool EncodeCommands(const std::shared_ptr< Allocator > &transients_allocator) const override
Encode the recorded commands to the underlying command buffer.
bool OnCopyTextureToTextureCommand(std::shared_ptr< Texture > source, std::shared_ptr< Texture > destination, IRect source_region, IPoint destination_origin, std::string label) override
bool IsValid() const override
Blit passes encode blit into the underlying command buffer.
Definition blit_pass.h:26
std::shared_ptr< ReactorGLES > Ref
SkBitmap source
Definition examples.cpp:28
FlTexture * texture