Re: Skia Content on OS X

2016-03-22 Thread Nicholas Nethercote
On Wed, Mar 23, 2016 at 3:03 AM, Mason Chang  wrote:

> Hi David,
>
> The main benefit is architectural with a huge simplification of our
> graphics code, with a nice side benefit of performance. As it stands today,
> we have multiple different rendering paths for each platform (Linux, OS X,
> Windows). That means every time we hit a graphics bug, we have to know
> three APIs that render just slightly different and we have to dig through
> each backend to figure out what’s going on.


+1 for fewer and easier graphics bugs!

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Skia Content on OS X

2016-03-22 Thread Nicolas Silva
I would like to add to what Mason already said about GPU painting. If
one thing is clear, it's that the GPU (as in the many combinations of
hardware and drivers out there) is not a reliable platform, especially
with gecko's current architecture. We get driver bugs for the simplest
things we do and they hit an awful lot of users. We need a solid
baseline that works reliably across the majority of hardware (CPU
drawing), on top of which we can add faster GPU-based backends that gets
enabed when we can detect that things will actually work.

I do think that the GPU is what can provide the best performance in most
cases (when it works), especially as screen resolution goes up, and the
work on WebRender is a good illustration of this. I am hoping that
something similar will happen in gecko eventually, but if it does, I am
certain that it will never fully replace a reliable cpu rendering path.

Anyway, moving to skia is about reducing the amount of code we need to
maintain, and we picked skia rather than, say, cairo because we believe
it is the best choice we have with this kind of immediate mode drawing
APIs.

Cheers,

Nical

On Tue, Mar 22, 2016, at 08:06 PM, Patrick Walton wrote:
> Thanks for the info! This is very interesting to us in Servo.
> 
> Do you have any performance measurements that support the statement
> "While
> it would be nice to use the GPU, we’re not totally confident that using
> the
> GPU to render content is quite worth it."? We have evidence on our side
> to
> support this too (and in fact it's one of the motivations for WebRender),
> but it's be great to have comprehensive data to back it up.
> 
> Patrick
> On Mar 22, 2016 10:56 AM, "Mason Chang"  wrote:
> 
> > Hi David,
> >
> > The main benefit is architectural with a huge simplification of our
> > graphics code, with a nice side benefit of performance. As it stands today,
> > we have multiple different rendering paths for each platform (Linux, OS X,
> > Windows). That means every time we hit a graphics bug, we have to know
> > three APIs that render just slightly different and we have to dig through
> > each backend to figure out what’s going on. These all have slightly
> > different performance characteristics as well, which takes some time. We
> > don’t generally get a lot of benefit from having a distinct backend for
> > platform also because other than on Windows, we’re not using the GPU for
> > content rendering. This essentially means we’re spinning a lot of wheels
> > and cost on small fixes on non-windows platforms for little benefit. [1].
> > This is especially true when you consider that we have special backends for
> > both Linux and OS X which make up 2.6% of our user base.
> >
> > With Skia, we can unify all of our graphics pipeline across all platforms
> > other than Windows for content rendering. It uses CPU rendering and because
> > of that, fixes on one platform translate much better across other platforms
> > that use Skia. While it would be nice to use the GPU, we’re not totally
> > confident that using the GPU to render content is quite worth it. It’s also
> > quite nice that micro-level optimizations at the backend level can mostly
> > be done for us as Skia is optimizing performance with Chrome as one of
> > their use cases. e.g., on Mac, scaling content on the CPU was 2-3x faster
> > with Skia versus CG.
> >
> > Overall, it’s mostly a clean up operation so we spend less time fixing
> > each individual platform.
> >
> > Please let me know if you have any more questions.
> >
> > Thanks,
> > Mason
> >
> > [1] https://people.mozilla.org/~danderson/moz-gfx-telemetry/www/
> >
> > > On Mar 22, 2016, at 8:21 AM, Mike de Boer  wrote:
> > >
> > > I was also quite curious, so I started clicking up the hierarchy of that
> > bug and ended up at:
> > >
> > > https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1 <
> > https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1>
> > >
> > > (comment 2 is also useful info)
> > >
> > > Ultimate goal: no more checkerboarding in APZ. But Mason is the
> > authority here, methinks :-)
> > >
> > > Cheers,
> > >
> > > Mike.
> > >
> > >> On 22 Mar 2016, at 15:45, David Rajchenbach-Teller 
> > wrote:
> > >>
> > >> Out of curiosity, what's the benefit?
> > >>
> > >> On 22/03/16 15:44, Mason Chang wrote:
> > >>> Hi all,
> > >>>
> > >>> We're changing the default graphics backend on OS X from CoreGraphics
> > to
> > >>> Skia. In the best case, you should notice no difference.
> > >>>
> > >>> If you see any graphics artifacts on mac, please file a bug and make it
> > >>> block bug 1207332 <
> > https://bugzilla.mozilla.org/show_bug.cgi?id=1207332>.
> > >>> You can verify that the artifact you're seeing is due to the switch by
> > >>> going to about:config, set the preference "gfx.content.azure.backends"
> > to
> > >>> "cg", restarting Firefox and seeing if the artifact still appears.
> > >>>
> > >>> Thanks to Lee Salzman, Jeff 

