New issue
Advanced search Search tips
Starred by 12 users

Issue metadata

Status: New
Area: ----
Priority: Low
Type: Defect

Sign in to add a comment

Canvas maximum size >32767px

Reported by, Feb 3 2014 Back to list

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"/>

Project Member

Comment 1 by, Feb 4 2014

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.
Project Member

Comment 2 by, Oct 14 2014

Labels: -Priority-Medium Priority-Low
Project Member

Comment 3 by, Dec 7 2015

Labels: Hotlist-Fixit
Project Member

Comment 4 by, Mar 2 2016

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?
Project Member

Comment 5 by, Mar 2 2016

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

Comment 6 by, Mar 7 2016

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.
This issue is causing chrome://tracing to not display large traces ( Are there any plans to address it in the near future?
Project Member

Comment 8 by, Jan 18

 Issue 580  has been merged into this issue.
Project Member

Comment 9 by, Mar 2

piggy-backing on this:

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

Project Member

Comment 11 by, Mar 7

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 <>


Sign in to add a comment