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

Issue 683787 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Canvas regression: Blank canvas with putImageData

Reported by acmesqua...@gmail.com, Jan 23 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0

Steps to reproduce the problem:
putImageData to a canvas context using {alpha:false}

What is the expected behavior?
ImageData is drawn to canvas (Ignoring transparency)

What went wrong?
Canvas is black

Did this work before? Yes 56.0.2924.67 beta (64-bit)

Does this work in other browsers? Yes

Chrome version: 57.0.2986.0 dev (64-bit)  Channel: dev
OS Version: 
Flash Version:
 
canvas_regression.html
407 bytes View Download
Labels: Needs-Triage-M57
Cc: robertphillips@chromium.org msarett@chromium.org
Labels: -Pri-2 -Needs-Triage-M57 hasbisect-per-revision M-58 OS-Mac OS-Windows Pri-1
Owner: bsalo...@google.com
Status: Assigned (was: Unconfirmed)
Able to reproduce the issue on windows-7,  Mac 10.12.2 and Linux Ubuntu-14.04 using chrome canary 58.0.2989.0

This is regression issue broken in M57. Please find the bisect information as below

Narrow Bisect::
===============
Good :57.0.2985.0 --   (build revision 444244)
Bad:: 57.0.2986.0 --   (build revision 444600)

ChangeLog: 
================

https://chromium.googlesource.com/chromium/src/+log/576c8fd139e3308796d3a0f1a0b859cbc3c0d5ea..24a43afbe8773249e2ad7552bba40a07da528539

Possible suspect
==================

https://skia.googlesource.com/skia.git/+/92ce5946855aa8d55bb4a0dd0a47d58746d67d0a	


Brian Salomon @ could you please look into this issue if it is related to your change,else please help us in finding the appropriate owner for this issue.

Thanks,

It seems like this is most likely:

https://skia-review.googlesource.com/c/7121/ (SkImageInfoValidConversion (part 2))

but it could also be:

https://skia-review.googlesource.com/c/7172/ (Move read/write-Pixels up to GrSurfaceContext)

Cc: -msarett@chromium.org bsalo...@google.com
Owner: msarett@chromium.org
This looks to have been caused my change.  I'll look into it.
Cc: fmalita@chromium.org reed@chromium.org junov@chromium.org
I'm planning to land and cherry-pick an immediate fix:
https://skia-review.googlesource.com/c/7374/

But I think it'd be good to discuss how we expect to behave when writing/drawing non-opaque pixels (src) to an opaque surface (dst).

