Flutter Engine
The Flutter Engine
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
8#include "flutter/lib/ui/dart_wrapper.h"
9#include "flutter/lib/ui/painting/fragment_program.h"
10#include "flutter/lib/ui/painting/image.h"
11#include "flutter/lib/ui/painting/image_shader.h"
12#include "flutter/lib/ui/painting/shader.h"
17
18#include <string>
19#include <vector>
20
21namespace flutter {
22
23class FragmentProgram;
24
26 DEFINE_WRAPPERTYPEINFO();
27 FML_FRIEND_MAKE_REF_COUNTED(ReusableFragmentShader);
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
38
39 bool ValidateSamplers();
40
41 void Dispose();
42
43 // |Shader|
44 std::shared_ptr<DlColorSource> shader(DlImageSampling) override;
45
46 private:
48 uint64_t float_count,
49 uint64_t sampler_count);
50
52 sk_sp<SkData> uniform_data_;
53 std::vector<std::shared_ptr<DlColorSource>> samplers_;
54 size_t float_count_;
55};
56
57} // namespace flutter
58
59#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< DlColorSource > shader(DlImageSampling) override
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
sk_sp< const SkImage > image
Definition: SkRecords.h:269