Flutter Engine
 
Loading...
Searching...
No Matches
fragment_shader.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_SHADER_H_
6#define FLUTTER_LIB_UI_PAINTING_FRAGMENT_SHADER_H_
7
13#include "third_party/skia/include/core/SkShader.h"
14#include "third_party/skia/include/effects/SkRuntimeEffect.h"
17
18#include <string>
19#include <vector>
20
21namespace flutter {
22
23class FragmentProgram;
24
26 DEFINE_WRAPPERTYPEINFO();
28
29 public:
31
32 static Dart_Handle Create(Dart_Handle wrapper,
33 Dart_Handle program,
34 Dart_Handle float_count,
35 Dart_Handle sampler_count);
36
37 void SetImageSampler(Dart_Handle index, Dart_Handle image);
38
39 bool ValidateSamplers();
40
42
43 void Dispose();
44
45 // |Shader|
46 std::shared_ptr<DlColorSource> shader(DlImageSampling) override;
47
48 std::shared_ptr<DlImageFilter> as_image_filter() const;
49
50 private:
52 uint64_t float_count,
53 uint64_t sampler_count);
54
56 sk_sp<SkData> uniform_data_;
57 std::vector<std::shared_ptr<DlColorSource>> samplers_;
58 size_t float_count_;
59};
60
61} // namespace flutter
62
63#endif // FLUTTER_LIB_UI_PAINTING_FRAGMENT_SHADER_H_
static Dart_Handle Create(Dart_Handle wrapper, Dart_Handle program, Dart_Handle float_count, Dart_Handle sampler_count)
void SetImageSampler(Dart_Handle index, Dart_Handle image)
std::shared_ptr< DlImageFilter > as_image_filter() const
std::shared_ptr< DlColorSource > shader(DlImageSampling) override
FlutterVulkanImage * image
#define FML_FRIEND_MAKE_REF_COUNTED(T)