Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
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,
38 Dart_Handle image,
39 int filterQualityIndex);
40
41 bool ValidateSamplers();
42
44
45 void Dispose();
46
47 // |Shader|
48 std::shared_ptr<DlColorSource> shader(DlImageSampling) override;
49
50 std::shared_ptr<DlImageFilter> as_image_filter() const;
51
52 private:
54 uint64_t float_count,
55 uint64_t sampler_count);
56
58 sk_sp<SkData> uniform_data_;
59 std::vector<std::shared_ptr<DlColorSource>> samplers_;
60 size_t float_count_;
61};
62
63} // namespace flutter
64
65#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)
std::shared_ptr< DlImageFilter > as_image_filter() const
void SetImageSampler(Dart_Handle index, Dart_Handle image, int filterQualityIndex)
std::shared_ptr< DlColorSource > shader(DlImageSampling) override
FlutterVulkanImage * image
#define FML_FRIEND_MAKE_REF_COUNTED(T)