| Flutter Impeller |

pipeline_key.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_PIPELINE_KEY_H_
6 #define FLUTTER_IMPELLER_SCENE_PIPELINE_KEY_H_
7
8 #include "flutter/fml/hash_combine.h"
9
10 namespace impeller {
11 namespace scene {
12
13 enum class GeometryType {
14 kUnskinned = 0,
15 kSkinned = 1,
16 kLastType = kSkinned,
17 };
18 enum class MaterialType {
19 kUnlit = 0,
20 kLastType = kUnlit,
21 };
22
23 struct PipelineKey {
24 GeometryType geometry_type = GeometryType::kUnskinned;
25 MaterialType material_type = MaterialType::kUnlit;
26
27 struct Hash {
28 constexpr std::size_t operator()(const PipelineKey& o) const {
29 return fml::HashCombine(o.geometry_type, o.material_type);
30 }
31 };
32
33 struct Equal {
34 constexpr bool operator()(const PipelineKey& lhs,
35 const PipelineKey& rhs) const {
36 return lhs.geometry_type == rhs.geometry_type &&
37 lhs.material_type == rhs.material_type;
38 }
39 };
40 };
41
42 } // namespace scene
43 } // namespace impeller
44
45 #endif // FLUTTER_IMPELLER_SCENE_PIPELINE_KEY_H_
impeller::scene::GeometryType::kUnskinned
@ kUnskinned
impeller::scene::PipelineKey::Equal::operator()
constexpr bool operator()(const PipelineKey &lhs, const PipelineKey &rhs) const
Definition: pipeline_key.h:34
impeller::scene::PipelineKey::Hash
Definition: pipeline_key.h:27
impeller::scene::GeometryType::kLastType
@ kLastType
impeller::scene::PipelineKey
Definition: pipeline_key.h:23
impeller::scene::MaterialType
MaterialType
Definition: pipeline_key.h:18
impeller::scene::PipelineKey::material_type
MaterialType material_type
Definition: pipeline_key.h:25
impeller::scene::MaterialType::kLastType
@ kLastType
impeller::scene::MaterialType::kUnlit
@ kUnlit
impeller::scene::GeometryType
GeometryType
Definition: pipeline_key.h:13
impeller::scene::GeometryType::kSkinned
@ kSkinned
impeller::scene::PipelineKey::Equal
Definition: pipeline_key.h:33
impeller::scene::PipelineKey::Hash::operator()
constexpr std::size_t operator()(const PipelineKey &o) const
Definition: pipeline_key.h:28
impeller::scene::PipelineKey::geometry_type
GeometryType geometry_type
Definition: pipeline_key.h:24
impeller
Definition: aiks_blur_unittests.cc:20