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

Issue 770544 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: 2017-11-27
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

CanvasRenderingContext2D stroke method randomly being slow, causing low fps

Reported by camlanwi...@gmail.com, Oct 1 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3228.0 Safari/537.36

Steps to reproduce the problem:
1. Open a website that utilises CanvasRenderingContext2D.stroke() (I used http://gota.io/web/)
2. Notice that occasionally the fps drops for a few seconds due to CanvasRenderingContext2D.stroke() taking about 30ms while CanvasRenderingContext2D.arc() is only taking around 0.2ms.

What is the expected behavior?
CanvasRenderingContext2D.stroke() shouldn't be any slower than 0.2ms.

What went wrong?
CanvasRenderingContext2D.stroke() is taking 20-30ms causing 30-40fps, when I should have 144fps.

Did this work before? Yes I used Chrome Canary 3 days ago and it had worked. I am unsure what the version was.

Chrome version: 63.0.3228.0  Channel: canary
OS Version: 10.0
Flash Version:
 
http://gota.io/web/ actually doesn't use CanvasRenderingContext2D.stroke(), but I am using an extension that uses it. I have used this extension for ages with no issues previously and the extension has not been updated since it last worked.
Labels: Needs-Triage-M63 Triaged-ET Needs-Feedback
@camlanwilsonsnowden: Could you please provide the extension used and steps followed from your end, that would help us in further triaging the issue
To provide extension link, please follow below steps
1. Go to chrome://extensions/
2. Click on Details of the extension 
3. Click on view in store
4. Copy the link

Thanks!!

Comment 3 Deleted

The extension I use is a custom userscript that a friend of mine has made. He uses most of the same code at http://dogio.win/.

1. Visit http://dogio.win/
2. Click the gear icon to the right of the main menu to open the options menu.
3. Scroll down the options and ensure that hide mass and auto hide text is unchecked.
4. Click the spectate button to the left of the main menu.
5. Scroll out slightly with your mouse wheel to ensure that you can see a few cells that use stroke (I will attach images to show you what they look like).

Now, this bug is quite hard to find. I don't know if you will have luck coming across it while only spectating. I can easily find the bug myself when playing. I am unsure if playing is actually causing the issue.

It seems to definitely have something to do with drawing the text of those cells that use stroke.
As well as that, you need to be zoomed in a bit. Once you reach a certain zoom, the fps shoots back up to 144fps. I have found that when using a canvas scale of 0.06985434935935365 and above, the bug occurs, but when using a scale of 0.06224022527918411 and below the fps goes back to normal. So I guess it starts happening at some point in between there. I'm guessing that the scale is just changing the way text is drawn with fillText after zooming out enough.

The method used to draw the bugged cells is:
  drawVirus(cell, color){
    let ctx = this.ctx
    ctx.beginPath()
    ctx.arc(cell.x, cell.y, cell.size, 0, Math.PI * 2)
    ctx.fillStyle = color
    ctx.globalAlpha = 0.5
    ctx.fill()
    ctx.lineWidth = 15
    ctx.strokeStyle = color
    ctx.globalAlpha = 1
    ctx.stroke()
    this.drawSize(cell)
  }
and since we will want the text to be drawn, the drawSize method is called:
  drawSize(cell){
    let ctx = this.ctx
    let text = `${cell.getMass()}`
    let size = 0.25 * cell.size >> 0
    ctx.font = `bold ${size}px Verdana`
    ctx.fillStyle = cell.nameColor
    ctx.textBaseline = 'middle'
    ctx.textAlign = 'center'
    ctx.fillText(text, cell.x, cell.y)
  }
The image I am attaching actually has the bug occuring at the highest zoom I can get to. When zooming out anymore my fps jumps back to 144.
image.png
178 KB View Download
Project Member

Comment 5 by sheriffbot@chromium.org, Oct 3 2017

Cc: divya.pa...@techmahindra.com
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "divya.padigela@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: Blink>Canvas
Cc: vamshi.k...@techmahindra.com
Labels: Needs-Feedback
Unable tp reproduce the issue on the reported chrome version 63.0.3228.0 with the steps mentioned below.
1. Visited http://dogio.win/
2. Clicked on the gear icon and opened the options menu.
3. Scrolled down the options and ensurde the hide mass and auto hide text is unchecked.
4. Clicked the spectate button. 
5. Scrolled slightly with mouse wheel
Observed nothing as mentioned, attaching the screen cast of the same.

@Reporter: Could you please mentoin if we have missed any steps in order to reproduce the issue.

Thanks!
770544.ogv
4.4 MB View Download
NextAction: 2017-11-27
The NextAction date has arrived: 2017-11-27

Comment 10 by junov@chromium.org, Apr 24 2018

Closing issue due to non-reproducibility and lack of feedback since comment #7

Comment 11 by junov@chromium.org, Apr 24 2018

Status: WontFix (was: Unconfirmed)

Sign in to add a comment