Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
lib
ui
painting
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"
13
#include "
third_party/skia/include/core/SkShader.h
"
14
#include "
third_party/skia/include/effects/SkRuntimeEffect.h
"
15
#include "
third_party/tonic/dart_library_natives.h
"
16
#include "
third_party/tonic/typed_data/typed_list.h
"
17
18
#include <string>
19
#include <vector>
20
21
namespace
flutter
{
22
23
class
FragmentProgram;
24
25
class
ReusableFragmentShader
:
public
Shader
{
26
DEFINE_WRAPPERTYPEINFO();
27
FML_FRIEND_MAKE_REF_COUNTED
(
ReusableFragmentShader
);
28
29
public
:
30
~ReusableFragmentShader
()
override
;
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
41
void
Dispose
();
42
43
// |Shader|
44
std::shared_ptr<DlColorSource>
shader
(
DlImageSampling
)
override
;
45
46
private
:
47
ReusableFragmentShader
(
fml::RefPtr<FragmentProgram>
program,
48
uint64_t float_count,
49
uint64_t sampler_count);
50
51
fml::RefPtr<FragmentProgram>
program_;
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_
Create
static sk_sp< Effect > Create()
Definition
RefCntTest.cpp:117
SkRuntimeEffect.h
SkShader.h
flutter::ReusableFragmentShader
Definition
fragment_shader.h:25
flutter::ReusableFragmentShader::~ReusableFragmentShader
~ReusableFragmentShader() override
flutter::ReusableFragmentShader::Dispose
void Dispose()
Definition
fragment_shader.cc:114
flutter::ReusableFragmentShader::SetImageSampler
void SetImageSampler(Dart_Handle index, Dart_Handle image)
Definition
fragment_shader.cc:69
flutter::ReusableFragmentShader::shader
std::shared_ptr< DlColorSource > shader(DlImageSampling) override
Definition
fragment_shader.cc:96
flutter::ReusableFragmentShader::ValidateSamplers
bool ValidateSamplers()
Definition
fragment_shader.cc:57
flutter::Shader
Definition
shader.h:13
fml::RefPtr
Definition
ref_ptr.h:65
sk_sp
Definition
SkRefCnt.h:220
Dart_Handle
struct _Dart_Handle * Dart_Handle
Definition
dart_api.h:258
dart_library_natives.h
image
sk_sp< SkImage > image
Definition
examples.cpp:29
flutter
Definition
asset_manager.cc:10
flutter::DlImageSampling
DlImageSampling
Definition
dl_sampling_options.h:17
FML_FRIEND_MAKE_REF_COUNTED
#define FML_FRIEND_MAKE_REF_COUNTED(T)
Definition
ref_counted.h:132
typed_list.h
Generated on Fri Apr 26 2024 06:14:16 for Flutter Engine by
1.9.8