Fix DM race in SVGSrc
authorfmalita <fmalita@chromium.org>
Tue, 8 Nov 2016 15:13:45 +0000 (07:13 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 8 Nov 2016 15:13:45 +0000 (07:13 -0800)
commitacd2f5cddc631d5008a04da483d630968df307c9
treec0e57e4d5c07d2762f2d6bebe096a80be51e3866
parent9075634d60cc8ce979e3007d4ba1d0e57afc6644
Fix DM race in SVGSrc

The SVG source currently attempts to build the DOM lazily, in response
to draw() or size() calls.  But apprently DM may call these
concurrently.

Build the DOM in the constructor instead, to avoid races (and the need
for synchronization).

R=robertphillips@google.com,mtklein@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2482123003

Review-Url: https://codereview.chromium.org/2482123003
dm/DMSrcSink.cpp
dm/DMSrcSink.h