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

Issue 811303 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature

Blocked on:
issue skia:7612

Blocking:
issue 634542



Sign in to add a comment

Fix color type checks in canvas color management code

Project Member Reported by zakerinasab@chromium.org, Feb 12 2018

Issue description

There are a couple of locations in Blink->Canvas code that we use the linearity of the gamma transfer function to decide about the storage pixel format or color type. That is, when the color space is linear, we assume half float storage is used. This is incorrect, even though it works for now. It will fail when extended sRGB is added to the canvas proposal.

For software images, can do that by looking at the SkImageInfo of the SkPixmap of the SkImage. For GPU-backed images, it seems that there is no good way to do that.

Find a solution for GPU-backed images and fix the code accordingly.
 
Blocking: skia:7612
Blockedon: skia:7612
Blocking: -skia:7612
Labels: -Pri-2 Pri-3
Labels: -Pri-3 Pri-2
SkImage now has a colorType() member. We should be able to use this to fix this bug.
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 30 2018

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

commit fe3eeccd2c79596b24ab6bb62014068f92dec81d
Author: Reza.Zakerinasab <zakerinasab@chromium.org>
Date: Mon Apr 30 15:00:09 2018

Fix color type checks in canvas color management code

In canvas color management code we used gamma linearity
of the color space of the image to detect its color type.
This is not correct and can be fixed by using the new
SkImage::colorType() member function.

Bug:  811303 
Change-Id: I31584a6b0b5224f16d82184d1636f1349d350f3a
Reviewed-on: https://chromium-review.googlesource.com/1032853
Commit-Queue: Mohammad Reza Zakerinasab <zakerinasab@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554752}
[modify] https://crrev.com/fe3eeccd2c79596b24ab6bb62014068f92dec81d/third_party/blink/renderer/core/html/canvas/image_data.cc
[modify] https://crrev.com/fe3eeccd2c79596b24ab6bb62014068f92dec81d/third_party/blink/renderer/core/imagebitmap/image_bitmap.cc

Status: Fixed (was: Assigned)

Sign in to add a comment