From 3ac66e98f8701b8105a4c6ae85de61a9e8e5343a Mon Sep 17 00:00:00 2001 From: scroggo Date: Mon, 8 Feb 2016 15:09:48 -0800 Subject: Optionally run RAW images serially RAW images use a lot of memory. Add a new FLAG to run one at a time so we have less risk of running out of memory. Isolate RAW images to their own thread on particular devices where our images cause OOM errors. Locally, this drops the max memory use from 3945 MB to 1664 MB (running only --image --images ) BUG=skia:4912 BUG=skia:4878 BUG=b/27035849 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1681553003 Review URL: https://codereview.chromium.org/1681553003 --- dm/DMSrcSink.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dm/DMSrcSink.h') diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h index 64897d20bc..a987c7d45d 100644 --- a/dm/DMSrcSink.h +++ b/dm/DMSrcSink.h @@ -124,12 +124,14 @@ public: SkISize size() const override; Name name() const override; bool veto(SinkFlags) const override; + bool serial() const override { return fRunSerially; } private: Path fPath; Mode fMode; DstColorType fDstColorType; SkAlphaType fDstAlphaType; float fScale; + bool fRunSerially; }; class AndroidCodecSrc : public Src { @@ -147,12 +149,14 @@ public: SkISize size() const override; Name name() const override; bool veto(SinkFlags) const override; + bool serial() const override { return fRunSerially; } private: Path fPath; Mode fMode; CodecSrc::DstColorType fDstColorType; SkAlphaType fDstAlphaType; int fSampleSize; + bool fRunSerially; }; // Allows for testing of various implementations of Android's BitmapRegionDecoder -- cgit v1.2.3