DescriptionMove releaseIfNeeded to start, since it can change bitmapIsDummy_
In SkiaBitLocker::cgContext()
We query the clip, which is empty, so we set clip_bounds to 0,0,1,1 (since CGBitmapContextCreate will fail for an empty width or height) and set bitmapIsDummy_ to true.
Then we call releaseIfNeeded(), which can change bitmapIsDummy_. In that case, back in cgContext() we are confused, and then call canvas_->temporary_internal_describeTopLayer() which can reset clip_bounds to empty... and thus CGBitmapContextCreate fails (unexpectedly).
The fix is to make the call to releaseIfNeeded() at the start of the function so any (hidden) mutations of fields is done before we start to set-and-use them.
BUG=620981
Committed: https://crrev.com/6acf5977b62cb3d5986e0be8c68994287be7569d
Cr-Commit-Position: refs/heads/master@{#400700}
Patch Set 1 #
Messages
Total messages: 15 (9 generated)
|