Flutter Engine
The Flutter Engine
fragment_program.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_LIB_UI_PAINTING_FRAGMENT_PROGRAM_H_
6#define FLUTTER_LIB_UI_PAINTING_FRAGMENT_PROGRAM_H_
7
8#include "flutter/display_list/effects/dl_runtime_effect.h"
9#include "flutter/lib/ui/dart_wrapper.h"
10#include "flutter/lib/ui/painting/shader.h"
11
14
15#include <memory>
16#include <string>
17#include <vector>
18
19namespace flutter {
20
21class FragmentShader;
22
23class FragmentProgram : public RefCountedDartWrappable<FragmentProgram> {
24 DEFINE_WRAPPERTYPEINFO();
25 FML_FRIEND_MAKE_REF_COUNTED(FragmentProgram);
26
27 public:
28 ~FragmentProgram() override;
29 static void Create(Dart_Handle wrapper);
30
31 std::string initFromAsset(const std::string& asset_name);
32
34 Dart_Handle uniforms_handle,
35 Dart_Handle samplers);
36
37 std::shared_ptr<DlColorSource> MakeDlColorSource(
38 std::shared_ptr<std::vector<uint8_t>> float_uniforms,
39 const std::vector<std::shared_ptr<DlColorSource>>& children);
40
41 private:
43 sk_sp<DlRuntimeEffect> runtime_effect_;
44};
45
46} // namespace flutter
47
48#endif // FLUTTER_LIB_UI_PAINTING_FRAGMENT_PROGRAM_H_
std::shared_ptr< DlColorSource > MakeDlColorSource(std::shared_ptr< std::vector< uint8_t > > float_uniforms, const std::vector< std::shared_ptr< DlColorSource > > &children)
fml::RefPtr< FragmentShader > shader(Dart_Handle shader, Dart_Handle uniforms_handle, Dart_Handle samplers)
std::string initFromAsset(const std::string &asset_name)
static void Create(Dart_Handle wrapper)
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258