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

Issue 703363 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 701942



Sign in to add a comment

Rasterized content chopped off when using SkCreateColorSpaceXformCanvas

Project Member Reported by ccameron@chromium.org, Mar 20 2017

Issue description

When running Chrome with --enable-color-correct-rendering, only the first few tiles of content end up being rendered -- the rest are blank.

See attached images -- disabled.png is with no flags and enabled.png is with --enable-color-correct-rednering. Both are with --show-composited-layer-borders. This happens (in one form or another) with and without GPU raster.

The difference in code is whether or not "target_color_space.IsValid()" returns true or false at
https://cs.chromium.org/chromium/src/cc/raster/raster_source.cc?rcl=f7f370dba5703b1df78ae7a6bc54b498fcd18589&l=201

This may be a bug in SkCreateColorSpaceXformCanvas, or it may be a bug in Chrome's use of it.
 
disabled.png
226 KB View Download
enabled.png
83.3 KB View Download
Cc: mtklein@chromium.org
Cc: -mtklein@chromium.org ccameron@chromium.org
Owner: mtklein@chromium.org
I bet this is SkColorSpaceXformCanvas neglecting to tell its SkCanvas part about clips.  I always forget that those virtuals replace the SkCanvas ones, not just FYI hooks like the other state change methods (save, restore, matrix changes, etc).
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 21 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/1683f786cadf57a56fb1983ab8bb6df91c50d0ef

commit 1683f786cadf57a56fb1983ab8bb6df91c50d0ef
Author: Mike Klein <mtklein@chromium.org>
Date: Tue Mar 21 13:55:20 2017

Have SkColorSpaceXformCanas tell SkCanvas about clips.

This should make queries like SkCanvas::getLocalClipBounds() work.

BUG= chromium:703363 

Change-Id: I1d8a39880152ba1da99cc8b289072ef747271bc8
Reviewed-on: https://skia-review.googlesource.com/9915
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

[modify] https://crrev.com/1683f786cadf57a56fb1983ab8bb6df91c50d0ef/src/core/SkColorSpaceXformCanvas.cpp

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 21 2017

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

commit 926bcd0f17209ee4f86d4234a41a62736f86dc81
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Tue Mar 21 15:35:10 2017

Roll src/third_party/skia/ 3130fbb1a..1683f786c (11 commits)

https://skia.googlesource.com/skia.git/+log/3130fbb1a7aa..1683f786cadf

$ git log 3130fbb1a..1683f786c --date=short --no-merges --format='%ad %ae %s'
2017-03-20 mtklein Have SkColorSpaceXformCanas tell SkCanvas about clips.
2017-03-20 benjaminwagner Enable GLES on Intel Linux bots.
2017-03-21 robertphillips rename makeCopyForTextureParams to isACopyNeededForTextureParams
2017-03-21 robertphillips Revert "Make SkImage_Gpu be deferred"
2017-03-20 bsalomon Attempt to fix AMD ANGLE bots.
2017-03-21 borenet Followup fixes for recipe roll
2017-03-20 brianosman readpixels GM uses GPU image in GPU configs
2017-03-20 msarett Add support for F32 sources to SkColorSpaceXform
2017-03-21 robertphillips Add pre-Flush callback to GrDrawingManager (take 2)
2017-03-20 robertphillips Make SkImage_Gpu be deferred
2017-03-20 borenet Roll Recipe DEPS

Created with:
  roll-dep src/third_party/skia
BUG= 703363 


Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
TBR=fmalita@chromium.org

Change-Id: Ice2b5600e205fd5fb5cd166baa028a7299e7b4ae
Reviewed-on: https://chromium-review.googlesource.com/457477
Reviewed-by: Skia Deps Roller <skia-deps-roller@chromium.org>
Commit-Queue: Skia Deps Roller <skia-deps-roller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#458422}
[modify] https://crrev.com/926bcd0f17209ee4f86d4234a41a62736f86dc81/DEPS

Just gave this a try after the roll, and I'm still seeing the issue.
Is there anything I can do to help move this forward?

ToT is still cropping content like in the attached enabled.png.

Comment 7 by msar...@google.com, Mar 27 2017

I'll take a look tomorrow.  Can you share test-inf.html?  Or is this obvious on most web pages (I'm still compiling ToT)?
Attached (but any page should do). To see it, run with the flag --enable-color-correct-rendering.
test-inf.html
39.6 KB View Download

