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

Issue 780406 link

Starred by 2 users

Issue metadata

Status: Assigned
Merged: issue 676636
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Compat



Sign in to add a comment

Can not display large image with gpu rasterization

Reported by zljj0...@gmail.com, Nov 1 2017

Issue description

Example URL:

Steps to reproduce the problem:
visit the tao.html in attachement

What is the expected behavior?
image display normal

What went wrong?
can not display image with background-position: xpx, 0; but OK with background-position: x%, 0

Does it occur on multiple sites: N/A

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 61.0.3163.98  Channel: stable
OS Version: 8.0
Flash Version: 

1. image size: 23200x600
2. OK using cpu rasterization

ps:if use background-position: xpx 0, it's draw command using SkCanvas::drawRect, and can not upload texture successfully; if use background-position: x%, 0, it's draw command is SkCanvas::drawImageRect, and SkGpuDevice::drawTiledBitmap, so it's OK.
 
tao.html
3.8 KB View Download
Cc: sandeepkumars@chromium.org
Labels: Needs-triage-Mobile Triaged-Mobile Needs-Feedback
@zljj0818: Thanks for the report!!

Could you please upgrade your Chrome to the latest version #62.0.3202.73 when the update is available for you and check your issue is fixed or not?

Fix has already been landed in #62.0.3202.73 as could observe both Window and document options are having same size (window: 412, 604, document: 412, 604)) in Android 8.1.0 Pixel XL Build/OPM1.171019.007

Thanks!!

Comment 2 by zljj0...@gmail.com, Nov 2 2017

@sandeepkumars:
hi, i tried #62.0.3202.73, but issue still exist. Plsease see the attachments,
cpu_raster.png is right effect, gpu_raster.png is wrong, the different is the image below can not display with gpu rasterization.

and i debugged chromium, found that:
if use background-position: xpx 0, it's draw command using SkCanvas::drawRect, and can not upload texture successfully; if use background-position: x%, 0, it's draw command is SkCanvas::drawImageRect, and SkGpuDevice::drawTiledBitmap, so it's OK.

Please confirm it. Thank you.
version.png
232 KB View Download
gpu_raster.png
72.4 KB View Download
cpu_raster.png
89.0 KB View Download
Project Member

Comment 3 by sheriffbot@chromium.org, Nov 2 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sandeepkumars@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by zljj0...@gmail.com, Nov 2 2017

If image size exceed max texture size that gpu supports, and image is draw by SkCanvas::drawRect with gpu rasterization, this issue will occurs.




Labels: Needs-Feedback
Tested the issue using #61.0.3163.98 on Android 8.0.0 Nexus 5X Build/OPR1 and could observe the mentioned behavior in gpu_raster.png.

Observed the same behavior since M55 using the mentioned html file.

@zljj0818: Could you please confirm, are you using any other file to get cpu_raster.png behavior or the same file? If so please mention the Chrome good version and the other file for further triaging of the issue?

Thanks!!

Comment 6 by zljj0...@gmail.com, Nov 3 2017

@sandeepkumars:
use same file and device, i just force close gpu rasterization in chrome://flags
flags.png
218 KB View Download
Project Member

Comment 7 by sheriffbot@chromium.org, Nov 3 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sandeepkumars@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: ericrk@chromium.org
Components: Blink>Image Internals>Compositing>Rasterization Blink>Paint
This issue was not seen when gpu rasterization flag was disabled from Chrome://Flags. Issue is observed only when gpu rasterization flag was enabled.

Adding appropriate component and CC'ing the respective dev from  issue 676636  as this issue looks same as  issue 676636 .

Thanks!!

Mergedinto: 676636
Status: Duplicate (was: Unconfirmed)
@zljj0818 the issue here is you're forcing tiling for the second div background, which causes us to use shaders, and fail the texture upload.

-  div size: 400 x 250

-  image size:  <huge> x 250

-  |position| runs in [0,190]

-  then you set background-position: |position|px 0;

So the left edge of the background is always in [0,190] => one image tile doesn't fully cover the div =>  we must draw two tiles => image shader => kaboom.

The trick to avoiding this sort of problem is to ensure a single image tile covers your dest area completely.

In this particular case, I believe setting background-position: |position|px; is not what you want anyway, as it only slides the first frame in the viewport - for any meaningful animation, you probably want a large |position| multiplier, to ensure advancing between frames.  Then if background-position is larger that the div width, the wrap-around tile will fully cover and we avoid tiling.  E.g.: https://codepen.io/fmalita/full/XzLday/

Alternatively, ignoring meaningful animation, you can also avoid tiling by setting background-repeat: no-repeat; - e.g. https://codepen.io/fmalita/full/wPLGVp/
Status: Available (was: Duplicate)
Re-opening this bug as the testcase given is not yet fixed.
Owner: khushals...@chromium.org
Status: Assigned (was: Available)
We might be able to work around the issue of maximum texture size in cc, by
taking advantage of the fact that cc knows the final texture after clipping etc
is much smaller. Khushal is going to give it a shot.
Cc: schenney@chromium.org
 Issue 812548  has been merged into this issue.

Sign in to add a comment