Make SkROBuffer::Iter::size() work when exhausted
authorscroggo <scroggo@google.com>
Mon, 11 Jan 2016 14:38:00 +0000 (06:38 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 11 Jan 2016 14:38:00 +0000 (06:38 -0800)
commitb512aaa5c808bcb1336c147682657882ee54e652
treef41946ac736809519f55ce9b46ba5da98ed3331e
parent0b558cb42c6771b310520b2db41310c1da746f0c
Make SkROBuffer::Iter::size() work when exhausted

According to the documentation, this method will return 0 when the Iter
is exhausted. Prior to this CL, it crashes instead.

Prevent a crash with a null fHead, and add a test to verify the
behavior.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574603002

Review URL: https://codereview.chromium.org/1574603002
src/core/SkRWBuffer.cpp
tests/DataRefTest.cpp