diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-27 16:44:46 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-06-27 16:44:46 +0000 |
commit | effc5016f040945a53ab0ea47f9ea02404c17805 (patch) | |
tree | 137b3257bfcd83ec0d7b954507c11ecb30ad215b /include | |
parent | 67908f2faee17a8bce4d074980617cc0d15fabf1 (diff) |
remove obsolete text codepaths
git-svn-id: http://skia.googlecode.com/svn/trunk@1725 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/config/SkUserConfig.h | 12 | ||||
-rw-r--r-- | include/core/SkMask.h | 47 | ||||
-rw-r--r-- | include/core/SkScalerContext.h | 12 |
3 files changed, 7 insertions, 64 deletions
diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h index 80ecdb6433..0e82133a93 100644 --- a/include/config/SkUserConfig.h +++ b/include/config/SkUserConfig.h @@ -112,14 +112,10 @@ */ //#define SkDebugf(...) MyFunction(__VA_ARGS__) -/* To enable additional blitters (and fontscaler code) to support separate - alpha channels for R G B channels, define SK_SUPPORT_LCDTEXT - */ -//#define SK_SUPPORT_LCDTEXT - -/* Define this to pack glyphs using 8 bits per component instead of 5-6-5. - This will double the size of the font cache, but will produce fonts with - gray levels closer to the designer's intent. +/** + * Used only for lcdtext, define this to pack glyphs using 8 bits per component + * instead of 5-6-5. This can increase fidelity with the native font scaler, + * but doubles the RAM used by the font cache. */ //#define SK_SUPPORT_888_TEXT diff --git a/include/core/SkMask.h b/include/core/SkMask.h index ac495fcda3..d14fa59a71 100644 --- a/include/core/SkMask.h +++ b/include/core/SkMask.h @@ -28,31 +28,13 @@ struct SkMask { kBW_Format, //!< 1bit per pixel mask (e.g. monochrome) kA8_Format, //!< 8bits per pixel mask (e.g. antialiasing) k3D_Format, //!< 3 8bit per pixl planes: alpha, mul, add - - /* The LCD formats look like this in memory: - - First, there's an A8 plane which contains the average alpha value for - each pixel. Because of this, the LCD formats can be passed directly - to functions which expect an A8 and everything will just work. - - After that in memory, there's a bitmap of 32-bit values which have - been RGB order corrected for the current screen (based on the - settings in SkFontHost at the time of renderering). The alpha value - for each pixel is the maximum of the three alpha values. - - kHorizontalLCD_Format has an extra column of pixels on the left and right - edges. kVerticalLCD_Format has an extra row at the top and bottom. - */ - - kHorizontalLCD_Format, //!< 4 bytes/pixel: a/r/g/b - kVerticalLCD_Format, //!< 4 bytes/pixel: a/r/g/b kARGB32_Format, //!< SkPMColor kLCD16_Format, //!< 565 alpha for r/g/b kLCD32_Format //!< 888 alpha for r/g/b }; enum { - kCountMaskFormats = kVerticalLCD_Format + 1 + kCountMaskFormats = kLCD32_Format + 1 }; uint8_t* fImage; @@ -124,29 +106,6 @@ struct SkMask { return row + (x - fBounds.fLeft); } - /** Return an address into the 32-bit plane of an LCD or VerticalLCD mask - for the given position. - */ - const uint32_t* getAddrLCD(int x, int y) const { - SkASSERT(fFormat == kHorizontalLCD_Format || fFormat == kVerticalLCD_Format); - SkASSERT(fImage != NULL); - - return reinterpret_cast<const uint32_t*>(fImage + SkAlign4(fRowBytes * fBounds.height())) + - x - fBounds.fLeft + (y - fBounds.fTop) * rowWordsLCD(); - } - - /** Return the number of 32-bit words in a row of the 32-bit plane of an - LCD or VerticalLCD mask. - */ - unsigned rowWordsLCD() const { - SkASSERT(fFormat == kHorizontalLCD_Format || fFormat == kVerticalLCD_Format); - if (fFormat == kHorizontalLCD_Format) { - return fBounds.width() + 2; - } else { - return fBounds.width(); - } - } - static uint8_t* AllocImage(size_t bytes); static void FreeImage(void* image); @@ -155,10 +114,6 @@ struct SkMask { kJustRenderImage_CreateMode, //!< render into preallocate mask kComputeBoundsAndRenderImage_CreateMode //!< compute bounds, alloc image and render into it }; - - static bool FormatIsLCD(Format fm) { - return kHorizontalLCD_Format == fm || kVerticalLCD_Format == fm; - } }; #endif diff --git a/include/core/SkScalerContext.h b/include/core/SkScalerContext.h index d7b5eece12..f1898ebb0d 100644 --- a/include/core/SkScalerContext.h +++ b/include/core/SkScalerContext.h @@ -159,11 +159,6 @@ struct SkGlyph { } void toMask(SkMask* mask) const; - - /** Given a glyph which is has a mask format of LCD or VerticalLCD, take - the A8 plane in fImage and produce a valid LCD plane from it. - */ - void expandA8ToLCD() const; }; class SkScalerContext { @@ -181,7 +176,8 @@ public: kEmbolden_Flag = 0x80, kSubpixelPositioning_Flag = 0x100, kAutohinting_Flag = 0x200, - // these should only ever be set if fMaskFormat is LCD + + // these should only ever be set if fMaskFormat is LCD16 or LCD32 kLCD_Vertical_Flag = 0x400, // else Horizontal kLCD_BGROrder_Flag = 0x800, // else RGB order }; @@ -219,10 +215,6 @@ public: SkMask::Format getFormat() const { return static_cast<SkMask::Format>(fMaskFormat); } - - bool isLCD() const { - return SkMask::FormatIsLCD(this->getFormat()); - } }; SkScalerContext(const SkDescriptor* desc); |