diff options
author | 2014-07-08 11:15:48 -0700 | |
---|---|---|
committer | 2014-07-08 11:15:48 -0700 | |
commit | 65b6fa177798089a3556643f765fbbca5a4a5185 (patch) | |
tree | 3d80771037e66504faf555b5b9a18458e70615c6 /src/core/SkPaint.cpp | |
parent | 0a65e385603f9f35d7cc0447bfad419f647e7c1e (diff) |
Use stack allocation for Android data in SkScalerContext::MakeRec().
In a perfvis run on the "Boogie" test page, descriptorProc() during
detachCache() was taking .721 ms, and 20% of that was the flatten() in
MakeRec(). Changing this to a smaller stack allocation reduces the time
for descriptorProc() to .556 ms.
R=reed@google.com, bsalomon@google.com
Author: jvanverth@google.com
Review URL: https://codereview.chromium.org/372323003
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r-- | src/core/SkPaint.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 4c4d2489a2..62db71445e 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -1850,7 +1850,8 @@ void SkPaint::descriptorProc(const SkDeviceProperties* deviceProperties, } #ifdef SK_BUILD_FOR_ANDROID - SkWriteBuffer androidBuffer; + char buffer[128]; + SkWriteBuffer androidBuffer(buffer, sizeof(buffer)); fPaintOptionsAndroid.flatten(androidBuffer); descSize += androidBuffer.bytesWritten(); entryCount += 1; |