New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 601913 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Image decode tasks broke webview resourceless draw in play books

Project Member Reported by boliu@chromium.org, Apr 8 2016

Issue description

From b/28054004. Play Books 3.7.75 (latest public)

1) Open a book in Play Books.  Make sure the page is in fullscreen.
2) Tap the center of the text to pull back to a page-by-page scrubbing view.  Wait several seconds.
Observe: Bottom third of the text disappears. See screenshot.

Bisected to https://codereview.chromium.org/1772953002/, which is just a switch toggle.
 
screen.png
305 KB View Download

Comment 1 by boliu@chromium.org, Apr 8 2016

Wait.. did that get reverted on trunk recently..?
Cc: cblume@chromium.org enne@chromium.org ericrk@chromium.org
Labels: -Pri-1 -ReleaseBlock-Stable -M-51 M-52 Pri-2
The patch in question was recently reverted to be relanded after the branch cut, but I'll hold off enabling it until this is resolved. 

Is it possible to get a trace of this happening? I'm not really set up to trace webview/play books

Comment 4 by boliu@chromium.org, Apr 8 2016

Sure, trace with default categories? I'm gonna look at this a bit more too. What does this do, at a high level?
trace_books_601913.json
642 KB View Download
At a high level, this moves image decode control from Skia to the compositor. We always create image decode tasks that lock images for the duration of raster that follows. The raster happens through image hijack canvas that intercepts draw image calls and looks up the decoded image.

From the video on the b/ bug, it doesn't actually seem that there are any images, which is kind of weird. 
Can you get a trace with cc and all of cc.debug* enabled as well? There's a bunch of tracing in the image decode controller bug it's all in disabled-by-default categories.

Also this is doing SoftwareRenderer::DrawPictureQuad... Hmm.

Comment 7 by boliu@chromium.org, Apr 8 2016

> Also this is doing SoftwareRenderer::DrawPictureQuad... Hmm.

Webview's (infamous by now?) resourceless software draws. Trace attached
trace_books_ccdebug.json
11.5 MB View Download

Comment 8 by boliu@chromium.org, Apr 8 2016

Side question, I noticed that the frameviewer thingy in traces don't seem to work anymore on trunk, ie I can't find the frame divided into layers and tiles etc. Is that known/expected?
Infamous indeed :)

Hmm, nothing jumps out as being affected by images here to be honest. I will dig in a bit deeper next week. To be honest, I'd just start hacking up things (partially removing the image stuff) to see which part affects it. First, in raster source playback, I'd ensure we're not using image hijack canvas and see if that does anything.

I'll try that next week. 
I think there was a change in blink (maybe?) that broke it. I think ericrk@ found out the offending patch the other day. Eric, do you know if there's a bug tracking the frameviewer issue?
Cc: reed@google.com wkorman@chromium.org
So, long story short: it seems that unpacking the SkPicture into individual draw operations breaks this. This is something we're doing in the ImageHijackCanvas, which is why the problem is exposed when we enable this.

I got as far as looking at the rtree in skia. Specifically, if we enable the ImageHijackCanvas but comment out the following branch in skia, then everything works:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/skia/src/core/SkRecordDraw.cpp&l=21&sq=package:chromium&rcl=1460387938

My next step would be to figure out how that's different from the path we take where we don't unpack the picture. I think if we don't do any unpacking, we end up drawing all ops? If so, could this simply be a problem with the rtree data?

Comment 12 by reed@google.com, Apr 12 2016

Cc: mtkl...@chormium.org
Project Member

Comment 13 by bugdroid1@chromium.org, Apr 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7cb1a3b0e0aec2fad7b3f59b789cff12efa3dd12

commit 7cb1a3b0e0aec2fad7b3f59b789cff12efa3dd12
Author: vmpstr <vmpstr@chromium.org>
Date: Thu Apr 14 19:17:40 2016

cc: Ensure to reapply a shared canvas transform to image hijack canvas.

When we wrap a shared canvas in an image hijack canvas, it might already
have a transform applied to it. This transform is used to compute the
clip bounds for the canvas. However, since we're wrapping the canvas
into an image hijack canvas, its clip bounds can be different, since
it does not know about the transform on the raster canvas.

The fix to this is to ensure to apply the matrix to the hijack canvas
before attaching the raster canvas.

R=enne
BUG= 601913 
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1888613002

Cr-Commit-Position: refs/heads/master@{#387390}

[modify] https://crrev.com/7cb1a3b0e0aec2fad7b3f59b789cff12efa3dd12/cc/playback/raster_source.cc
[modify] https://crrev.com/7cb1a3b0e0aec2fad7b3f59b789cff12efa3dd12/cc/playback/raster_source_unittest.cc

Status: Fixed (was: Assigned)
boliu@, I think this is fixed if you wanted to test it. You'd have to enable image decode tasks as well.

Comment 15 by rmis...@google.com, Jun 13 2016

Cc: -mtkl...@chormium.org mtklein@chromium.org

Sign in to add a comment