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 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 | 1769 |
1770 SkDEBUGCODE(this->validate();) | 1770 SkDEBUGCODE(this->validate();) |
1771 | 1771 |
1772 if (!fTextContext->drawPosText(grPaint, paint, *draw.fMatrix, (const char *)
text, byteLength, | 1772 if (!fTextContext->drawPosText(grPaint, paint, *draw.fMatrix, (const char *)
text, byteLength, |
1773 pos, scalarsPerPos, offset)) { | 1773 pos, scalarsPerPos, offset)) { |
1774 // this will just call our drawPath() | 1774 // this will just call our drawPath() |
1775 draw.drawPosText_asPaths((const char*)text, byteLength, pos, scalarsPerP
os, offset, paint); | 1775 draw.drawPosText_asPaths((const char*)text, byteLength, pos, scalarsPerP
os, offset, paint); |
1776 } | 1776 } |
1777 } | 1777 } |
1778 | 1778 |
1779 void SkGpuDevice::drawTextOnPath(const SkDraw& draw, const void* text, | |
1780 size_t len, const SkPath& path, | |
1781 const SkMatrix* m, const SkPaint& paint) { | |
1782 CHECK_SHOULD_DRAW(draw); | |
1783 | |
1784 SkASSERT(draw.fDevice == this); | |
1785 draw.drawTextOnPath((const char*)text, len, path, m, paint); | |
1786 } | |
1787 | |
1788 /////////////////////////////////////////////////////////////////////////////// | 1779 /////////////////////////////////////////////////////////////////////////////// |
1789 | 1780 |
1790 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { | 1781 bool SkGpuDevice::onShouldDisableLCD(const SkPaint& paint) const { |
1791 if (paint.getShader() || | 1782 if (paint.getShader() || |
1792 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode) || | 1783 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode) || |
1793 paint.getMaskFilter() || | 1784 paint.getMaskFilter() || |
1794 paint.getRasterizer() || | 1785 paint.getRasterizer() || |
1795 paint.getColorFilter() || | 1786 paint.getColorFilter() || |
1796 paint.getPathEffect() || | 1787 paint.getPathEffect() || |
1797 paint.isFakeBoldText() || | 1788 paint.isFakeBoldText() || |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 #endif | 1895 #endif |
1905 } | 1896 } |
1906 | 1897 |
1907 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1898 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1908 // We always return a transient cache, so it is freed after each | 1899 // We always return a transient cache, so it is freed after each |
1909 // filter traversal. | 1900 // filter traversal. |
1910 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1901 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1911 } | 1902 } |
1912 | 1903 |
1913 #endif | 1904 #endif |
OLD | NEW |