Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Issue 59073008: "Fix" bug in debug canvas (Closed)

Created:
7 years, 1 month ago by robertphillips
Modified:
7 years, 1 month ago
Reviewers:
junov1, Justin Novosad
CC:
skia-review_googlegroups.com, tomhudson, djsollen
Visibility:
Public.

Description

This addresses issue 1805 (Skia Debugger crashes when profiling SkPicture from chrome). The crux of the problem is that SkPicturePlayback::draw uses SkCanvas' quickRejectY method to cull clipped text. This can make the number of commands in the SkDebugCanvas substantially less then the number of commands in the captured skp - breaking a fundamental assumption of the debugger. This CL patches the problem by setting the debug canvas' clip region to be very large (thus thwarting quickRejectY's culling). I'm not in love with this solution (since it is very side-effecty) but it does limit the changes to the DebugCanvas. The alternative seems to be to add a flag to SkPicturePlayback to optionally disable all optimizations.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add comment and a debug-only check #

Total comments: 3

Patch Set 3 : switch from round to roundOut #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -0 lines) Patch
M src/utils/debugger/SkDebugCanvas.cpp View 1 2 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
robertphillips
7 years, 1 month ago (2013-11-06 16:23:50 UTC) #1
Tom Hudson
Driveby looks-good, although this is obviously a hack rather than an ideal fix. This stops ...
7 years, 1 month ago (2013-11-06 16:41:01 UTC) #2
robertphillips
To test this I disabled the proposed change and instead just disabled the quickRejectY calls ...
7 years, 1 month ago (2013-11-06 17:11:45 UTC) #3
Justin Novosad
Do we not encode the size of the picture in the skp? Why not use ...
7 years, 1 month ago (2013-11-06 18:01:55 UTC) #4
robertphillips
The debugger assumes that no operations are removed during the rendering into the DebugCanvas. To ...
7 years, 1 month ago (2013-11-06 18:58:48 UTC) #5
robertphillips
https://codereview.chromium.org/59073008/diff/1/src/utils/debugger/SkDebugCanvas.cpp File src/utils/debugger/SkDebugCanvas.cpp (right): https://codereview.chromium.org/59073008/diff/1/src/utils/debugger/SkDebugCanvas.cpp#newcode45 src/utils/debugger/SkDebugCanvas.cpp:45: largeIRect.inset(100, 100); The SkRect is converted to an SkIRect ...
7 years, 1 month ago (2013-11-06 18:59:15 UTC) #6
Justin Novosad
On 2013/11/06 18:59:15, robertphillips wrote: > https://codereview.chromium.org/59073008/diff/1/src/utils/debugger/SkDebugCanvas.cpp > File src/utils/debugger/SkDebugCanvas.cpp (right): > > https://codereview.chromium.org/59073008/diff/1/src/utils/debugger/SkDebugCanvas.cpp#newcode45 > ...
7 years, 1 month ago (2013-11-06 19:07:52 UTC) #7
Justin Novosad
On 2013/11/06 19:07:52, junov wrote: > On 2013/11/06 18:59:15, robertphillips wrote: > > > https://codereview.chromium.org/59073008/diff/1/src/utils/debugger/SkDebugCanvas.cpp ...
7 years, 1 month ago (2013-11-06 19:29:41 UTC) #8
robertphillips
Improved the hack.
7 years, 1 month ago (2013-11-06 19:46:30 UTC) #9
Justin Novosad
https://codereview.chromium.org/59073008/diff/120001/src/utils/debugger/SkDebugCanvas.cpp File src/utils/debugger/SkDebugCanvas.cpp (right): https://codereview.chromium.org/59073008/diff/120001/src/utils/debugger/SkDebugCanvas.cpp#newcode52 src/utils/debugger/SkDebugCanvas.cpp:52: large.round(&largeIRect); roundOut instead of round?
7 years, 1 month ago (2013-11-06 19:57:34 UTC) #10
robertphillips
https://codereview.chromium.org/59073008/diff/120001/src/utils/debugger/SkDebugCanvas.cpp File src/utils/debugger/SkDebugCanvas.cpp (right): https://codereview.chromium.org/59073008/diff/120001/src/utils/debugger/SkDebugCanvas.cpp#newcode52 src/utils/debugger/SkDebugCanvas.cpp:52: large.round(&largeIRect); Since it is BW, SkRasterClip::op just does a ...
7 years, 1 month ago (2013-11-06 20:07:50 UTC) #11
robertphillips
https://codereview.chromium.org/59073008/diff/120001/src/utils/debugger/SkDebugCanvas.cpp File src/utils/debugger/SkDebugCanvas.cpp (right): https://codereview.chromium.org/59073008/diff/120001/src/utils/debugger/SkDebugCanvas.cpp#newcode52 src/utils/debugger/SkDebugCanvas.cpp:52: large.round(&largeIRect); On 2013/11/06 19:57:35, junov wrote: > roundOut instead ...
7 years, 1 month ago (2013-11-06 20:40:21 UTC) #12
Justin Novosad
On 2013/11/06 20:40:21, robertphillips wrote: > https://codereview.chromium.org/59073008/diff/120001/src/utils/debugger/SkDebugCanvas.cpp > File src/utils/debugger/SkDebugCanvas.cpp (right): > > https://codereview.chromium.org/59073008/diff/120001/src/utils/debugger/SkDebugCanvas.cpp#newcode52 > ...
7 years, 1 month ago (2013-11-06 20:47:38 UTC) #13
robertphillips
7 years, 1 month ago (2013-11-07 22:20:57 UTC) #14
Message was sent while issue was closed.
committed as r12180

Powered by Google App Engine
This is Rietveld 408576698