Re: Skia Content on OS X

2016-03-22 Thread Mason Chang
Hi Ben,

No, we haven’t done any measurements on battery usage. I would suspect since 
it’s faster and both CG/Skia used the CPU, it should either use less or be 
roughly equivalent. If you see any major difference, please file a bug.

Thanks,
Mason


> On Mar 22, 2016, at 9:44 AM, Ben Kelly  wrote:
> 
> On Tue, Mar 22, 2016 at 11:44 AM, William Lachance  > wrote:
> On 2016-03-22 11:21 AM, Mike de Boer wrote:
> I was also quite curious, so I started clicking up the hierarchy of that bug 
> and ended up at:
> 
> https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1 
>  
>  >
> 
> (comment 2 is also useful info)
> 
> Ultimate goal: no more checkerboarding in APZ. But Mason is the authority 
> here, methinks :-)
> 
> Yeah, there were some really nice wins as a result of this change that 
> Perfherder picked up:
> 
> https://treeherder.mozilla.org/perf.html#/alerts?id=534 
> 
> 
> Have we done any measurements on how this impacts battery usage?  Just 
> curious.
> 
> Thanks!
> 
> Ben

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Skia Content on OS X

2016-03-22 Thread Mason Chang
Hi Patrick,

I don’t have any comprehensive data to back this up. It’s unfortunately more 
anecdotal with the major observations being that (1) Chrome uses CPU rendering 
and it mostly seems “fast enough” for normal web content (not discussing 
webgl/vr/canvas here) and (2) we get lots of stability problems due to GPU 
drivers so being a bit slower in exchange for stability might be the route to 
go. What kind of evidence are you seeing so far? I agree, it’d be much nicer to 
have comprehensive data to verify this.

Thanks,
Mason


> On Mar 22, 2016, at 12:06 PM, Patrick Walton  wrote:
> 
> Thanks for the info! This is very interesting to us in Servo.
> 
> Do you have any performance measurements that support the statement "While it 
> would be nice to use the GPU, we’re not totally confident that using the GPU 
> to render content is quite worth it."? We have evidence on our side to 
> support this too (and in fact it's one of the motivations for WebRender), but 
> it's be great to have comprehensive data to back it up.
> 
> Patrick
> 
> On Mar 22, 2016 10:56 AM, "Mason Chang"  > wrote:
> Hi David,
> 
> The main benefit is architectural with a huge simplification of our graphics 
> code, with a nice side benefit of performance. As it stands today, we have 
> multiple different rendering paths for each platform (Linux, OS X, Windows). 
> That means every time we hit a graphics bug, we have to know three APIs that 
> render just slightly different and we have to dig through each backend to 
> figure out what’s going on. These all have slightly different performance 
> characteristics as well, which takes some time. We don’t generally get a lot 
> of benefit from having a distinct backend for platform also because other 
> than on Windows, we’re not using the GPU for content rendering. This 
> essentially means we’re spinning a lot of wheels and cost on small fixes on 
> non-windows platforms for little benefit. [1]. This is especially true when 
> you consider that we have special backends for both Linux and OS X which make 
> up 2.6% of our user base.
> 
> With Skia, we can unify all of our graphics pipeline across all platforms 
> other than Windows for content rendering. It uses CPU rendering and because 
> of that, fixes on one platform translate much better across other platforms 
> that use Skia. While it would be nice to use the GPU, we’re not totally 
> confident that using the GPU to render content is quite worth it. It’s also 
> quite nice that micro-level optimizations at the backend level can mostly be 
> done for us as Skia is optimizing performance with Chrome as one of their use 
> cases. e.g., on Mac, scaling content on the CPU was 2-3x faster with Skia 
> versus CG.
> 
> Overall, it’s mostly a clean up operation so we spend less time fixing each 
> individual platform.
> 
> Please let me know if you have any more questions.
> 
> Thanks,
> Mason
> 
> [1] https://people.mozilla.org/~danderson/moz-gfx-telemetry/www/ 
> 
> 
> > On Mar 22, 2016, at 8:21 AM, Mike de Boer  > > wrote:
> >
> > I was also quite curious, so I started clicking up the hierarchy of that 
> > bug and ended up at:
> >
> > https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1 
> >  
> >  > >
> >
> > (comment 2 is also useful info)
> >
> > Ultimate goal: no more checkerboarding in APZ. But Mason is the authority 
> > here, methinks :-)
> >
> > Cheers,
> >
> > Mike.
> >
> >> On 22 Mar 2016, at 15:45, David Rajchenbach-Teller  >> > wrote:
> >>
> >> Out of curiosity, what's the benefit?
> >>
> >> On 22/03/16 15:44, Mason Chang wrote:
> >>> Hi all,
> >>>
> >>> We're changing the default graphics backend on OS X from CoreGraphics to
> >>> Skia. In the best case, you should notice no difference.
> >>>
> >>> If you see any graphics artifacts on mac, please file a bug and make it
> >>> block bug 1207332  >>> >.
> >>> You can verify that the artifact you're seeing is due to the switch by
> >>> going to about:config, set the preference "gfx.content.azure.backends" to
> >>> "cg", restarting Firefox and seeing if the artifact still appears.
> >>>
> >>> Thanks to Lee Salzman, Jeff Muizelaar, and Markus Stange for their
> >>> tremendous efforts in getting this accomplished.
> >>>
> >>> Thanks,
> >>> Mason
> >>> ___
> >>> dev-platform mailing list
> >>> dev-platform@lists.mozilla.org 
> >>> https://lists.mozilla.org/listinfo/dev-platform 
> >>> 

