Added a new test to webgl: making giant canvases.

This commit is contained in:
Scott Erickson 2014-09-11 11:36:08 -07:00
parent d5542ffbbc
commit 5551c622fa

View file

@ -473,6 +473,35 @@ class WebGLDemoView extends RootView
# 20% CPU # 20% CPU
testGiantCanvas: ->
builder = new createjs.SpriteSheetBuilder()
# mess with these
builder.maxWidth = 4096
builder.maxHeight = 4096
scale = 3.9
duplicates = 100
frames = []
createClass = (frame) ->
class Stub
constructor: ->
sprite = new createjs.Sprite(sheet, frame)
sprite.stop()
return sprite
for name, klass of librarianLib
continue if name is 'Librarian_SideWalk_JSCC'
instance = new klass()
builder.addFrame(instance, instance.nominalBounds, scale) for i in _.range(duplicates)
librarianLib[name] = createClass(frames.length)
frames.push frames.length
sheet = builder.build()
$('body').attr('class', '').empty().css('background', 'white').append($(sheet._images))
for image, index in sheet._images
console.log "Sheet ##{index}: #{$(image).attr('width')}x#{$(image).attr('height')}"
afterRender: -> afterRender: ->
# @testMovieClipWithRasterizedSpriteChildren() # @testMovieClipWithRasterizedSpriteChildren()
@ -485,7 +514,8 @@ class WebGLDemoView extends RootView
# @testAnimateManyRasteredWaterfalls() # @testAnimateManyRasteredWaterfalls()
# @testManualMovieClipUpdating() # @testManualMovieClipUpdating()
# @testManyWaterfallsWithManualAnimation() # @testManyWaterfallsWithManualAnimation()
@testLibrarianHorde() # @testLibrarianHorde()
@testGiantCanvas()
module.exports = -> module.exports = ->
v = new WebGLDemoView() v = new WebGLDemoView()