SkFontLCDConfig.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright 2013 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. #ifndef SkFontLCDConfig_DEFINED
  8. #define SkFontLCDConfig_DEFINED
  9. #include "include/core/SkTypes.h"
  10. class SK_API SkFontLCDConfig {
  11. public:
  12. /** LCDs either have their color elements arranged horizontally or
  13. vertically. When rendering subpixel glyphs we need to know which way
  14. round they are.
  15. Note, if you change this after startup, you'll need to flush the glyph
  16. cache because it'll have the wrong type of masks cached.
  17. @deprecated use SkPixelGeometry instead.
  18. */
  19. enum LCDOrientation {
  20. kHorizontal_LCDOrientation = 0, //!< this is the default
  21. kVertical_LCDOrientation = 1,
  22. };
  23. /** @deprecated set on Device creation. */
  24. static void SetSubpixelOrientation(LCDOrientation orientation);
  25. /** @deprecated get from Device. */
  26. static LCDOrientation GetSubpixelOrientation();
  27. /** LCD color elements can vary in order. For subpixel text we need to know
  28. the order which the LCDs uses so that the color fringes are in the
  29. correct place.
  30. Note, if you change this after startup, you'll need to flush the glyph
  31. cache because it'll have the wrong type of masks cached.
  32. kNONE_LCDOrder means that the subpixel elements are not spatially
  33. separated in any usable fashion.
  34. @deprecated use SkPixelGeometry instead.
  35. */
  36. enum LCDOrder {
  37. kRGB_LCDOrder = 0, //!< this is the default
  38. kBGR_LCDOrder = 1,
  39. kNONE_LCDOrder = 2,
  40. };
  41. /** @deprecated set on Device creation. */
  42. static void SetSubpixelOrder(LCDOrder order);
  43. /** @deprecated get from Device. */
  44. static LCDOrder GetSubpixelOrder();
  45. };
  46. #endif