[CSS Shapes] Image valued shape can fail

Correct the handling of image valued shapes that extend into or beyond the margin box. This can happen when object-fit causes one dimension of the shape to be greater than the corresponding margin box dimension.

Made some simplifications in RasterShapeIntervals::computeShapeMarginIntervals() by making the shapeMargin parameter an int, removing some unnecessary variables.

Revised the RasterShapeIntervals class. It's now a just a list of size() interval-lists, with valid indices: -offset() <= y < size() - offset(), or minY() to maxY(). If margin-top and shape-margin are specified, then offset() is the larger of shape-margin and margin-top. Similarly size() is the vertical size of the margin-box or the content-box expanded by shape-margin, whichever is larger. See computeShapeMarginIntervals().

BUG=339122

Review URL: https://codereview.chromium.org/189723010

git-svn-id: svn://svn.chromium.org/blink/trunk@168872 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make non-merged SharedBuffer instances able to be purgeable.

This is needed to make PNG images purgeable since the PNG decoder doesn't merge
the SharedBuffer's segments and discardable memory is only used for the flat
buffer (resulting from the merge).

BUG=290193

Review URL: https://codereview.chromium.org/190753010

git-svn-id: svn://svn.chromium.org/blink/trunk@168873 bbb929c8-8fbe-4397-9dbb-9b2b20218538