// Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef FLUTTER_IMPELLER_COMPILER_COMPILER_H_ #define FLUTTER_IMPELLER_COMPILER_COMPILER_H_ #include #include #include #include "flutter/fml/mapping.h" #include "impeller/compiler/include_dir.h" #include "impeller/compiler/reflector.h" #include "impeller/compiler/source_options.h" #include "impeller/compiler/spirv_compiler.h" #include "impeller/compiler/types.h" #include "spirv_msl.hpp" #include "spirv_parser.hpp" namespace impeller { namespace compiler { class Compiler { public: Compiler(const std::shared_ptr& source_mapping, const SourceOptions& options, Reflector::Options reflector_options); ~Compiler(); bool IsValid() const; std::shared_ptr GetSPIRVAssembly() const; std::shared_ptr GetSLShaderSource() const; std::string GetErrorMessages() const; const std::vector& GetIncludedFileNames() const; std::unique_ptr CreateDepfileContents( std::initializer_list targets) const; const Reflector* GetReflector() const; private: SourceOptions options_; std::shared_ptr spirv_assembly_; std::shared_ptr sl_mapping_; std::stringstream error_stream_; std::unique_ptr reflector_; std::vector included_file_names_; bool is_valid_ = false; std::string GetSourcePrefix() const; std::string GetDependencyNames(const std::string& separator) const; Compiler(const Compiler&) = delete; Compiler& operator=(const Compiler&) = delete; }; } // namespace compiler } // namespace impeller #endif // FLUTTER_IMPELLER_COMPILER_COMPILER_H_