| Flutter Impeller |

scene_encoder.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_SCENE_SCENE_ENCODER_H_
6 #define FLUTTER_IMPELLER_SCENE_SCENE_ENCODER_H_
7
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 #include "flutter/fml/macros.h"
13 #include "impeller/renderer/command_buffer.h"
14 #include "impeller/scene/camera.h"
15 #include "impeller/scene/geometry.h"
16 #include "impeller/scene/material.h"
17
18 namespace impeller {
19 namespace scene {
20
21 class Scene;
22
23 struct SceneCommand {
24 std::string label;
25 Matrix transform;
26 Geometry* geometry;
27 Material* material;
28 };
29
30 class SceneEncoder {
31 public:
32 void Add(const SceneCommand& command);
33
34 private:
35 SceneEncoder();
36
37 std::shared_ptr<CommandBuffer> BuildSceneCommandBuffer(
38 const SceneContext& scene_context,
39 const Matrix& camera_transform,
40 RenderTarget render_target) const;
41
42 std::vector<SceneCommand> commands_;
43
44 friend Scene;
45
46 SceneEncoder(const SceneEncoder&) = delete;
47
48 SceneEncoder& operator=(const SceneEncoder&) = delete;
49 };
50
51 } // namespace scene
52 } // namespace impeller
53
54 #endif // FLUTTER_IMPELLER_SCENE_SCENE_ENCODER_H_
impeller::scene::SceneCommand::material
Material * material
Definition: scene_encoder.h:27
impeller::scene::SceneCommand::geometry
Geometry * geometry
Definition: scene_encoder.h:26
impeller::scene::SceneContext
Definition: scene_context.h:41
impeller::scene::SceneEncoder::Add
void Add(const SceneCommand &command)
Definition: scene_encoder.cc:18
material.h
impeller::RenderTarget
Definition: render_target.h:38
camera.h
impeller::scene::Geometry
Definition: geometry.h:29
impeller::scene::SceneCommand::transform
Matrix transform
Definition: scene_encoder.h:25
command_buffer.h
impeller::scene::SceneCommand
Definition: scene_encoder.h:23
geometry.h
impeller::scene::Scene
Definition: scene.h:21
impeller::scene::SceneEncoder
Definition: scene_encoder.h:30
impeller::scene::SceneCommand::label
std::string label
Definition: scene_encoder.h:24
impeller
Definition: aiks_blur_unittests.cc:20
impeller::scene::Material
Definition: material.h:27
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37