| Flutter Impeller |

shader_function.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
5 #include "impeller/renderer/shader_function.h"
6
7 namespace impeller {
8
9 ShaderFunction::ShaderFunction(UniqueID parent_library_id,
10 std::string name,
11 ShaderStage stage)
12 : parent_library_id_(parent_library_id),
13 name_(std::move(name)),
14 stage_(stage) {}
15
16 ShaderFunction::~ShaderFunction() = default;
17
18 ShaderStage ShaderFunction::GetStage() const {
19 return stage_;
20 }
21
22 const std::string& ShaderFunction::GetName() const {
23 return name_;
24 }
25
26 // |Comparable<ShaderFunction>|
27 std::size_t ShaderFunction::GetHash() const {
28 return fml::HashCombine(parent_library_id_, name_, stage_);
29 }
30
31 // |Comparable<ShaderFunction>|
32 bool ShaderFunction::IsEqual(const ShaderFunction& other) const {
33 return parent_library_id_ == other.parent_library_id_ &&
34 name_ == other.name_ && stage_ == other.stage_;
35 }
36
37 } // namespace impeller
impeller::ShaderFunction::~ShaderFunction
virtual ~ShaderFunction()
shader_function.h
impeller::ShaderStage
ShaderStage
Definition: shader_types.h:22
impeller::ShaderFunction::IsEqual
bool IsEqual(const ShaderFunction &other) const override
Definition: shader_function.cc:32
impeller::ShaderFunction
Definition: shader_function.h:15
impeller::ShaderFunction::GetName
const std::string & GetName() const
Definition: shader_function.cc:22
impeller::ShaderFunction::GetStage
ShaderStage GetStage() const
Definition: shader_function.cc:18
std
Definition: comparable.h:95
impeller::UniqueID
Definition: comparable.h:16
impeller
Definition: allocation.cc:12
impeller::ShaderFunction::ShaderFunction
ShaderFunction(UniqueID parent_library_id, std::string name, ShaderStage stage)
Definition: shader_function.cc:9
impeller::ShaderFunction::GetHash
std::size_t GetHash() const override
Definition: shader_function.cc:27