OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
9 | 9 |
10 #include "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 size_t len, const SkPath& path, | 1715 size_t len, const SkPath& path, |
1716 const SkMatrix* m, const SkPaint& paint) { | 1716 const SkMatrix* m, const SkPaint& paint) { |
1717 CHECK_SHOULD_DRAW(draw, false); | 1717 CHECK_SHOULD_DRAW(draw, false); |
1718 | 1718 |
1719 SkASSERT(draw.fDevice == this); | 1719 SkASSERT(draw.fDevice == this); |
1720 draw.drawTextOnPath((const char*)text, len, path, m, paint); | 1720 draw.drawTextOnPath((const char*)text, len, path, m, paint); |
1721 } | 1721 } |
1722 | 1722 |
1723 /////////////////////////////////////////////////////////////////////////////// | 1723 /////////////////////////////////////////////////////////////////////////////// |
1724 | 1724 |
1725 bool SkGpuDevice::filterTextFlags(const SkPaint& paint, TextFlags* flags) { | 1725 bool SkGpuDevice::onDisableLCD(const SkPaint& paint) const { |
1726 if (!paint.isLCDRenderText()) { | |
1727 // we're cool with the paint as is | |
1728 return false; | |
1729 } | |
1730 | |
1731 if (paint.getShader() || | 1726 if (paint.getShader() || |
1732 paint.getXfermode() || // unless its srcover | 1727 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode) || |
1733 paint.getMaskFilter() || | 1728 paint.getMaskFilter() || |
1734 paint.getRasterizer() || | 1729 paint.getRasterizer() || |
1735 paint.getColorFilter() || | 1730 paint.getColorFilter() || |
1736 paint.getPathEffect() || | 1731 paint.getPathEffect() || |
1737 paint.isFakeBoldText() || | 1732 paint.isFakeBoldText() || |
1738 paint.getStyle() != SkPaint::kFill_Style) { | 1733 paint.getStyle() != SkPaint::kFill_Style) |
1739 // turn off lcd, but turn on kGenA8 | 1734 { |
1740 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; | |
1741 flags->fFlags |= SkPaint::kGenA8FromLCD_Flag; | |
1742 return true; | 1735 return true; |
1743 } | 1736 } |
1744 // we're cool with the paint as is | |
1745 return false; | 1737 return false; |
1746 } | 1738 } |
1747 | 1739 |
1748 void SkGpuDevice::flush() { | 1740 void SkGpuDevice::flush() { |
1749 DO_DEFERRED_CLEAR(); | 1741 DO_DEFERRED_CLEAR(); |
1750 fRenderTarget->prepareForExternalRead(); | 1742 fRenderTarget->prepareForExternalRead(); |
1751 } | 1743 } |
1752 | 1744 |
1753 /////////////////////////////////////////////////////////////////////////////// | 1745 /////////////////////////////////////////////////////////////////////////////// |
1754 | 1746 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 return true; | 1836 return true; |
1845 } | 1837 } |
1846 | 1838 |
1847 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1839 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1848 // We always return a transient cache, so it is freed after each | 1840 // We always return a transient cache, so it is freed after each |
1849 // filter traversal. | 1841 // filter traversal. |
1850 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1842 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1851 } | 1843 } |
1852 | 1844 |
1853 #endif | 1845 #endif |
OLD | NEW |