Romain Guy | 9f5dab3 | 2012-09-04 12:55:44 -0700 | [diff] [blame] | 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 | |
| 20 | #include <SkFixed.h> |
| 21 | |
| 22 | #include "CacheTexture.h" |
| 23 | |
| 24 | namespace android { |
| 25 | namespace uirenderer { |
| 26 | |
| 27 | struct CachedGlyphInfo { |
| 28 | // Has the cache been invalidated? |
| 29 | bool mIsValid; |
| 30 | // Location of the cached glyph in the bitmap |
| 31 | // in case we need to resize the texture or |
| 32 | // render to bitmap |
| 33 | uint32_t mStartX; |
| 34 | uint32_t mStartY; |
| 35 | uint32_t mBitmapWidth; |
| 36 | uint32_t mBitmapHeight; |
| 37 | // Also cache texture coords for the quad |
| 38 | float mBitmapMinU; |
| 39 | float mBitmapMinV; |
| 40 | float mBitmapMaxU; |
| 41 | float mBitmapMaxV; |
| 42 | // Minimize how much we call freetype |
| 43 | uint32_t mGlyphIndex; |
| 44 | uint32_t mAdvanceX; |
| 45 | uint32_t mAdvanceY; |
| 46 | // Values below contain a glyph's origin in the bitmap |
| 47 | int32_t mBitmapLeft; |
| 48 | int32_t mBitmapTop; |
| 49 | // Auto-kerning |
| 50 | SkFixed mLsbDelta; |
| 51 | SkFixed mRsbDelta; |
| 52 | CacheTexture* mCacheTexture; |
| 53 | }; |
| 54 | |
| 55 | }; // namespace uirenderer |
| 56 | }; // namespace android |
| 57 | |
| 58 | #endif // ANDROID_HWUI_CACHED_GLYPH_INFO_H |