First, what is the expected behavior from the canvas API?   Chrome seems to force the src alpha values to one (which is funny because I don't think Skia does this) - see that putImageData-test draws a red square in Chrome.  Firefox seems to premultiply or blend with src alphas - see that putImageData-test draws a black square (and the original test is a darker gray).

Second, how should Skia behave?
(1) I believe that the old behavior was "undefined" - but most of the time that meant treating the src alpha as 0xFF even if it wasn't.  Opaque is an optimization hint "guaranteeing" that pixel alphas are 0xFF.
(2) I've tried to just make non-opaque->opaque illegal in readPixels()/writePixels(), which is at least well-defined...  But inconsistent with drawing behavior.
(3) Another option is to actually force all the alphas to 0xFF - this is more work for Skia and a performance cost, but seems to match how Chrome behaves now.

Adding junov@, reed@, and fmalita@ for thoughts.
Attaching the test referenced in #5.
putImageData-test.html
456 bytes View Download
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 23 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia.git/+/bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb

commit bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb
Author: Matt Sarett <msarett@google.com>
Date: Mon Jan 23 14:41:08 2017

Allow conversion from non-opaque to opaque

BUG:683787

Change-Id: I1b78cc8d1b5d3917a2a952da036b93022e99e053
Reviewed-on: https://skia-review.googlesource.com/7374
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

[modify] https://crrev.com/bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb/src/core/SkImageInfoPriv.h

Labels: Merge-Request-57
Project Member

Comment 9 by sheriffbot@chromium.org, Jan 24 2017

Labels: -Merge-Request-57 Hotlist-Merge-Approved Merge-Approved-57
Your change meets the bar and is auto-approved for M57. Please go ahead and merge the CL to branch 2987 manually. Please contact milestone owner if you have questions.
Owners: amineer@(clank), cmasso@(bling), ketakid@(cros), govind@(desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Please merge your change to M57 branch 2987 ASAP so we can pick it up for this week dev release. Thank you.
Project Member

Comment 11 by bugdroid1@chromium.org, Jan 24 2017

Labels: merge-merged-m57
The following revision refers to this bug:
  https://skia.googlesource.com/skia.git/+/e3917fd5ca950222facf027a73d95c8339bced54

commit e3917fd5ca950222facf027a73d95c8339bced54
Author: Matt Sarett <msarett@google.com>
Date: Mon Jan 23 14:41:08 2017

Allow conversion from non-opaque to opaque [chrome/m57]

BUG:683787

Change-Id: I1b78cc8d1b5d3917a2a952da036b93022e99e053
Reviewed-on: https://skia-review.googlesource.com/7374
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
(cherry picked from commit bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb)
Reviewed-on: https://skia-review.googlesource.com/7402

[modify] https://crrev.com/e3917fd5ca950222facf027a73d95c8339bced54/src/core/SkImageInfoPriv.h

Status: Fixed (was: Assigned)
Labels: -Merge-Approved-57
Per comment #11 this is already merged to M57. Hence removing "Merge-Approved-57" label.
Project Member

Comment 14 by bugdroid1@chromium.org, Feb 6 2017

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

commit bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb
Author: Matt Sarett <msarett@google.com>
Date: Mon Jan 23 15:47:42 2017

Allow conversion from non-opaque to opaque

BUG:683787

Change-Id: I1b78cc8d1b5d3917a2a952da036b93022e99e053
Reviewed-on: https://skia-review.googlesource.com/7374
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

[modify] https://crrev.com/bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb/src/core/SkImageInfoPriv.h

Project Member

Comment 15 by bugdroid1@chromium.org, Feb 6 2017

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

commit a8f413927951e1b6e6c791526da3c92bc45639e2
Author: Matt Sarett <msarett@google.com>
Date: Mon Feb 06 19:03:54 2017

Revert "Allow conversion from non-opaque to opaque"

This reverts commit bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb.

Reason for revert: I believe I've fixed all the call sites,
so this is now ok.

Original change's description:
> Allow conversion from non-opaque to opaque
> 
> BUG:683787
> 
> Change-Id: I1b78cc8d1b5d3917a2a952da036b93022e99e053
> Reviewed-on: https://skia-review.googlesource.com/7374
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
> 

TBR=msarett@google.com,robertphillips@google.com,reviews@skia.org
# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I2369c9b81321ca83a7063bb85e66ddbc03914d2b
Reviewed-on: https://skia-review.googlesource.com/8073
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>

[modify] https://crrev.com/a8f413927951e1b6e6c791526da3c92bc45639e2/src/core/SkImageInfoPriv.h

Project Member

Comment 16 by bugdroid1@chromium.org, Feb 6 2017

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

commit a8f413927951e1b6e6c791526da3c92bc45639e2
Author: Matt Sarett <msarett@google.com>
Date: Mon Feb 06 19:03:54 2017

Revert "Allow conversion from non-opaque to opaque"

This reverts commit bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb.

Reason for revert: I believe I've fixed all the call sites,
so this is now ok.

Original change's description:
> Allow conversion from non-opaque to opaque
> 
> BUG:683787
> 
> Change-Id: I1b78cc8d1b5d3917a2a952da036b93022e99e053
> Reviewed-on: https://skia-review.googlesource.com/7374
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
> 

TBR=msarett@google.com,robertphillips@google.com,reviews@skia.org
# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I2369c9b81321ca83a7063bb85e66ddbc03914d2b
Reviewed-on: https://skia-review.googlesource.com/8073
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>

[modify] https://crrev.com/a8f413927951e1b6e6c791526da3c92bc45639e2/src/core/SkImageInfoPriv.h

Sign in to add a comment