On Mon, Jun 9, 2014 at 1:28 PM, Benoit Jacob <jacob.benoi...@gmail.com>
wrote:

> 2014-06-09 16:12 GMT-04:00 Benoit Jacob <jacob.benoi...@gmail.com>:
>
> >
> >
> >
> > 2014-06-09 15:56 GMT-04:00 Botond Ballo <bba...@mozilla.com>:
> >
> > ----- Original Message -----
> >> > From: "Benoit Jacob" <jacob.benoi...@gmail.com>
> >> > To: "Botond Ballo" <bba...@mozilla.com>
> >> > Cc: "dev-platform" <dev-platform@lists.mozilla.org>
> >> > Sent: Monday, June 9, 2014 3:45:20 PM
> >> > Subject: Re: C++ standards proposals of potential interest, and
> >> upcoming committee meeting
> >> >
> >> > 2014-06-09 15:31 GMT-04:00 Botond Ballo <bba...@mozilla.com>:
> >> >
> >> > > Cairo-based 2D drawing API (latest revision):
> >> > >   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4021.pdf
> >> > >
> >> >
> >> > I would like the C++ committee's attention to be drawn to the dangers,
> >> for
> >> > committee, to try to make decisions outside of its domain of
> expertise.
> >> I
> >> > see more potential for harm than for good in having the C++ committee
> >> join
> >> > the ranks of non graphics specialists thinking they know how to do
> >> > graphics...
> >>
> >> Does this caution apply even if the explicit goal of this API is to
> allow
> >> people learning C++ and/or creating simple graphical applications to be
> >> able to do so with minimal overhead (setting up third-party libraries
> and
> >> such), rather than necessarily provide a tool for
> expert-level/heavy-duty
> >> graphics work?
> >>
> >
> > That would ease my concerns a lot, if that were the case, but skimming
> > through the proposal, it explicitly seems not to be the case.
> >
> > The "Motivation and Scope" section shows that this aims to target drawing
> > GUIs and cover other needs of graphical applications, so it's not just
> > about learning or tiny use cases.
> >
> > Even more worryingly, the proposal talks about GPUs and Direct3D and
> > OpenGL and even Mantle, and that scares me, given what we know about how
> > sad it is to have to take an API like Cairo (or Skia, or Moz2D, or Canvas
> > 2D, it doesn't matter) and try to make it efficiently utilize GPUs. The
> > case of a Cairo-like or Skia-like API could totally be made, but the only
> > mention of GPUs should be to say that they are mostly outside of its
> scope;
> > anything more enthusiastic than that confirms fears that the proposal's
> > authors are not talking out of experience.
> >
>
> It's actually even worse than I realized: the proposal is peppered with
> performance-related comments about GPUs. Just search for "GPU" in it, there
> are 42 matches, most of them scarily talking about GPU performance
> characteristics (a typical one is "GPU resources are expensive to copy").
>
> This proposal should either not care at all about GPU details, which would
> be totally fine for a basic software 2D renderer, which could already cover
> the needs of many applications; or, if it were to seriously care about
> running fast on GPUs, it would not use Cairo as its starting point and it
> would look totally different (it would try to lend itself ot seamlessly
> batching and reordering drawing primitives; typically, a declarative /
> scene-graph API would be a better starting point).
>

This is a terrible proposal. For instance:

class surface {

...

void finish();

void flush();

::std::shared_ptr<device> get_device();

content get_content();

void mark_dirty();

void mark_dirty_rectangle(const rectangle& rect);

void set_device_offset(const point& offset);

void get_device_offset(point& offset);

void write_to_png(const ::std::string& filename);

image_surface map_to_image(const rectangle& extents);

void unmap_image(image_surface& image);

bool has_surface_resource() const;


They simply took the Cairo C library and wrapped it up in classes.
Taking something like the Canvas 2D API and adding support for layers,
filters and proper text support would be a better way to go.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to