skia2/include
fmalita 5776508126 Add a SkRWBuffer reserve mechanism
Currently, Chromium stores segmented data in a SharedBuffer and appends
to SkRWBuffer one segment at a time:

        const char* segment = 0;
        for (size_t length = data->getSomeData(segment, m_rwBuffer->size());
            length; length = data->getSomeData(segment, m_rwBuffer->size())) {
            m_rwBuffer->append(segment, length, remaining);
        }

This can yield a bunch of just-above-4k allocations => wasted RAM due to
internal fragmentation.

Ideally, we'd want a SkRWBuffer::reserve(size_t bytes) API, but the
current internals don't support that trivially.

Alternatively, the caller can pass a reserve hint at append() time.

BUG=chromium:651698
R=scroggo@google.com,reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2385803002

Review-Url: https://codereview.chromium.org/2385803002
2016-09-30 13:34:19 -07:00
..
android change SkStreams to work with sk_sp<SkData> instead of SkData* 2016-09-12 12:01:44 -07:00
animator Change SkTime::GetMSecs to double; ensure values stored in SkMSec do not overflow. 2016-03-25 12:59:53 -07:00
c spin off easy stuff from Herb's windows GN CL 2016-08-04 06:19:33 -07:00
codec Make SkPngCodec decode progressively. 2016-09-16 08:20:38 -07:00
config gyp/sfntly: set SK_SFNTLY_SUBSETTER uniformly 2016-08-24 12:28:38 -07:00
core Add a SkRWBuffer reserve mechanism 2016-09-30 13:34:19 -07:00
effects Gradients are serialized (and can be constructed) as SkColor4f + SkColorSpace 2016-09-28 11:27:28 -07:00
gpu Helper functions to do SkColor -> GrColor4f 2016-09-30 17:33:45 +00:00
images gn: fix fiddle 2016-08-02 11:13:49 -07:00
pathops Move SkTDArray to private. 2016-02-18 08:53:33 -08:00
ports Split SkFontConfigInterface globals and factory. 2016-09-19 12:13:16 -07:00
private Add a src rect to drawImageLattice() API 2016-09-30 12:41:42 -07:00
svg Delete the legacy SVG parser 2016-07-19 06:12:54 -07:00
utils abstract name of clipping ops, to transtion to a more restricted set 2016-09-20 08:42:39 -07:00
views Remove use of MakeRenderTargetDirect from view system 2016-07-28 15:17:34 -07:00
xml Initial SVG model 2016-07-26 18:46:34 -07:00