Comment 9 by msar...@google.com, Mar 30 2017

The following CL will fix this:
https://skia-review.googlesource.com/c/10806/

Our test suite currently assumes that SkColorSpaceXform wraps a brand new SkCanvas.  But it's clear that, where this is used in Chrome, the wrapped canvas has already accumulated some state.

ImageHijackCanvas has a similar problem, and also solves it by passing on the clip and the matrix.
https://cs.chromium.org/chromium/src/cc/raster/raster_source.cc?q=ImageHijack&l=97

We could potentially handle this similarly (on the Chrome side), but I think it makes more sense for the xform canvas to automatically assume the state of the wrapped canvas.

Fixing on the Chrome side is also tricky because, if (for example) we call setDeviceClipBounds() on the xform canvas, we need to avoid forwarding that call to the wrapped canvas... but we definitely do want to forward any future clip calls.
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 30 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/9969e7714110253371153e114625f9e5381a1a8b

commit 9969e7714110253371153e114625f9e5381a1a8b
Author: Matt Sarett <msarett@google.com>
Date: Thu Mar 30 22:15:21 2017

SkColorSpaceXformCanvas: setMatrix(), clipRect() in constructor

BUG= 703363 
Change-Id: Ie0053940dd041614b93400e34145118fb0742cae

Change-Id: Ie0053940dd041614b93400e34145118fb0742cae
Reviewed-on: https://skia-review.googlesource.com/10806
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>

[modify] https://crrev.com/9969e7714110253371153e114625f9e5381a1a8b/src/core/SkColorSpaceXformCanvas.cpp

Project Member

Comment 11 by bugdroid1@chromium.org, Mar 31 2017

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

commit 630ff6b6277d73253d16714f0b45daebf8d511c8
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Fri Mar 31 00:29:06 2017

Roll src/third_party/skia/ 609e7ccc6..9969e7714 (6 commits)

https://skia.googlesource.com/skia.git/+log/609e7ccc664f..9969e7714110

$ git log 609e7ccc6..9969e7714 --date=short --no-merges --format='%ad %ae %s'
2017-03-30 msarett SkColorSpaceXformCanvas: setMatrix(), clipRect() in constructor
2017-03-30 msarett Add more overrides to SkColorSpaceXformCanvas
2017-03-29 mtklein Turn on SkJumper all the time, try 2.
2017-03-30 ethannicholas fixed skslc SPIR-V memory error
2017-03-30 kjlubick Add Linux HD2000 jobs
2017-03-30 benjaminwagner Remove Galaxy J5 bot.

Created with:
  roll-dep src/third_party/skia
BUG= 703363 


Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=stephana@chromium.org

Change-Id: Ib1f36126d50463c7e3ad5e709641dbc5933de77d
Reviewed-on: https://chromium-review.googlesource.com/464108
Reviewed-by: Skia Deps Roller <skia-deps-roller@chromium.org>
Commit-Queue: Skia Deps Roller <skia-deps-roller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#460952}
[modify] https://crrev.com/630ff6b6277d73253d16714f0b45daebf8d511c8/DEPS

Status: Fixed (was: Assigned)
Verified at ToT.
Project Member

Comment 13 by bugdroid1@chromium.org, Apr 3 2017

Labels: merge-merged-o-release
The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/9bb14c87d4b7a62b6e2a83ef8a3418f96ddc85b4

commit 9bb14c87d4b7a62b6e2a83ef8a3418f96ddc85b4
Author: Matt Sarett <msarett@google.com>
Date: Mon Apr 03 21:07:12 2017

SkColorSpaceXformCanvas: setMatrix(), clipRect() in constructor

BUG= 703363 
Change-Id: Ie0053940dd041614b93400e34145118fb0742cae

Change-Id: Ie0053940dd041614b93400e34145118fb0742cae
Reviewed-on: https://skia-review.googlesource.com/10806
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
(cherry picked from commit 9969e7714110253371153e114625f9e5381a1a8b)
Reviewed-on: https://skia-review.googlesource.com/11181
Reviewed-by: Matt Sarett <msarett@google.com>

[modify] https://crrev.com/9bb14c87d4b7a62b6e2a83ef8a3418f96ddc85b4/src/core/SkColorSpaceXformCanvas.cpp

Sign in to add a comment