1/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_HWUI_CACHED_GLYPH_INFO_H
18#define ANDROID_HWUI_CACHED_GLYPH_INFO_H
19
20namespace android {
21namespace uirenderer {
22
23class CacheTexture;
24
25struct CachedGlyphInfo {
26    // Has the cache been invalidated?
27    bool mIsValid;
28    // Location of the cached glyph in the bitmap
29    // in case we need to resize the texture or
30    // render to bitmap
31    uint32_t mStartX;
32    uint32_t mStartY;
33    uint32_t mBitmapWidth;
34    uint32_t mBitmapHeight;
35    // Also cache texture coords for the quad
36    float mBitmapMinU;
37    float mBitmapMinV;
38    float mBitmapMaxU;
39    float mBitmapMaxV;
40    // Minimize how much we call freetype
41    uint32_t mGlyphIndex;
42    float mAdvanceX;
43    float mAdvanceY;
44    // Values below contain a glyph's origin in the bitmap
45    int32_t mBitmapLeft;
46    int32_t mBitmapTop;
47    // Auto-kerning; represents a 2.6 fixed-point value with range [-1, 1].
48    int8_t mLsbDelta;
49    int8_t mRsbDelta;
50    CacheTexture* mCacheTexture;
51};
52
53}; // namespace uirenderer
54}; // namespace android
55
56#endif // ANDROID_HWUI_CACHED_GLYPH_INFO_H
57