[whatwg] Canvas 2D context proposal: point/linear filtering modes

2011-10-28 Thread Ashley Gullen
that this could be included in the standard? Any comments/suggestions/vendor-specific extensions I've missed? -- Ashley Gullen Scirra.com

Re: [whatwg] Canvas 2D context proposal: point/linear filtering modes

2011-10-28 Thread Ashley Gullen
On 29/10/2011 02:15, Boris Zbarsky wrote: On 10/28/11 3:26 PM, Ashley Gullen wrote: Overall, I think this proposal is very simple, straightforward to standardise and implement, genuinely useful, and would significantly encourage 2D gaming in HTML5 for comparitively little effort. Is it possible

Re: [whatwg] Canvas v5 API additions

2012-03-28 Thread Ashley Gullen
On 28 March 2012 22:41, Ian Hickson i...@hixie.ch wrote: On Sat, 29 Oct 2011, Ashley Gullen wrote: I had a quick go with setting ctx.mozImageSmoothingEnabled = false. It works great with drawImage. However it does not appear to affect repeated patterns. This makes for quite a strange

Re: [whatwg] Canvas v5 API additions

2012-03-29 Thread Ashley Gullen
wrote: On Thu, 29 Mar 2012, Ashley Gullen wrote: BTW: - have you got a link to the spec including the smoothing property? can't seem to find it http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-imagesmoothingenabled (I will be replying to your detailed feedback at some

Re: [whatwg] Adding blending to the canvas API

2012-04-13 Thread Ashley Gullen
. Ashley Gullen Scirra.com On 12 April 2012 00:39, Rik Cabanier caban...@gmail.com wrote: :-) They are definitely more familiar to designers but they both have their place. On Wed, Apr 11, 2012 at 4:30 PM, Jeremy Apthorp jere...@chromium.org wrote: On Wed, Apr 11, 2012 at 4:05 PM, Rik

[whatwg] toDataURL() for image/video?

2012-05-29 Thread Ashley Gullen
(). e.g. var myPhoto = video.snapshot();, or some of the above uses with video.snapshot().toDataURL(). Ashley Gullen Scirra.com

Re: [whatwg] CSS Filter Effects for Canvas 2D Context

2012-07-16 Thread Ashley Gullen
. This is an option, but given that a filter effect can be applied to an entire canvas, it seems a waste not to enable it for individual draw calls, especially given the 2D context is considerably easier and quicker to code for. Ashley Gullen Scirra.com On 25 January 2012 16:26, Tab Atkins Jr. jackalm

Re: [whatwg] CSS Filter Effects for Canvas 2D Context

2012-07-28 Thread Ashley Gullen
On another note, wouldn't it be nice if you could add a grouping operator such as this: gamecanvascontext.filter = '...'; gamecanvascontext.beginGroup(); ... // lots of drawing operators gamecanvascontext.endGroup(); and have everything in that group at endGroup time? Do you mean

Re: [whatwg] CSS Filter Effects for Canvas 2D Context

2012-07-29 Thread Ashley Gullen
, Ashley Gullen ash...@scirra.com wrote: On another note, wouldn't it be nice if you could add a grouping operator such as this: gamecanvascontext.filter = '...'; gamecanvascontext.beginGroup(); ... // lots of drawing operators gamecanvascontext.endGroup(); and have everything

Re: [whatwg] Hardware accelerated canvas

2012-09-02 Thread Ashley Gullen
Why is it prohibitively expensive to handle a lost context automatically in a canvas 2D? Having written a 2D engine which supports this (albeit in DirectX), don't you just need to recreate the surface, set up your render state again, recreate any textures that were referenced, then continue? (In

Re: [whatwg] Hardware accelerated canvas

2012-09-04 Thread Ashley Gullen
It sounds like the real issue is mobile: - it seems pretty difficult to make a desktop lose a context - most mobile browsers still use software rendering, or at least haven't had GPU acceleration very long, so there are unlikely to be bug reports about it - it sounds like mobile devices lose

Re: [whatwg] [canvas] Proposal for supportsContext

