blob: 93bb823db512141551ba6c605e3a97bb06cbf74f [file] [log] [blame]
Romain Guy9f5dab32012-09-04 12:55:44 -07001/*
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
Romain Guy9f5dab32012-09-04 12:55:44 -070020namespace android {
21namespace uirenderer {
22
Tom Hudson2dc236b2014-10-15 15:46:42 -040023class CacheTexture;
24
Romain Guy9f5dab32012-09-04 12:55:44 -070025struct 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;
Ben Wagnerf4f18a22016-03-28 11:09:39 -040042 float mAdvanceX;
43 float mAdvanceY;
Romain Guy9f5dab32012-09-04 12:55:44 -070044 // Values below contain a glyph's origin in the bitmap
45 int32_t mBitmapLeft;
46 int32_t mBitmapTop;
Ben Wagnerf4f18a22016-03-28 11:09:39 -040047 // Auto-kerning; represents a 2.6 fixed-point value with range [-1, 1].
48 int8_t mLsbDelta;
49 int8_t mRsbDelta;
Romain Guy9f5dab32012-09-04 12:55:44 -070050 CacheTexture* mCacheTexture;
51};
52
John Reck1bcacfd2017-11-03 10:12:19 -070053}; // namespace uirenderer
54}; // namespace android
Romain Guy9f5dab32012-09-04 12:55:44 -070055
John Reck1bcacfd2017-11-03 10:12:19 -070056#endif // ANDROID_HWUI_CACHED_GLYPH_INFO_H