Flutter Impeller
context.cc
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 
6 
7 #include <utility>
8 
9 namespace impeller {
10 
11 Context::~Context() = default;
12 
13 Context::Context(const Flags& flags) : flags_(flags) {}
14 
16  return false;
17 }
18 
20  std::shared_ptr<CommandBuffer> command_buffer) {
21  return GetCommandQueue()->Submit({std::move(command_buffer)}).ok();
22 }
23 
25  return true;
26 }
27 
28 std::shared_ptr<const IdleWaiter> Context::GetIdleWaiter() const {
29  return nullptr;
30 }
31 
33  // Nothing to do.
34 }
35 
36 bool Context::AddTrackingFence(const std::shared_ptr<Texture>& texture) const {
37  return false;
38 }
39 
40 bool Context::SubmitOnscreen(std::shared_ptr<CommandBuffer> cmd_buffer) {
41  return EnqueueCommandBuffer(std::move(cmd_buffer));
42 }
43 
44 } // namespace impeller
virtual std::shared_ptr< const IdleWaiter > GetIdleWaiter() const
Definition: context.cc:28
virtual bool AddTrackingFence(const std::shared_ptr< Texture > &texture) const
Definition: context.cc:36
virtual bool SubmitOnscreen(std::shared_ptr< CommandBuffer > cmd_buffer)
Submit the command buffer that renders to the onscreen surface.
Definition: context.cc:40
virtual bool UpdateOffscreenLayerPixelFormat(PixelFormat format)
Definition: context.cc:15
Context(const Flags &flags)
Definition: context.cc:13
virtual bool FlushCommandBuffers()
Flush all pending command buffers.
Definition: context.cc:24
virtual std::shared_ptr< CommandQueue > GetCommandQueue() const =0
Return the graphics queue for submitting command buffers.
virtual ~Context()
Destroys an Impeller context.
virtual void ResetThreadLocalState() const
Definition: context.cc:32
virtual bool EnqueueCommandBuffer(std::shared_ptr< CommandBuffer > command_buffer)
Enqueue command_buffer for submission by the end of the frame.
Definition: context.cc:19
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:99