When splitting out the CoglPath api we saw that we would be left with
inconsistent drawing apis if the drawing apis in core Cogl were lumped
into the cogl_framebuffer_ api considering other Cogl sub-libraries or
that others will want to create higher level drawing apis outside of
Cogl but can't use the same namespace.
So that we can aim for a more consistent style this adds a
cogl_primitive_draw() api, comparable to cogl_path_fill() or
cogl_pango_show_layout() that's intended to replace
cogl_framebuffer_draw_primitive()
Note: the attribute and rectangle drawing apis are still in the
cogl_framebuffer_ namespace and this might potentially change but in
these cases there is no single object representing the thing being drawn
so it seems a more reasonable they they live in the framebuffer
namespace for now.
Note: the cogl_framebuffer_draw_primitive() api isn't removed by this
patch so it can more conveniently be cherry picked to the 1.16 branch so
we can mark it deprecated for a short while. Even though it's marked as
experimental api we know that there are people using the api so we'd
like to give them a chance to switch to the new api.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit 418912b93ff81a47f9b38114d05335ab76277c48)
Conflicts:
cogl-pango/cogl-pango-display-list.c
cogl/Makefile.am
cogl/cogl-framebuffer.c
cogl/cogl-pipeline-layer-state.h
cogl/cogl2-path.c
cogl/driver/gl/cogl-clip-stack-gl.c
Instead of simply relying on the emscripten mainloop api to wake us up
periodically so that we can poll for SDL events we now pause the
emscripten mainloop whenever no redraw is queued and instead hook an
input event listener into the real browser mainloop to resume the
emscripten mainloop whenever input is received. This way the example
can go to sleep while there's no input to handle.
This provides a simple example of binding custom javascript into native
code.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit a8b1e2eda491dc7c44c84cd47e160c7b8ba0f792)
This enables basic Emscripten support in Cogl via the SDL winsys.
Assuming you have setup an emscripten toolchain you can configure Cogl
like this:
emconfigure ./configure --enable-debug --enable-emscripten
Building the examples will build .html files that can be loaded directly
by a WebGL enabled browser.
Note: at this point the emscripten support has just barely been smoke
tested so it's expected that as we continue to build on this we will
learn about more things we need to change in Cogl to full support this
environment.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
(cherry picked from commit a3bc2e7539391b074e697839dfae60b69c37cf10)