2012-09-10 Thread Ashley Gullen
with something vendor specific, like: canvas.supportsContext(webgl, { -webkit-allowswiftshader: false }) Despite the hardness to define it, I do feel there is a practical need for this. Ashley Gullen Scirra.com On 10 September 2012 19:14, Dean Jackson d...@apple.com wrote: I sent

Re: [whatwg] [canvas] Proposal for supportsContext

2012-09-10 Thread Ashley Gullen
On 10 September 2012 20:39, Dean Jackson d...@apple.com wrote: On Sep 10, 2012, at 12:35 PM, Ashley Gullen ash...@scirra.com wrote: Can't Modernizr just lazy load the WebGL context? (i.e. only try to create a context if the web page actually asks if WebGL is supported) Yes, it could

[whatwg] Canvas 2D memory management

2013-01-09 Thread Ashley Gullen
as it is and suggest WebGL for this type of application My preference is option 1, but I don't know if this works for all use cases and will work nicely with implementations. Any thoughts? Ashley Gullen Scirra.com

Re: [whatwg] Canvas 2D memory management

2013-01-12 Thread Ashley Gullen
. What's the implementation status of ImageBitmap? Do any browsers support it yet? Ashley Gullen Scirra.com On 11 January 2013 22:56, Rik Cabanier caban...@gmail.com wrote: On Fri, Jan 11, 2013 at 2:36 PM, Robert O'Callahan rob...@ocallahan.orgwrote: On Sat, Jan 12, 2013 at 6:41 AM

Re: [whatwg] Adding the imageSmoothingEnabled back into 2dContext Level 2 spec.

2013-02-11 Thread Ashley Gullen
I would re-emphasise this is important for many game applications. Here's an image showing the effect it can have from a recent blog post I wrote: https://www.scirra.com/images/sampling-point-linear.png For a game in this style it is essential to be able to force nearest-neighbour. Games in that

Re: [whatwg] Canvas 2D memory management

2013-07-19 Thread Ashley Gullen
FWIW, imageBitmap.discard() wouldn't be unprecedented - WebGL allows you to explicitly release memory with deleteTexture() rather than letting the GC collect unused textures. Ashley On 18 July 2013 17:50, Ian Hickson i...@hixie.ch wrote: On Wed, 9 Jan 2013, Ashley Gullen wrote: Some

[whatwg] Proposal: requestBackgroundProcessing()

2014-02-20 Thread Ashley Gullen
when put in to a background tab - we've already run in to this with testing, so it seems likely to affect real-world games too. Ashley Gullen Scirra.com

Re: [whatwg] Proposal: requestBackgroundProcessing()

2014-02-20 Thread Ashley Gullen
Isn't setTimeout also clamped to 1s in the background? This alone would add so much latency as to effectively hang the game anyway. On 20 February 2014 16:18, Tab Atkins Jr. jackalm...@gmail.com wrote: On Thu, Feb 20, 2014 at 7:25 AM, Ashley Gullen ash...@scirra.com wrote: We're building

Re: [whatwg] Proposal: requestBackgroundProcessing()

2014-02-20 Thread Ashley Gullen
The host needs to keep simulating the world even when no network events are occurring. That can't happen if rAF isn't firing and timers only run at 1 Hz. On 20 February 2014 17:56, James Robinson jam...@google.com wrote: On Thu, Feb 20, 2014 at 7:25 AM, Ashley Gullen ash...@scirra.com wrote

Re: [whatwg] Proposal: requestBackgroundProcessing()

2014-02-20 Thread Ashley Gullen
There's a lot of worker features that aren't widely supported yet, like rendering to canvas with WebGL and 2D, Web Audio support, inputs, various APIs like speech and fullscreen, so I don't think that's practical right now. I guess that's not a reason to standardise a new feature, but is there not

Re: [whatwg] Proposal: requestBackgroundProcessing()

2014-02-20 Thread Ashley Gullen
...@zewt.org wrote: On Thu, Feb 20, 2014 at 3:29 PM, Ashley Gullen ash...@scirra.com wrote: There's a lot of worker features that aren't widely supported yet, like rendering to canvas with WebGL and 2D, Web Audio support, inputs, various APIs like speech and fullscreen, so I don't think that's

