Project: skia Issues People Development process History Sign in
New issue
Advanced search Search tips
Starred by 10 users
Status: New
Owner:
Cc:
Area: ----
Priority: Low
Type: Defect



Sign in to add a comment
Canvas maximum size >32767px
Reported by voidvol...@gmail.com, Feb 3 2014 Back to list
[ Repost from chromium bug tracker http://code.google.com/p/chromium/issues/detail?id=339725 ]

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:
http://www.w3.org/TR/html5/embedded-content-0.html#the-canvas-element

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.
Code: http://jsbin.com/UguXuniF/3/edit?html,js,output
<!DOCTYPE html>
<html>
<head>
<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 );
}
</script>
</head>
<body>
  <button onclick="test1()">Test 1 royalblue 16383px</button>
  <button onclick="test2()">Test 2 orangered 32767px</button>
  <canvas id="board" width="300" height="300"/>
</body>
</html>

 
Project Member Comment 1 by hcm@google.com, Feb 4 2014
Cc: hcm@google.com
Owner: reed@google.com
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 hcm@google.com, Oct 14 2014
Labels: -Priority-Medium Priority-Low
Project Member Comment 3 by hcm@google.com, Dec 7 2015
Labels: Hotlist-Fixit
Project Member Comment 4 by caryclark@google.com, Mar 2 2016
Cc: fmalita@chromium.org
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 fmalita@chromium.org, Mar 2 2016
Cc: junov@chromium.org
I think canvas2d is not (always?) tiled - junov, would it make sense to limit the size in Blink?
Project Member Comment 6 by junov@chromium.org, 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 (https://github.com/catapult-project/catapult/issues/2416#issuecomment-232327904). Are there any plans to address it in the near future?
Sign in to add a comment