/src/skia/src/gpu/text/GrDistanceFieldAdjustTable.h
Line | Count | Source (jump to first uncovered line) |
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 GrDistanceFieldAdjustTable_DEFINED |
9 | | #define GrDistanceFieldAdjustTable_DEFINED |
10 | | |
11 | | #include "include/core/SkScalar.h" |
12 | | |
13 | | // Distance field text needs this table to compute a value for use in the fragment shader. |
14 | | class GrDistanceFieldAdjustTable { |
15 | | public: |
16 | | static const GrDistanceFieldAdjustTable* Get(); |
17 | | |
18 | 0 | ~GrDistanceFieldAdjustTable() { |
19 | 0 | delete[] fTable; |
20 | 0 | delete[] fGammaCorrectTable; |
21 | 0 | } |
22 | | |
23 | 38 | SkScalar getAdjustment(int i, bool useGammaCorrectTable) const { |
24 | 38 | return useGammaCorrectTable ? fGammaCorrectTable[i] : fTable[i]; |
25 | 38 | } |
26 | | |
27 | | private: |
28 | | GrDistanceFieldAdjustTable(); |
29 | | |
30 | | SkScalar* fTable; |
31 | | SkScalar* fGammaCorrectTable; |
32 | | }; |
33 | | |
34 | | #endif |