Re: [whatwg] Canvas-Only Document Type

2014-07-07 Thread Ashley Gullen
in only canvas and javascript. Is there any evidence that such a mode would actually improve performance? Are there benchmarks indicating the existence of a DOM, even if inert, harms performance in any way? Ashley Gullen Scirra.com On 7 July 2014 21:35, Brian Blakely anewpage.me...@gmail.com wrote

Re: [whatwg] [2D Canvas] Proposal: batch variants of drawImage

2014-08-05 Thread Ashley Gullen
. If you want to keep improving canvas2d performance I would worry you will simply end up reinventing WebGL. As developers of a HTML5 game engine with WebGL support and fallback to canvas2d, this has no utility to us at all. It would be more useful to work on WebGL 2. Ashley Gullen Scirra.com On 5

Re: [whatwg] [2D Canvas] Proposal: batch variants of drawImage

2014-08-05 Thread Ashley Gullen
to an rgba color, and using a multiply blend op to use it to modulate images. On Tue, Aug 5, 2014 at 7:47 AM, Ashley Gullen ash...@scirra.com wrote: I am against this suggestion. If you are serious about performance then you should use WebGL and implement your own batching system, which is what

Re: [whatwg] [2D Canvas] Proposal: batch variants of drawImage

2014-08-08 Thread Ashley Gullen
As Justin stated, 20% of current Chrome users currently fall back to canvas 2d. 1. What fraction of those 20% actually still get a GPU accelerated canvas vs. software rendered? Batching will be of very little use to the software rendered audience, making it an even smaller target market. 2.

Re: [whatwg] [2D Canvas] Proposal: batch variants of drawImage

2014-08-08 Thread Ashley Gullen
1. What fraction of those 20% actually still get a GPU accelerated canvas vs. software rendered? Batching will be of very little use to the software rendered audience, making it an even smaller target market. ~25% of Chrome users that do not have gpu-accelerated WebGL do have gpu

Re: [whatwg] Adding a property to navigator for getting device model

2014-09-30 Thread Ashley Gullen
Am I right that a lot of the mentioned problems stem from old Android devices with browsers that have been shoddily hacked and broken by the manufacturers (presumably in the name of making improvements)? For example I remember specific versions of some Samsung Android device browsers would freeze

[whatwg] HTML imports: relative URLs in blobs / progress events

2014-10-20 Thread Ashley Gullen
Hi all, I'd like to suggest a use case whereby it would be useful if a blob import can load relative URLs as if they are relative to the importing HTML document. Alternatively HTML imports could provide progress events. This suggestion comes from a discussion on a Chrome bug [1]. A complex

Re: [whatwg] Gapless playback problems with web audio standards

2014-10-28 Thread Ashley Gullen
Can this be used for gapless looping of the same track? This is a common request for game developers looking to seamlessly loop a music or ambience track: https://code.google.com/p/chromium/issues/detail?id=353072 Ashley On 27 October 2014 20:09, Dale Curtis dalecur...@chromium.org wrote: Hi,

Re: [whatwg] Gapless playback problems with web audio standards

2014-10-28 Thread Ashley Gullen
, 2014 at 9:55 AM, Ashley Gullen ash...@scirra.com wrote: Can this be used for gapless looping of the same track? This is a common request for game developers looking to seamlessly loop a music or ambience track: https://code.google.com/p/chromium/issues/detail?id=353072 Ashley On 27 October

Re: [whatwg] Unicode - ASCII copy/paste fallback

2015-02-13 Thread Ashley Gullen
Why is it desirable to copy ASCII versions of unicode text? Doesn't most software now support unicode so the user can copy and paste what they see, rather than some ASCII-art equivalent? On 13 February 2015 at 15:45, Boris Zbarsky bzbar...@mit.edu wrote: On 2/13/15 10:15 AM, David Sheets wrote:

Re: [whatwg] HTMLCanvasElement toBlob Promise

2015-03-17 Thread Ashley Gullen
Making toBlob return a promise is definitely in keeping with the rest of the web platform, but it's easy to write a wrapper function to promisify it. IMO toBlob is better than toDataURL since it is async so the image encoding can happen off main thread, reducing jank. I don't know how easy it is

