New issue
Advanced search Search tips

Issue 728599 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

Improve subpixel in paintWorklet

Project Member Reported by xidac...@chromium.org, Jun 1 2017

Issue description

The first step is to expose a backingStorePixelRatio API in the PaintRenderingContext2D, the ratio should be calculated based on the csspixels vs backingstorepixels.

Once that is done, we need to look into the subpixel problems, where in the cases that we round the pixels.
 
In CSSPaintDefinition::Paint, the zoom is calculated from StyleRef. Instead of doing that, we should probably passing two sizes in this function, where the current implementation has only one size which is in css pixels. We should be able to get the native size in the BoxPainter, and then the ratio between native size vs css pixels will be the backingStorePixelRatio.
Cc: flackr@chromium.org
Components: Blink>Paint
Labels: Hotlist-ThreadedRendering
Labels: BugSource-Team PaintTeamTriaged-20170608
It is decided here: https://github.com/w3c/css-houdini-drafts/issues/436, that we would only need to expose the device scale factor, and no need for sub pixel accumulation.
Project Member

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

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

commit 429cd7c7bf7d4f1d94bc570312ce95a8e86268e5
Author: Xida Chen <xidachen@chromium.org>
Date: Tue Aug 15 15:01:57 2017

Add devicePixelRatio to PaintWorkletGlobalScope

In this CL, we add the devicePixelRatio property to the
PaintWorkletGlobalScope.idl. This property could be useful for 
developers to draw perfect graphics on high DPI devices.

A test is added to ensure that this property has the same value as the
window.devicePixelRatio.

Bug:  728599 
Change-Id: Ia6179164989d4f564df06a87f1399adff19a0599
Reviewed-on: https://chromium-review.googlesource.com/602367
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494379}
[modify] https://crrev.com/429cd7c7bf7d4f1d94bc570312ce95a8e86268e5/third_party/WebKit/LayoutTests/VirtualTestSuites
[add] https://crrev.com/429cd7c7bf7d4f1d94bc570312ce95a8e86268e5/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/hidpi/device-pixel-ratio-ref.html
[add] https://crrev.com/429cd7c7bf7d4f1d94bc570312ce95a8e86268e5/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/hidpi/device-pixel-ratio.html
[modify] https://crrev.com/429cd7c7bf7d4f1d94bc570312ce95a8e86268e5/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
[add] https://crrev.com/429cd7c7bf7d4f1d94bc570312ce95a8e86268e5/third_party/WebKit/LayoutTests/virtual/scalefactor200/external/wpt/css-paint-api/hidpi/README.txt
[modify] https://crrev.com/429cd7c7bf7d4f1d94bc570312ce95a8e86268e5/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
[modify] https://crrev.com/429cd7c7bf7d4f1d94bc570312ce95a8e86268e5/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
[modify] https://crrev.com/429cd7c7bf7d4f1d94bc570312ce95a8e86268e5/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.idl

Status: Fixed (was: Assigned)

Sign in to add a comment