Re: Skia Content on OS X

2016-03-22 Thread Rik Cabanier
On Tue, Mar 22, 2016 at 12:21 PM, Chris Peterson 
wrote:

> On 3/22/16 9:03 AM, Mason Chang wrote:
>
>> It’s also quite nice that micro-level optimizations at the backend level
>> can mostly be done for us as Skia is optimizing performance with Chrome as
>> one of their use cases.
>>
>
> On which platforms does Chrome use Skia?


It's used on all its platforms. AFAIK GPU rendering is turned for mobile
while desktop uses CPU based rendering
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Skia Content on OS X

2016-03-22 Thread Chris Peterson

On 3/22/16 9:03 AM, Mason Chang wrote:

It’s also quite nice that micro-level optimizations at the backend level can 
mostly be done for us as Skia is optimizing performance with Chrome as one of 
their use cases.


On which platforms does Chrome use Skia?
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Skia Content on OS X

2016-03-22 Thread Patrick Walton
Thanks for the info! This is very interesting to us in Servo.

Do you have any performance measurements that support the statement "While
it would be nice to use the GPU, we’re not totally confident that using the
GPU to render content is quite worth it."? We have evidence on our side to
support this too (and in fact it's one of the motivations for WebRender),
but it's be great to have comprehensive data to back it up.

Patrick
On Mar 22, 2016 10:56 AM, "Mason Chang"  wrote:

> Hi David,
>
> The main benefit is architectural with a huge simplification of our
> graphics code, with a nice side benefit of performance. As it stands today,
> we have multiple different rendering paths for each platform (Linux, OS X,
> Windows). That means every time we hit a graphics bug, we have to know
> three APIs that render just slightly different and we have to dig through
> each backend to figure out what’s going on. These all have slightly
> different performance characteristics as well, which takes some time. We
> don’t generally get a lot of benefit from having a distinct backend for
> platform also because other than on Windows, we’re not using the GPU for
> content rendering. This essentially means we’re spinning a lot of wheels
> and cost on small fixes on non-windows platforms for little benefit. [1].
> This is especially true when you consider that we have special backends for
> both Linux and OS X which make up 2.6% of our user base.
>
> With Skia, we can unify all of our graphics pipeline across all platforms
> other than Windows for content rendering. It uses CPU rendering and because
> of that, fixes on one platform translate much better across other platforms
> that use Skia. While it would be nice to use the GPU, we’re not totally
> confident that using the GPU to render content is quite worth it. It’s also
> quite nice that micro-level optimizations at the backend level can mostly
> be done for us as Skia is optimizing performance with Chrome as one of
> their use cases. e.g., on Mac, scaling content on the CPU was 2-3x faster
> with Skia versus CG.
>
> Overall, it’s mostly a clean up operation so we spend less time fixing
> each individual platform.
>
> Please let me know if you have any more questions.
>
> Thanks,
> Mason
>
> [1] https://people.mozilla.org/~danderson/moz-gfx-telemetry/www/
>
> > On Mar 22, 2016, at 8:21 AM, Mike de Boer  wrote:
> >
> > I was also quite curious, so I started clicking up the hierarchy of that
> bug and ended up at:
> >
> > https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1 <
> https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1>
> >
> > (comment 2 is also useful info)
> >
> > Ultimate goal: no more checkerboarding in APZ. But Mason is the
> authority here, methinks :-)
> >
> > Cheers,
> >
> > Mike.
> >
> >> On 22 Mar 2016, at 15:45, David Rajchenbach-Teller 
> wrote:
> >>
> >> Out of curiosity, what's the benefit?
> >>
> >> On 22/03/16 15:44, Mason Chang wrote:
> >>> Hi all,
> >>>
> >>> We're changing the default graphics backend on OS X from CoreGraphics
> to
> >>> Skia. In the best case, you should notice no difference.
> >>>
> >>> If you see any graphics artifacts on mac, please file a bug and make it
> >>> block bug 1207332 <
> https://bugzilla.mozilla.org/show_bug.cgi?id=1207332>.
> >>> You can verify that the artifact you're seeing is due to the switch by
> >>> going to about:config, set the preference "gfx.content.azure.backends"
> to
> >>> "cg", restarting Firefox and seeing if the artifact still appears.
> >>>
> >>> Thanks to Lee Salzman, Jeff Muizelaar, and Markus Stange for their
> >>> tremendous efforts in getting this accomplished.
> >>>
> >>> Thanks,
> >>> Mason
> >>> ___
> >>> dev-platform mailing list
> >>> dev-platform@lists.mozilla.org
> >>> https://lists.mozilla.org/listinfo/dev-platform
> >>>
> >> ___
> >> dev-platform mailing list
> >> dev-platform@lists.mozilla.org
> >> https://lists.mozilla.org/listinfo/dev-platform
> >
> > ___
> > dev-platform mailing list
> > dev-platform@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-platform
>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Skia Content on OS X

