aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/utils.gni
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-03-23 18:57:59 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-24 15:58:50 +0000
commitadf7b330bde6ddb03c888143f16cb3b04c074ebd (patch)
tree4e1981c05341919dee61dbff7e8b44ac420a06d5 /gn/utils.gni
parent61e990297a5c47a82321994e8a34ea56e3137f24 (diff)
ok: fix an assert from unbalanced save/restores
The 'dont_clip_to_layer' GM does not balance its layers. It calls saveLayer() 3x but restore() only 2x. This may be a bug in the GM itself, but I'm not sure so I haven't changed it here. If ok is writing .pngs, the surface passes ownership of its buffer to an image snapshot, simply marking it as immutable. Then, when the surface is destroyed later, it destroys its inner canvas, which restores its save stack to zero, actually doing some drawing in the case of unbalanced saveLayer()s. We then call notifyPixelsChanged() and hit an assert saying "you just wrote some pixels but this buffer was marked immutable." DM doesn't show this problem because it's doesn't really use surfaces and images, just bitmaps. There's no ownership handoff and nothing is ever immutable, so the condition triggering the assert never comes up. I'm not really sure where we want to say is the bug: - SkCanvas can draw in its destructor? - SkSurface doesn't restore to zero before snapping an image? - that dont_clip_to_layer should call restore three times? In any case, this guards against it in ok. I was using this as a convenient crash to help figure out how to best save and print stack traces, but now that I've got that worked out we might as well fix this. Change-Id: Id6d397f534dd1b50219e0d3078c989a4910883a6 Reviewed-on: https://skia-review.googlesource.com/10140 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn/utils.gni')
0 files changed, 0 insertions, 0 deletions