1. 20 Jul, 2011 7 commits
    • Robert Bragg's avatar
      Release 1.7.4 (snapshot) · 7a9e471f
      Robert Bragg authored
      7a9e471f
    • Robert Bragg's avatar
      dist: enable more features for distcheck · 828c5165
      Robert Bragg authored
      As a bare minimum we want to ensure that are releases are able to build
      with support for gles1, gles2, gl, egl and glx. Previously we only
      checked the build with gl + glx enabled and our last release actually
      missed a header file required for building with egl.
      828c5165
    • Robert Bragg's avatar
      dist: Don't use elaborate script to gen Changelogs · 1431a728
      Robert Bragg authored
      The changelog generation scripts used for releases are overly elaborate
      and fragile. A Changelog is also no substitute for the Git log so now we
      simply ship a static Changelog that points to the Git log instead.
      1431a728
    • Robert Bragg's avatar
    • Robert Bragg's avatar
      Updates NEWS for 1.7.4 release · aebaa86d
      Robert Bragg authored
      aebaa86d
    • Robert Bragg's avatar
      gles: don't check for glClientActiveTexture · 52a5fae1
      Robert Bragg authored
      in cogl-ext-functions.h we had one multitexture feature that checked for
      the ARB_multitexture extension and if found it then expected to find
      glActiveTexture and glClientActiveTexture. The problem is that the
      multitexture extension is part of the core GLES 1 and 2 APIs except that
      for GLES2 there is no glClientActiveTexture function. By trying to
      handle it as one feature that meant that Cogl would fail to check the
      multitexture extension which is a hard requirement for Cogl.
      
      The reason this went unnoticed is because Cogl can indirectly end up
      linked to an OpenGL library via cairo and so we were finding a
      glClientActiveTexture symbol there. This highlights that we should
      probably stop using g_module_open (NULL) when checking features and
      instead we should use the module we opened in cogl-renderer.c.
      52a5fae1
    • Robert Bragg's avatar
      x11: don't try and close a NULL display · 1144a05b
      Robert Bragg authored
      If we failed to open an X display then don't later try and close a NULL
      display resulting in a crash.
      1144a05b
  2. 19 Jul, 2011 4 commits
    • Robert Bragg's avatar
      Adds ColorMask support to Cogl · 8b34a393
      Robert Bragg authored
      
      
      This adds CoglPipeline and CoglFramebuffer support for setting a color
      mask which is a bit mask defining which color channels should be written
      to the current framebuffer.
      
      The final color mask is the intersection of the framebuffer color mask
      and the pipeline color mask. The framebuffer mask affects all rendering
      to the framebuffer while the pipeline masks can be used to affect
      individual primitives.
      
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      8b34a393
    • Neil Roberts's avatar
      configure: Add configure options to override the GL library name · 9b6c1eb2
      Neil Roberts authored
      This adds 3 configure options to override the library name that gets
      dlopened for GL, GLES and GLESv2. This could be useful for distro
      maintainers who have an unusual name for the libraries (for example,
      on OpenBSD the GL library appears to be called libGL.so.4). This could
      at least be simpler than having to create a distro patch.
      
      The configure options would be used like this:
      
      ./configure --with-gl-libname=libGL.so \
                  --with-gles1-libname=libGLESv1.so \
                  --with-gles2-libname=libGLESv2.so
      
      https://bugzilla.gnome.org/show_bug.cgi?id=654593
      9b6c1eb2
    • Neil Roberts's avatar
      Specify the full filename when g_module_open'ing the GL library · 03c4b209
      Neil Roberts authored
      Instead of using g_module_build_path with the short name of the GL
      library (eg, "GL") and relying on glib to add the suffix and prefix,
      the configure script now directly encodes the full name including the
      version number (eg, "libGL.so.1"). This is necessary because distros
      don't always install the non-versioned suffix for the library.
      
      The GLES libraries are left without the version suffix because it's
      not clear what should be placed here and I can't find any
      documentation from Khronos to clarify this. Mesa seems to install a
      file called libGLESv2.so.2 but the IMG SDK doesn't install any
      versioned library. There is an example of dynamically loading
      libGLESv2 in the Chromium source code and that does not use the
      version suffix even though it does use the version suffix for GL. This
      implies that it's at least fairly normal to load the unversioned name
      for GLES.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=654593
      03c4b209
    • Robert Bragg's avatar
      gles: Or in private features into ctx->private_feature_flags · eb578e4e
      Robert Bragg authored
      When we moved all the GL function pointers to be part of CoglContext in
      commit dae02a99
      
       we made a mistake and started to OR in the private
      COGL_PRIVATE_FEATURE_TEXTURE_2D_FROM_EGL_IMAGE feature flag into the non
      private flags which would mean cogl would think the GL_OES_EGL_image
      extension wasn't supported.
      
      Reviewed-by: default avatarNeil Roberts <neil@linux.intel.com>
      eb578e4e
  3. 18 Jul, 2011 7 commits
  4. 13 Jul, 2011 8 commits
    • Robert Bragg's avatar
      Use MESA_pack_invert to avoid read_pixels flip · 6f79eb8a
      Robert Bragg authored
      
      
      cogl_read_pixels returns image data in a top-down memory order, but
      because OpenGL normally returns pixel data in a bottom-up order we
      have to flip the data before returning it to the user. If the OpenGL
      driver supports the GL_MESA_pack_invert extension though we can ask the
      driver to return the data in a top-down order in the first place.
      
      Signed-off-by: default avatarNeil Roberts <neil@linux.intel.com>
      6f79eb8a
    • Robert Bragg's avatar
      build: don't referencing wayland syms if not available · 1527b017
      Robert Bragg authored
      
      
      cogl-winsys-egl-feature-functions.h was unconditionally depending on the
      struct wl_display type being defined. This guards the check for the
      "WL_bind_wayland_display" extension with
       #ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
      
      Signed-off-by: default avatarNeil Roberts <neil@linux.intel.com>
      1527b017
    • Robert Bragg's avatar
      configure: Expose COGL_HAS_GLX_SUPPORT publicly · 27c0da66
      Robert Bragg authored
      
      
      Instead of only exposing COGL_HAS_GLX_SUPPORT internally in config.h we
      now expose it though the public cogl-defines.h header.
      
      Signed-off-by: default avatarNeil Roberts <neil@linux.intel.com>
      27c0da66
    • Robert Bragg's avatar
      framebuffer: Add dither_enabled getter/setters · 3ed8c8d0
      Robert Bragg authored
      
      
      This adds a getter and setter for requesting dithering to be enabled.
      
      Dithering is a hardware dependent technique to increase the visible
      color resolution beyond what the underlying hardware supports by playing
      tricks with the colors placed into the framebuffer to give the illusion
      of other colors. (For example this can be compared to half-toning used
      by some news papers to show varying levels of grey even though their may
      only be black and white are available).
      
      The results of enabling dithering are platform dependent and may have no
      effect.
      
      Signed-off-by: default avatarNeil Roberts <neil@linux.intel.com>
      3ed8c8d0
    • Emmanuele Bassi's avatar
      ee4adeff
    • Neil Roberts's avatar
      cogl-pipeline: Use the pipeline cache for the GLSL backends · f3b90d17
      Neil Roberts authored
      The CoglPipelineCache is now extended to store templates for state
      affecting vertex shaders and combined programs. The GLSL fragend,
      vertend and progend now uses this to get cached shaders and a program.
      
      When a new pipeline is created it will now get hashed three times if
      the GLSL backends are in use (once for the fragend, once for the
      vertend and once for the progend). Ideally we should add some way for
      the progend to check its cache before the fragends and vertends are
      checked so that it can bypass them entirely if it can find a cached
      combined program.
      f3b90d17
    • Neil Roberts's avatar
      fragend-arbfp: Move the pipeline cache to a separate file · 461bff18
      Neil Roberts authored
      The pipeline cache is now handled in CoglPipelineCache instead of
      directly in the ARBfp fragend. The flags needed to hash a pipeline
      should be exactly the same for the ARBfp and GLSL fragends so it's
      convenient to share the code. The hash table now stores the actual
      pipeline as the value instead of the private data so that the two
      fragends can attach their data to it. That way it's possible to use
      the same pipeline key with ancestors that are using different
      fragends.
      
      The hash table is created with g_hash_table_new_full to set a
      destructor for the key and value and there is a destructor for
      CoglPipelineCache that gets called when the CoglContext is
      destroyed. That way we no longer leak the pipelines and shader state
      when the context is desroyed.
      461bff18
    • Neil Roberts's avatar
      pipeline: Unify how the backends store private data · d69d49fa
      Neil Roberts authored
      Previously the fragends had a separate private data pointer which was
      used by the GLSL and ARBfp fragends to store a tiny struct containing
      a single pointer to the ref-counted shader state. The space for the
      private data pointer is reserved in all of the pipelines for all of
      the potential backends. The vertends and progends however did this
      differently by directly storing the pointer to the ref counted data
      using cogl_object_set_user_data. This patch unifies the different
      methods so that they all use cogl_object_set_user_data and the
      fragends don't bother with the separate tiny allocation for the
      private data. The private data pointer array has been removed from
      CoglPipeline and the corresponding fragend virtual to free the private
      data has also been removed because this can instead be done with the
      destroy notify from the object user data.
      
      The variable names used have been unified so that all of the vertends
      and fragends name their data struct CoglPipelineShaderState and use a
      variable called shader_state to refer to it. The progend uses
      CoglPipelineProgramState and a variable called program_state.
      
      This should also fix two potential bugs. the ARBfp fragend was
      apprently leaking a reference to the private state when it creates the
      private data because it was adding a reference before stroring the
      pointer to the newly allocated data but the ref count is already set
      to 1 on creation. The other potential bug is that the free function
      for CoglPipeline was only calling the free_priv virtual for the
      currently used fragend of the pipeline. The design of the fragends is
      meant to allow a pipeline to have multiple fragend priv datas because
      a child pipeline could be attaching its fragend data to the ancestor
      and its allowed to pick a different fragend.
      d69d49fa
  5. 12 Jul, 2011 4 commits
  6. 11 Jul, 2011 7 commits
    • Robert Bragg's avatar
      dist: Make sure to dist cogl-winsys-egl-feature-functions.h · d7bbc442
      Robert Bragg authored
      
      
      cogl-winsys-egl-feature-functions.h wasn't being listed as source and so
      it wasn't ending up in dist tarballs.
      
      Signed-off-by: default avatarNeil Roberts <neil@linux.intel.com>
      d7bbc442
    • Robert Bragg's avatar
      dist: give 2.0 manual unique DOC_MODULE name · 40970ce9
      Robert Bragg authored
      
      
      The experimental 2.0 reference manual was setup with  DOC_MODULE name of
      "cogl" which conflicted with the 1.x API manual. This meant that when
      running make install for both the reference manuals all the html files
      would end up bundled together in the same location. The 2.0 API
      reference now has a DOC_MODULE name of "cogl-2.0-experimental" the
      corresponding -sections.txt and -docs.xml.in files have also been
      renamed to match this.
      
      Signed-off-by: default avatarNeil Roberts <neil@linux.intel.com>
      40970ce9
    • Robert Bragg's avatar
      Adds examples/crate to .gitignore · c6b0efb4
      Robert Bragg authored
      c6b0efb4
    • Robert Bragg's avatar
      fix namespace for cogl_context_egl_get_egl_context · c3b91da4
      Robert Bragg authored
      
      
      This renames cogl_context_egl_get_egl_context to
      cogl_egl_context_get_egl_context to be consistent with other platform
      specific APIs.
      
      Signed-off-by: default avatarNeil Roberts <neil@linux.intel.com>
      c3b91da4
    • Robert Bragg's avatar
      Remove cogl_context_set_default API · 09e7174b
      Robert Bragg authored
      
      
      For cogl 2.0 we don't want to have a default context. In the meantime
      we can simply assume that calling cogl_context_new() implicitly
      sets that context as the default context before returning.
      
      Signed-off-by: default avatarNeil Roberts <neil@linux.intel.com>
      09e7174b
    • Robert Bragg's avatar
      onscreen: make platform specific onscreen apis consistent · 38b67e28
      Robert Bragg authored
      
      
      There were several CoglOnscreen functions named like:
      cogl_onscreen_<platform>_blah instead of cogl_<platform>_onscreen_blah
      so this patch updates those to be consistent with other platform
      specific apis we have in cogl.
      
      Signed-off-by: default avatarNeil Roberts <neil@linux.intel.com>
      38b67e28
    • Neil Roberts's avatar
      Dynamically load the GL or GLES library · b2e735ff
      Neil Roberts authored
      The GL or GLES library is now dynamically loaded by the CoglRenderer
      so that it can choose between GL, GLES1 and GLES2 at runtime. The
      library is loaded by the renderer because it needs to be done before
      calling eglInitialize. There is a new environment variable called
      COGL_DRIVER to choose between gl, gles1 or gles2.
      
      The #ifdefs for HAVE_COGL_GL, HAVE_COGL_GLES and HAVE_COGL_GLES2 have
      been changed so that they don't assume the ifdefs are mutually
      exclusive. They haven't been removed entirely so that it's possible to
      compile the GLES backends without the the enums from the GL headers.
      
      When using GLX the winsys additionally dynamically loads libGL because
      that also contains the GLX API. It can't be linked in directly because
      that would probably conflict with the GLES API if the EGL is
      selected. When compiling with EGL support the library links directly
      to libEGL because it doesn't contain any GL API so it shouldn't have
      any conflicts.
      
      When building for WGL or OSX Cogl still directly links against the GL
      API so there is a #define in config.h so that Cogl won't try to dlopen
      the library.
      
      Cogl-pango previously had a #ifdef to detect when the GL backend is
      used so that it can sneakily pass GL_QUADS to
      cogl_vertex_buffer_draw. This is now changed so that it queries the
      CoglContext for the backend. However to get this to work Cogl now
      needs to export the _cogl_context_get_default symbol and cogl-pango
      needs some extra -I flags to so that it can include
      cogl-context-private.h
      b2e735ff
  7. 08 Jul, 2011 3 commits
    • Neil Roberts's avatar
      Move the cogl texture driver functions to a vtable · 5f181973
      Neil Roberts authored
      The texture driver functions are now accessed through a vtable pointed
      to by a struct in the CoglContext so that eventually it will be
      possible to compile both the GL and GLES texture drivers into a single
      binary and then select between them at runtime.
      5f181973
    • Neil Roberts's avatar
      cogl-context: Remove the driver private data · 59f746d2
      Neil Roberts authored
      Since the GL function pointers have move to the root of CoglContext,
      the driver specific data for GLES became empty and the GL data had
      only one varible which apparently nothing was using. It's therefore
      convenient to remove the private driver data to make it easier to have
      a build of Cogl which enables both GL and GLES support. If we ever
      need driver private data later we might want to use
      cogl_object_set_user_data instead.
      59f746d2
    • Neil Roberts's avatar
      Use all core GL functions through indirect pointers · 2b119b07
      Neil Roberts authored
      cogl-ext-functions.h now contains definitions for all of the core GL
      and GLES functions that we would normally link to directly. All of the
      code has changed to access them through the cogl context pointer. The
      GE macro now takes an extra parameter to specify the context because
      the macro itself needs to make GL calls but various points in the Cogl
      source use different names for the context variable.
      2b119b07