Go to file
Mike Klein adf7b330bd 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>
2017-03-24 15:58:50 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Find cubic KLM functionals directly 2017-03-23 21:05:45 +00:00
bin bin/fetch-clang-format 2017-03-08 16:43:49 +00:00
debugger Get Debugger app compiling again 2017-01-06 16:18:27 +00:00
dm Eager or Lazy evaluation of sub-drawings for SkDeferredCanvas. 2017-03-20 15:15:33 +00:00
example Add the ability to enable/disable GPU path renderers 2017-02-22 20:29:56 +00:00
experimental Mark overridden destructors with 'override' and remove 'virtual' 2017-03-22 16:06:18 +00:00
fuzz FuzzCanvas: NullGL & DebugGL 2017-03-21 20:30:38 +00:00
gm Create new inset algorithm for spot shadows 2017-03-24 14:56:01 +00:00
gn Create new inset algorithm for spot shadows 2017-03-24 14:56:01 +00:00
include Add SkTransferFunctionBehavior flag: Use in codec and encoder 2017-03-24 13:19:53 +00:00
infra Remove tests from blacklist for Vk AMD 2017-03-23 19:36:33 +00:00
platform_tools One-liner fix that allows Viewer to switch between Raster and OpenGL 2017-02-23 22:33:36 +00:00
resources Set a limit on the size for BMP images 2017-02-24 21:25:44 +00:00
samplecode Create new inset algorithm for spot shadows 2017-03-24 14:56:01 +00:00
site Add docs for iOS simulator build. 2017-03-21 17:12:46 +00:00
src Create new inset algorithm for spot shadows 2017-03-24 14:56:01 +00:00
tests Create new inset algorithm for spot shadows 2017-03-24 14:56:01 +00:00
third_party Turn on x86-specific code when building zlib. 2017-03-23 13:36:31 +00:00
tools ok: fix an assert from unbalanced save/restores 2017-03-24 15:58:50 +00:00
.clang-format Mark flatennable macros as block beginning/ending in .clang-format 2017-01-09 15:31:36 +00:00
.gitignore bin/fetch-clang-format 2017-03-08 16:43:49 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Added support for building for tvOS 2017-03-14 22:55:04 +00:00
BUILD.gn ok 2017-03-23 18:04:36 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Update build tools to newer gn. 2017-03-17 17:38:58 +00:00
Doxyfile Make the housekeeper upload doxygen to a newer bucket 2016-10-04 13:23:57 -07:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
PRESUBMIT.py Clean up more references to GYP. 2017-02-06 17:55:35 +00:00
public.bzl remove SK_SUPPORT_LEGACY_DRAWVERTICES_VIRTUAL flag 2017-03-21 10:11:35 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
whitespace.txt Skia Gerrit 10k! 2017-03-22 14:37:06 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.