2016-03-22 Thread Mason Chang
Hi David,

The main benefit is architectural with a huge simplification of our graphics 
code, with a nice side benefit of performance. As it stands today, we have 
multiple different rendering paths for each platform (Linux, OS X, Windows). 
That means every time we hit a graphics bug, we have to know three APIs that 
render just slightly different and we have to dig through each backend to 
figure out what’s going on. These all have slightly different performance 
characteristics as well, which takes some time. We don’t generally get a lot of 
benefit from having a distinct backend for platform also because other than on 
Windows, we’re not using the GPU for content rendering. This essentially means 
we’re spinning a lot of wheels and cost on small fixes on non-windows platforms 
for little benefit. [1]. This is especially true when you consider that we have 
special backends for both Linux and OS X which make up 2.6% of our user base.

With Skia, we can unify all of our graphics pipeline across all platforms other 
than Windows for content rendering. It uses CPU rendering and because of that, 
fixes on one platform translate much better across other platforms that use 
Skia. While it would be nice to use the GPU, we’re not totally confident that 
using the GPU to render content is quite worth it. It’s also quite nice that 
micro-level optimizations at the backend level can mostly be done for us as 
Skia is optimizing performance with Chrome as one of their use cases. e.g., on 
Mac, scaling content on the CPU was 2-3x faster with Skia versus CG.
 
Overall, it’s mostly a clean up operation so we spend less time fixing each 
individual platform.

Please let me know if you have any more questions.

Thanks,
Mason

[1] https://people.mozilla.org/~danderson/moz-gfx-telemetry/www/

