W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2013

Re: Stacking context and offscreen bitmaps

From: Rik Cabanier <cabanier@gmail.com>
Date: Thu, 7 Mar 2013 13:44:13 -0800
Message-ID: <CAGN7qDBisS16s8Jmj=ZjpyXdkJLWTCdik_qmMo96BA2AHe1WKg@mail.gmail.com>
To: James Robinson <jamesr@google.com>
Cc: public-fx@w3.org
On Thu, Mar 7, 2013 at 1:21 PM, James Robinson <jamesr@google.com> wrote:

>
>
> On Thu, Mar 7, 2013 at 1:05 PM, Rik Cabanier <cabanier@gmail.com> wrote:
>
>> In order to have interoperable implementations of blending and filters,
>> there needs to be a specification that describes when offscreen bitmaps are
>> generated.
>
>
> No.  Specifications should be written in terms of observable behaviors,
> not in terms of implementation details.  It's fine to specify the desired
> rendering in such a way that using an offscreen bitmap is convenient to
> use, but whether or not an implementation uses offscreen bitmaps or not is
> not part of the spec.
>

I'm using the term 'offscreen bitmap' as a convenience.
Certain stacking contexts create groups which act as a barrier when an
element with a filter or blend looks at its background. This changes the
rendering of those blended/filtered objects. Usually these groups are
implemented as offscreen buffers.

This was not a problem before because
- background-image was not implemented
- src-over compositing is unaffected by grouping.


>
>
>> Currently, the compositing spec states that every stacking context will
>> have a buffer [1] but that is not always the case [2]. This behavior is not
>> documented.
>>
>
>> I can see 2 ways forward:
>> 1. document the current browser behavior
>> Create a new document, or extend "Appendix E. Elaborate description of
>> Stacking Contexts" [3] so it describes when off-screen buffers should be
>> generated.
>> Browsers wouldn't have to change their behavior if they didn't follow the
>> spec except where it would make a difference.
>>
>
> That's why it is important to define the rendering you want to achieve,
> not the method in which that rendering is achieved.
>

Correct. The spec would not talk about buffers or offscreen bitmaps.


>
>
>> For instance, if a browser did not create a buffer for a stacking context
>> but the spec said it should and there is blending or a filter that accesses
>> the backdrop, then the stacking context should create a buffer.
>> I think this would be fairly easy to implement but it would take quite a
>> bit of time to investigate and document. A drawback is that the spec would
>> be complex and hard to use for authors
>>
>> 2. Always give a stacking context on offscreen buffer if it contains an
>> element with blending.
>> This would be a bit harder to implement, but easy to specify.
>>
>
> What does "an element with blending" mean?  These things would be very
> expensive, whatever they are.
>

Element was a misnomer. I meant to say:

Always give a stacking context an offscreen buffer if it contains an area
[1] or a background image [2] that has a non-default blending style.


1:
https://dvcs.w3.org/hg/FXTF/rawfile/default/compositing/index.html#ltareagt
2:
https://dvcs.w3.org/hg/FXTF/rawfile/default/compositing/index.html#background-blend-mode
Received on Thursday, 7 March 2013 21:44:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 7 March 2013 21:44:40 GMT