Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
text
gpu
DistanceFieldAdjustTable.h
Go to the documentation of this file.
1
/*
2
* Copyright 2015 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef sktext_gpu_DistanceFieldAdjustTable_DEFINED
9
#define sktext_gpu_DistanceFieldAdjustTable_DEFINED
10
11
#include "
include/core/SkScalar.h
"
12
13
template
<
typename
T>
class
SkNoDestructor
;
14
15
namespace
sktext::gpu
{
16
17
// Distance field text needs this table to compute a value for use in the fragment shader.
18
class
DistanceFieldAdjustTable
{
19
public
:
20
static
const
DistanceFieldAdjustTable
*
Get
();
21
22
~DistanceFieldAdjustTable
() {
23
delete
[] fTable;
24
delete
[] fGammaCorrectTable;
25
}
26
27
SkScalar
getAdjustment
(
int
i,
bool
useGammaCorrectTable)
const
{
28
return
useGammaCorrectTable ? fGammaCorrectTable[i] : fTable[i];
29
}
30
31
private
:
32
DistanceFieldAdjustTable
();
33
34
SkScalar
* fTable;
35
SkScalar
* fGammaCorrectTable;
36
37
friend
class
SkNoDestructor
<
DistanceFieldAdjustTable
>;
38
};
39
40
}
// namespace sktext::gpu
41
42
#endif
SkScalar.h
SkNoDestructor
Definition
SkNoDestructor.h:84
sktext::gpu::DistanceFieldAdjustTable
Definition
DistanceFieldAdjustTable.h:18
sktext::gpu::DistanceFieldAdjustTable::~DistanceFieldAdjustTable
~DistanceFieldAdjustTable()
Definition
DistanceFieldAdjustTable.h:22
sktext::gpu::DistanceFieldAdjustTable::Get
static const DistanceFieldAdjustTable * Get()
Definition
DistanceFieldAdjustTable.cpp:107
sktext::gpu::DistanceFieldAdjustTable::getAdjustment
SkScalar getAdjustment(int i, bool useGammaCorrectTable) const
Definition
DistanceFieldAdjustTable.h:27
SkScalar
float SkScalar
Definition
extension.cpp:12
sktext::gpu
Definition
SkCanvas.h:81
Generated on Fri Apr 26 2024 06:17:34 for Flutter Engine by
1.9.8