Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Side by Side Diff: src/core/SkPaint.cpp

Issue 137433003: Convert SkWriter32 to use an SkTDArray for its internal storage. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: of course 0's fine too... Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkOrderedWriteBuffer.cpp ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkAnnotation.h" 10 #include "SkAnnotation.h"
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1808 if (ignoreGamma) { 1808 if (ignoreGamma) {
1809 rec.setLuminanceColor(0); 1809 rec.setLuminanceColor(0);
1810 } 1810 }
1811 1811
1812 size_t descSize = sizeof(rec); 1812 size_t descSize = sizeof(rec);
1813 int entryCount = 1; 1813 int entryCount = 1;
1814 SkPathEffect* pe = this->getPathEffect(); 1814 SkPathEffect* pe = this->getPathEffect();
1815 SkMaskFilter* mf = this->getMaskFilter(); 1815 SkMaskFilter* mf = this->getMaskFilter();
1816 SkRasterizer* ra = this->getRasterizer(); 1816 SkRasterizer* ra = this->getRasterizer();
1817 1817
1818 SkOrderedWriteBuffer peBuffer(MIN_SIZE_FOR_EFFECT_BUFFER); 1818 SkOrderedWriteBuffer peBuffer, mfBuffer, raBuffer;
1819 SkOrderedWriteBuffer mfBuffer(MIN_SIZE_FOR_EFFECT_BUFFER);
1820 SkOrderedWriteBuffer raBuffer(MIN_SIZE_FOR_EFFECT_BUFFER);
1821 1819
1822 if (pe) { 1820 if (pe) {
1823 peBuffer.writeFlattenable(pe); 1821 peBuffer.writeFlattenable(pe);
1824 descSize += peBuffer.size(); 1822 descSize += peBuffer.size();
1825 entryCount += 1; 1823 entryCount += 1;
1826 rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion 1824 rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion
1827 // seems like we could support kLCD as well at this point... 1825 // seems like we could support kLCD as well at this point...
1828 } 1826 }
1829 if (mf) { 1827 if (mf) {
1830 mfBuffer.writeFlattenable(mf); 1828 mfBuffer.writeFlattenable(mf);
1831 descSize += mfBuffer.size(); 1829 descSize += mfBuffer.size();
1832 entryCount += 1; 1830 entryCount += 1;
1833 rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing with maskf ilters 1831 rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing with maskf ilters
1834 /* Pre-blend is not currently applied to filtered text. 1832 /* Pre-blend is not currently applied to filtered text.
1835 The primary filter is blur, for which contrast makes no sense, 1833 The primary filter is blur, for which contrast makes no sense,
1836 and for which the destination guess error is more visible. 1834 and for which the destination guess error is more visible.
1837 Also, all existing users of blur have calibrated for linear. */ 1835 Also, all existing users of blur have calibrated for linear. */
1838 rec.ignorePreBlend(); 1836 rec.ignorePreBlend();
1839 } 1837 }
1840 if (ra) { 1838 if (ra) {
1841 raBuffer.writeFlattenable(ra); 1839 raBuffer.writeFlattenable(ra);
1842 descSize += raBuffer.size(); 1840 descSize += raBuffer.size();
1843 entryCount += 1; 1841 entryCount += 1;
1844 rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion 1842 rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion
1845 } 1843 }
1846 1844
1847 #ifdef SK_BUILD_FOR_ANDROID 1845 #ifdef SK_BUILD_FOR_ANDROID
1848 SkOrderedWriteBuffer androidBuffer(128); 1846 SkOrderedWriteBuffer androidBuffer;
1849 fPaintOptionsAndroid.flatten(androidBuffer); 1847 fPaintOptionsAndroid.flatten(androidBuffer);
1850 descSize += androidBuffer.size(); 1848 descSize += androidBuffer.size();
1851 entryCount += 1; 1849 entryCount += 1;
1852 #endif 1850 #endif
1853 1851
1854 /////////////////////////////////////////////////////////////////////////// 1852 ///////////////////////////////////////////////////////////////////////////
1855 // Now that we're done tweaking the rec, call the PostMakeRec cleanup 1853 // Now that we're done tweaking the rec, call the PostMakeRec cleanup
1856 SkScalerContext::PostMakeRec(*this, &rec); 1854 SkScalerContext::PostMakeRec(*this, &rec);
1857 1855
1858 descSize += SkDescriptor::ComputeOverhead(entryCount); 1856 descSize += SkDescriptor::ComputeOverhead(entryCount);
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2579 case SkXfermode::kPlus_Mode: 2577 case SkXfermode::kPlus_Mode:
2580 return 0 == this->getAlpha(); 2578 return 0 == this->getAlpha();
2581 case SkXfermode::kDst_Mode: 2579 case SkXfermode::kDst_Mode:
2582 return true; 2580 return true;
2583 default: 2581 default:
2584 break; 2582 break;
2585 } 2583 }
2586 } 2584 }
2587 return false; 2585 return false;
2588 } 2586 }
OLDNEW
« no previous file with comments | « src/core/SkOrderedWriteBuffer.cpp ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698