Re: [whatwg] Canvas image to blob/dataurl within Worker

2015-03-21 Thread Ashley Gullen
Is everyone here aware that currently Google have stated they do not plan to implement toBlob?: https://code.google.com/p/chromium/issues/detail?id=67587 IMO this is the wrong call. We should be favouring blobs over data URLs since they are more efficient (no size bloat, can be requested async

Re: [whatwg] iframe async

2015-02-27 Thread Ashley Gullen
Perhaps independent is a better name than async, indicating the iframe content is independent of the main page. Browser loading UI, load events, fast back and possibly performance tools would not take in to account independent iframes, since they are explicitly marked as not important to the

Re: [whatwg] Recorder audio and save to server

2015-04-07 Thread Ashley Gullen
I've brought this up on other lists, but I think it's worth bringing up again here: it's a significant limitation in MediaRecorder that it can only work in real-time. If a user has a pre-recorded WAV file which is one hour long and they want to upload that or encode it to a different format,

Re: [whatwg] Canvas image to blob/dataurl within Worker

2015-04-08 Thread Ashley Gullen
on the window the HTMLCanvasElement it came from is currently in? Then you have a convenient way to synchronise rendering with the window it will ultimately be displayed in, without having to know in advance which window that is. Ashley On 8 April 2015 at 16:36, Ashley Gullen ash...@scirra.com

Re: [whatwg] Supporting feature tests of untestable features

2015-04-08 Thread Ashley Gullen
CSS.supports() should in theory cover all CSS features. Javascript as ever can test which features are available. Neither guarantees correct functioning, only presence - besides, all software has bugs, so at what point do you draw the line between broken and working? Things like canvas

Re: [whatwg] Canvas image to blob/dataurl within Worker

2015-04-08 Thread Ashley Gullen
This looks like it will cover running a HTML5 game engine from a worker very nicely and with little performance overhead. Good stuff! Ashley On 8 April 2015 at 00:41, Kenneth Russell k...@google.com wrote: On Wed, Mar 25, 2015 at 6:41 PM, Kenneth Russell k...@google.com wrote: On Wed, Mar

Re: [whatwg] Standards growth and complexity

2015-06-03 Thread Ashley Gullen
Adding is often the only technically sensible solution. For example if the default CSS box model was changed, a vast amount of existing content on the web that relies on it working the way it already does would be broken. So new models are added instead, like flexbox, which solves a great many

Re: [whatwg] Worker requestAnimationFrame

2015-08-20 Thread Ashley Gullen
We build a major HTML5 game engine, and I feel the deadline approach is unsuitable for gaming. Games often do heavy CPU work to run the game logic before drawing. (Please do not drag me in to arguments over time stepping; stepping less often than rAF does not look smooth, and stepping more often

Re: [whatwg] DOM Events Proposal: EventListenerOptions 'mayCancel' for improved scroll performance

2015-07-12 Thread Ashley Gullen
Is it not possible for Javascript engines to statically determine if preventDefault() is called by an event handler? For example: function myHandler(e) { // does e.preventDefault occur anywhere in this body? }; target.addEventListener(scroll, myHandler); If none of the added event handlers

Re: [whatwg] Reviving ImageBitmap options: Intend to spec and implement

2016-02-10 Thread Ashley Gullen
ImageBitmap is not useful for getting the data from: it still requires synchronous use of a canvas to turn in to an ImageData. I would encourage browser vendors to look at my spec proposal to avoid this: http://wicg.github.io/img-conversion/ On 10 February 2016 at 18:29, Gregg Tavares

Re: [whatwg] Reviving ImageBitmap options: Intend to spec and implement

2016-02-11 Thread Ashley Gullen
n 10 February 2016 at 20:27, Justin Novosad <ju...@google.com> wrote: > On Wed, Feb 10, 2016 at 2:38 PM, Ashley Gullen <ash...@scirra.com> wrote: > >> ImageBitmap is not useful for getting the data from: it still requires >> synchronous use of a canvas to turn in to