Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shader_library_gles.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_RENDERER_BACKEND_GLES_SHADER_LIBRARY_GLES_H_
6#define FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SHADER_LIBRARY_GLES_H_
7
8#include <memory>
9
10#include "flutter/fml/macros.h"
11#include "flutter/fml/mapping.h"
16
17namespace impeller {
18
19class ShaderLibraryGLES final : public ShaderLibrary {
20 public:
21 // |ShaderLibrary|
23
24 // |ShaderLibrary|
25 bool IsValid() const override;
26
27 private:
28 friend class ContextGLES;
29 const UniqueID library_id_;
30 mutable RWMutex functions_mutex_;
31 ShaderFunctionMap functions_ IPLR_GUARDED_BY(functions_mutex_);
32 bool is_valid_ = false;
33
34 explicit ShaderLibraryGLES(
35 const std::vector<std::shared_ptr<fml::Mapping>>& shader_libraries);
36
37 // |ShaderLibrary|
38 std::shared_ptr<const ShaderFunction> GetFunction(std::string_view name,
39 ShaderStage stage) override;
40
41 // |ShaderLibrary|
42 void RegisterFunction(std::string name,
43 ShaderStage stage,
44 std::shared_ptr<fml::Mapping> code,
46
47 // |ShaderLibrary|
48 void UnregisterFunction(std::string name, ShaderStage stage) override;
49
50 ShaderLibraryGLES(const ShaderLibraryGLES&) = delete;
51
52 ShaderLibraryGLES& operator=(const ShaderLibraryGLES&) = delete;
53};
54
55} // namespace impeller
56
57#endif // FLUTTER_IMPELLER_RENDERER_BACKEND_GLES_SHADER_LIBRARY_GLES_H_
void RegisterFunction(std::string name, ShaderStage stage, std::shared_ptr< fml::Mapping > code, RegistrationCallback callback) override
std::shared_ptr< const ShaderFunction > GetFunction(std::string_view name, ShaderStage stage) override
void UnregisterFunction(std::string name, ShaderStage stage) override
std::function< void(bool)> RegistrationCallback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const char * name
Definition fuchsia.cc:50
std::unordered_map< ShaderKey, std::shared_ptr< const ShaderFunction >, ShaderKey::Hash, ShaderKey::Equal > ShaderFunctionMap
Definition shader_key.h:44
#define IPLR_GUARDED_BY(x)