> On Mar 22, 2016, at 8:21 AM, Mike de Boer  wrote:
> 
> I was also quite curious, so I started clicking up the hierarchy of that bug 
> and ended up at:
> 
> https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1 
> 
> 
> (comment 2 is also useful info)
> 
> Ultimate goal: no more checkerboarding in APZ. But Mason is the authority 
> here, methinks :-)
> 
> Cheers,
> 
> Mike.
> 
>> On 22 Mar 2016, at 15:45, David Rajchenbach-Teller  
>> wrote:
>> 
>> Out of curiosity, what's the benefit?
>> 
>> On 22/03/16 15:44, Mason Chang wrote:
>>> Hi all,
>>> 
>>> We're changing the default graphics backend on OS X from CoreGraphics to
>>> Skia. In the best case, you should notice no difference.
>>> 
>>> If you see any graphics artifacts on mac, please file a bug and make it
>>> block bug 1207332 .
>>> You can verify that the artifact you're seeing is due to the switch by
>>> going to about:config, set the preference "gfx.content.azure.backends" to
>>> "cg", restarting Firefox and seeing if the artifact still appears.
>>> 
>>> Thanks to Lee Salzman, Jeff Muizelaar, and Markus Stange for their
>>> tremendous efforts in getting this accomplished.
>>> 
>>> Thanks,
>>> Mason
>>> ___
>>> dev-platform mailing list
>>> dev-platform@lists.mozilla.org
>>> https://lists.mozilla.org/listinfo/dev-platform
>>> 
>> ___
>> dev-platform mailing list
>> dev-platform@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-platform
> 
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Skia Content on OS X

2016-03-22 Thread Ben Kelly
On Tue, Mar 22, 2016 at 11:44 AM, William Lachance 
wrote:

> On 2016-03-22 11:21 AM, Mike de Boer wrote:
>
>> I was also quite curious, so I started clicking up the hierarchy of that
>> bug and ended up at:
>>
>> https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1 <
>> https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1>
>>
>> (comment 2 is also useful info)
>>
>> Ultimate goal: no more checkerboarding in APZ. But Mason is the authority
>> here, methinks :-)
>>
>
> Yeah, there were some really nice wins as a result of this change that
> Perfherder picked up:
>
> https://treeherder.mozilla.org/perf.html#/alerts?id=534
>

Have we done any measurements on how this impacts battery usage?  Just
curious.

Thanks!

Ben
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Skia Content on OS X

2016-03-22 Thread William Lachance

On 2016-03-22 11:21 AM, Mike de Boer wrote:

I was also quite curious, so I started clicking up the hierarchy of that bug 
and ended up at:

https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1 


(comment 2 is also useful info)

Ultimate goal: no more checkerboarding in APZ. But Mason is the authority here, 
methinks :-)


Yeah, there were some really nice wins as a result of this change that 
Perfherder picked up:


https://treeherder.mozilla.org/perf.html#/alerts?id=534

Will

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Skia Content on OS X

2016-03-22 Thread Mike de Boer
I was also quite curious, so I started clicking up the hierarchy of that bug 
and ended up at:

https://bugzilla.mozilla.org/show_bug.cgi?id=1154825#c1 


(comment 2 is also useful info)

Ultimate goal: no more checkerboarding in APZ. But Mason is the authority here, 
methinks :-)

Cheers,

Mike.

> On 22 Mar 2016, at 15:45, David Rajchenbach-Teller  
> wrote:
> 
> Out of curiosity, what's the benefit?
> 
> On 22/03/16 15:44, Mason Chang wrote:
>> Hi all,
>> 
>> We're changing the default graphics backend on OS X from CoreGraphics to
>> Skia. In the best case, you should notice no difference.
>> 
>> If you see any graphics artifacts on mac, please file a bug and make it
>> block bug 1207332 .
>> You can verify that the artifact you're seeing is due to the switch by
>> going to about:config, set the preference "gfx.content.azure.backends" to
>> "cg", restarting Firefox and seeing if the artifact still appears.
>> 
>> Thanks to Lee Salzman, Jeff Muizelaar, and Markus Stange for their
>> tremendous efforts in getting this accomplished.
>> 
>> Thanks,
>> Mason
>> ___
>> dev-platform mailing list
>> dev-platform@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-platform
>> 
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Skia Content on OS X

2016-03-22 Thread David Rajchenbach-Teller
Out of curiosity, what's the benefit?

On 22/03/16 15:44, Mason Chang wrote:
> Hi all,
> 
> We're changing the default graphics backend on OS X from CoreGraphics to
> Skia. In the best case, you should notice no difference.
> 
> If you see any graphics artifacts on mac, please file a bug and make it
> block bug 1207332 .
> You can verify that the artifact you're seeing is due to the switch by
> going to about:config, set the preference "gfx.content.azure.backends" to
> "cg", restarting Firefox and seeing if the artifact still appears.
> 
> Thanks to Lee Salzman, Jeff Muizelaar, and Markus Stange for their
> tremendous efforts in getting this accomplished.
> 
> Thanks,
> Mason
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
> 
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform