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

Issue metadata

Status: Accepted
Area: ----
NextAction: ----
Priority: Medium
Type: Defect

issue chromium:859400

Sign in to add a comment

Issue 2122: Canvas maximum size >32767px

Reported by, Feb 3 2014

Issue description

[ Repost from chromium bug tracker ]

What steps will reproduce the problem?
1. Set the size of canvas more 15bits width or length (>32767px)
2. Draw anything
3. Check result: white canvas

What is the expected output?
The colored picture.
According to W3 standarts:

interface HTMLCanvasElement : HTMLElement {
           attribute unsigned long width;
           attribute unsigned long height;

Canvas can be any size from 0...4 294 967 295 px.

What do you see instead?
White list of canvas and lags, sometimes the page is crashed.

What version of the product are you using? On what operating system?
Chrome Version       : 32.0.1700.76 (Официальная сборка 244343) m
OS                   : Windows 7 Pro

Please provide any additional information below.
<!DOCTYPE html>
<meta charset=utf-8 />
<script type="text/javascript">
function test1(){
    var x = document.getElementById('board');
    x.height = 16383;
    x.width = 16383;
    var ctx = x.getContext('2d');
    ctx.fillStyle = 'royalblue';
    ctx.fillRect(0, 0, x.width, x.height);
    console.log( x.width +' x '+ x.height );

function test2(){
    var x = document.getElementById('board');
    x.height = 32768;
    x.width = 32768;
    var ctx = x.getContext('2d');
    ctx.fillStyle = 'orangered';
    ctx.fillRect(0, 0, x.width, x.height);
    console.log( x.width +' x '+ x.height );
  <button onclick="test1()">Test 1 royalblue 16383px</button>
  <button onclick="test2()">Test 2 orangered 32767px</button>
  <canvas id="board" width="300" height="300"/>

Comment 1 by, Feb 4 2014

Project Member
Assign to Mike to take a look and see if you think there is something we can do about this issue.. 

Stephen noted in the Chromium bug that it is a known limitation of Skia's design that we may not fix, but voidvolker opened here for our consideration.

Comment 2 by, Oct 14 2014

Project Member
Labels: -Priority-Medium Priority-Low

Comment 3 by, Dec 7 2015

Project Member
Labels: Hotlist-Fixit

Comment 4 by, Mar 2 2016

Project Member
Given that Chrome draws to tiles, wouldn't it be reasonable to attack this at that level rather than in Skia? Florin, do you think there is any interest in limiting the SkCanvas to something < 32K in Chrome, and then tiling additional SkCanvas to make the width specified the as described above?

Comment 5 by, Mar 2 2016

Project Member
I think canvas2d is not (always?) tiled - junov, would it make sense to limit the size in Blink?

Comment 6 by, Mar 7 2016

Project Member
Correct, canvases are never tiled in the current implementation. No need to have a limit that is explicitly known to blink since blink knows when the canvas is to big by the fact of skia failing to allocate it.  That being said, Houdini's custom paint feature is going to offer a very reasonable workaround for drawing arbitrarily large things using a write-only subset of the Canvas API. That will leverage tiling.

Comment 7 by, Jul 13 2016

This issue is causing chrome://tracing to not display large traces ( Are there any plans to address it in the near future?

Comment 8 by, Jan 18 2018

Project Member
 Issue 580  has been merged into this issue.

Comment 9 by, Mar 2 2018

Project Member
piggy-backing on this:

- canvas disables antialiasing at smaller sizes (e.g. 8K) due to fixed-point limitations. This should be addressed too.

Comment 11 by, Mar 7 2018

Project Member
The following revision refers to this bug:

commit 461ef7af88cc966007c464130a971ec86c803f1d
Author: Florin Malita <>
Date: Wed Mar 07 14:23:01 2018

Revert "add tiler for SkDraw"

This reverts commit be1b3971806e3d80aa9673a36e2b35d0145198ac.

Reason for revert: 

Unexpected layout test diffs:

Original change's description:
> add tiler for SkDraw
> Bug: skia:2122
> Change-Id: I276de2064939151eef5fa14c53188e8b5728b7c9
> Reviewed-on:
> Commit-Queue: Mike Reed <>
> Reviewed-by: Yuqian Li <>,

Change-Id: Ia598c0d7c4ac6cfcdb905b847040c250fa366402
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2122
Reviewed-by: Florin Malita <>
Commit-Queue: Florin Malita <>


Comment 12 by, Nov 30

Project Member
Blocking: chromium:859400
Labels: -Priority-Low Priority-Medium
Status: Accepted (was: New)
The limitation on maximum canvas size is blocking passing the WebGL 2.0.1 conformance suite per  . Would it be possible to try to make progress on this issue again?

Comment 13 by, Dec 1

Project Member
fserb@ is this limitation on the chrome side? I don't see it on the skia-raster side...

Comment 14 by, Dec 2

I created a change to increase the limit:

It seems to work.

Comment 15 by, Dec 3

There was a comment on our side saying it was a Skia issue. Maybe it disappeared.
jdarpinian@'s cl solves it.

Comment 16 by, Dec 3

Project Member
The following revision refers to this bug:

commit 5fd81121bab7d735ed01a8a112df253807c2e77c
Author: James Darpinian <>
Date: Mon Dec 03 20:37:16 2018

Increase maximum width/height of canvas.

Fixes WebGL conformance test:

The test expects to be able to create a canvas larger than 32767 in
height. Skia seems to support this, and there have been user requests
for it.

Bug: 859400, 339725, skia:2122
Change-Id: Ibba89e98178bd73817c7b4cbdf569e89ee5764b1
Reviewed-by: Fernando Serboncini <>
Reviewed-by: Kenneth Russell <>
Commit-Queue: James Darpinian <>
Cr-Commit-Position: refs/heads/master@{#613225}

Comment 17 by, Dec 17

Project Member

Comment 18 by, Dec 17

Project Member

Sign in to add a comment