adf7b330bd
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> |
||
---|---|---|
animations | ||
bench | ||
bin | ||
debugger | ||
dm | ||
example | ||
experimental | ||
fuzz | ||
gm | ||
gn | ||
include | ||
infra | ||
platform_tools | ||
resources | ||
samplecode | ||
site | ||
src | ||
tests | ||
third_party | ||
tools | ||
.clang-format | ||
.gitignore | ||
.gn | ||
AUTHORS | ||
BUILD.gn | ||
codereview.settings | ||
CONTRIBUTING | ||
CQ_COMMITTERS | ||
DEPS | ||
Doxyfile | ||
LICENSE | ||
PRESUBMIT.py | ||
public.bzl | ||
README | ||
README.chromium | ||
whitespace.txt |
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. See full details, and build instructions, at https://skia.org.