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

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

Issue 372323003: Use stack allocation for Android data in SkScalerContext::MakeRec(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | 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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkPaint.h" 8 #include "SkPaint.h"
9 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkAutoKern.h" 10 #include "SkAutoKern.h"
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 rec.ignorePreBlend(); 1843 rec.ignorePreBlend();
1844 } 1844 }
1845 if (ra) { 1845 if (ra) {
1846 raBuffer.writeFlattenable(ra); 1846 raBuffer.writeFlattenable(ra);
1847 descSize += raBuffer.bytesWritten(); 1847 descSize += raBuffer.bytesWritten();
1848 entryCount += 1; 1848 entryCount += 1;
1849 rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion 1849 rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion
1850 } 1850 }
1851 1851
1852 #ifdef SK_BUILD_FOR_ANDROID 1852 #ifdef SK_BUILD_FOR_ANDROID
1853 SkWriteBuffer androidBuffer; 1853 char buffer[128];
1854 SkWriteBuffer androidBuffer(buffer, sizeof(buffer));
1854 fPaintOptionsAndroid.flatten(androidBuffer); 1855 fPaintOptionsAndroid.flatten(androidBuffer);
1855 descSize += androidBuffer.bytesWritten(); 1856 descSize += androidBuffer.bytesWritten();
1856 entryCount += 1; 1857 entryCount += 1;
1857 #endif 1858 #endif
1858 1859
1859 /////////////////////////////////////////////////////////////////////////// 1860 ///////////////////////////////////////////////////////////////////////////
1860 // Now that we're done tweaking the rec, call the PostMakeRec cleanup 1861 // Now that we're done tweaking the rec, call the PostMakeRec cleanup
1861 SkScalerContext::PostMakeRec(*this, &rec); 1862 SkScalerContext::PostMakeRec(*this, &rec);
1862 1863
1863 descSize += SkDescriptor::ComputeOverhead(entryCount); 1864 descSize += SkDescriptor::ComputeOverhead(entryCount);
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2743 } 2744 }
2744 #ifdef SK_BUILD_FOR_ANDROID 2745 #ifdef SK_BUILD_FOR_ANDROID
2745 if (dirty & kPaintOptionsAndroid_DirtyBit) { 2746 if (dirty & kPaintOptionsAndroid_DirtyBit) {
2746 SkPaintOptionsAndroid options; 2747 SkPaintOptionsAndroid options;
2747 options.unflatten(buffer); 2748 options.unflatten(buffer);
2748 paint->setPaintOptionsAndroid(options); 2749 paint->setPaintOptionsAndroid(options);
2749 } 2750 }
2750 #endif 2751 #endif
2751 SkASSERT(dirty == paint->fDirtyBits); 2752 SkASSERT(dirty == paint->fDirtyBits);
2752 } 2753 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698