DescriptionFix minor undercounting in SkRecord::bytesUsed().
When an SkRecord has more than kInlineRecords ops in it (today, 5 or more), the
current logic undercounts the bytes used by the SkRecord by sizeof(Record) *
kInlineRecords, i.e. 32 bytes. This isn't a huge deal... by the time you've
recorded 5 ops, we're typically up around 1KB anyway, and it's only ever off by
that constant 32 bytes, so somewhere between 3% to 0% error as the picture grows.
But now that I've noticed, we might as well fix it. Basically, this is a
reminder that the inline space used to store those first kInlineRecords ops
goes to waste once we pass that threshold. In contrast, fInlineAlloc, the
space we preallocate for the SkVarAlloc, never goes to waste. It always holds
the first few ops' data even when we grow past it.
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/1dda2194e0c3a486032b2dd4d3eaea67fa47d818
Patch Set 1 #Patch Set 2 : add a comment #Messages
Total messages: 12 (5 generated)
|