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