Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
context_spy.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_AIKS_TESTING_CONTEXT_SPY_H_
6#define FLUTTER_IMPELLER_AIKS_TESTING_CONTEXT_SPY_H_
7
8#include <memory>
9
13
14namespace impeller {
15namespace testing {
16
18 public:
20 const std::vector<std::shared_ptr<CommandBuffer>>& buffers,
21 const CompletionCallback& completion_callback = {}) override;
22};
23
24/// Forwards calls to a real Context but can store information about how
25/// the Context was used.
26class ContextSpy : public std::enable_shared_from_this<ContextSpy> {
27 public:
28 static std::shared_ptr<ContextSpy> Make();
29
30 std::shared_ptr<ContextMock> MakeContext(
31 const std::shared_ptr<Context>& real_context);
32
33 std::vector<std::shared_ptr<RecordingRenderPass>> render_passes_;
34 std::shared_ptr<CommandQueue> command_queue_ =
35 std::make_shared<NoopCommandQueue>();
36
37 private:
38 ContextSpy() = default;
39};
40
41} // namespace testing
42
43} // namespace impeller
44
45#endif // FLUTTER_IMPELLER_AIKS_TESTING_CONTEXT_SPY_H_
An interface for submitting command buffers to the GPU for encoding and execution.
std::function< void(CommandBuffer::Status)> CompletionCallback
static std::shared_ptr< ContextSpy > Make()
std::shared_ptr< ContextMock > MakeContext(const std::shared_ptr< Context > &real_context)
std::vector< std::shared_ptr< RecordingRenderPass > > render_passes_
Definition context_spy.h:33
std::shared_ptr< CommandQueue > command_queue_
Definition context_spy.h:34
fml::Status Submit(const std::vector< std::shared_ptr< CommandBuffer > > &buffers, const CompletionCallback &completion_callback={}) override
Submit one or more command buffer objects to be encoded and executed on the GPU.