forked from flutter-team-archive/engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathblit_pass_mtl.h
More file actions
67 lines (49 loc) · 2.01 KB
/
Copy pathblit_pass_mtl.h
File metadata and controls
67 lines (49 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <Metal/Metal.h>
#include "flutter/fml/macros.h"
#include "impeller/renderer/backend/metal/blit_command_mtl.h"
#include "impeller/renderer/blit_pass.h"
namespace impeller {
class BlitPassMTL final : public BlitPass {
public:
// |RenderPass|
~BlitPassMTL() override;
private:
friend class CommandBufferMTL;
std::vector<std::unique_ptr<BlitEncodeMTL>> commands_;
id<MTLCommandBuffer> buffer_ = nil;
std::string label_;
bool is_valid_ = false;
explicit BlitPassMTL(id<MTLCommandBuffer> buffer);
// |BlitPass|
bool IsValid() const override;
// |BlitPass|
void OnSetLabel(std::string label) override;
// |BlitPass|
bool EncodeCommands(
const std::shared_ptr<Allocator>& transients_allocator) const override;
bool EncodeCommands(id<MTLBlitCommandEncoder> pass) const;
// |BlitPass|
bool OnCopyTextureToTextureCommand(std::shared_ptr<Texture> source,
std::shared_ptr<Texture> destination,
IRect source_region,
IPoint destination_origin,
std::string label) override;
// |BlitPass|
bool OnCopyTextureToBufferCommand(std::shared_ptr<Texture> source,
std::shared_ptr<DeviceBuffer> destination,
IRect source_region,
size_t destination_offset,
std::string label) override;
// |BlitPass|
bool OnGenerateMipmapCommand(std::shared_ptr<Texture> texture,
std::string label) override;
// |BlitPass|
bool OnOptimizeForGPUAccess(std::shared_ptr<Texture> texture,
std::string label) override;
FML_DISALLOW_COPY_AND_ASSIGN(BlitPassMTL);
};
} // namespace impeller