1. 05 Mar, 2012 27 commits
    • Robert Bragg's avatar
      build: list cogl-bitmap-packing.h as source file · 85dddf99
      Robert Bragg authored
      This fixes make release-check because cogl-bitmap-packing.h wasn't being
      packaged.
      85dddf99
    • Robert Bragg's avatar
      build: clean .log file in tests/conform dir · 316a515f
      Robert Bragg authored
      When running the conformance tests we write to a .log file which wasn't
      being removed by make clean which was causing make release-check to
      fail.
      316a515f
    • Robert Bragg's avatar
      test: remove FEATURE_GL requirement for sub_texture test · 13ba312d
      Robert Bragg authored
      test-cogl-sub-texture was fixed to now run on GLES2 since commit
      5928cade so this removes the TEST_REQUIREMENT_GL flag for this test
      so it doesn't get flagged as an unexpected pass.
      13ba312d
    • Robert Bragg's avatar
      docs: remove redundancies from doc/RELEASING · bd8f0a56
      Robert Bragg authored
      This removes the notes about explicitly testing a release on GLES2 and
      with the different pipeline backends since the test suite now does this
      for us.
      bd8f0a56
    • Robert Bragg's avatar
      cogl-hello: use glib mainloop for portability · ae091f2c
      Robert Bragg authored
      To be a portable example this updates cogl-hello to use the glib
      mainloop instead of using g_poll. On OSX we plan to provide custom
      mainloop integration for glib which can't be abstracted by just using
      g_poll.
      ae091f2c
    • Robert Bragg's avatar
      wayland-renderer: remove the _EXP suffix from symbols · 5eb62ad1
      Robert Bragg authored
      We are in the process of removing all _EXP suffix mangling for
      experimental APIs (Ref: c6528c4b) and adding missing gtk-doc
      comments so that we can instead rely on the "Stability: unstable"
      markers in the gtk-doc comments. This patch tackles the
      cogl-wayland-renderer api symbols.
      Reviewed-by: 's avatarNeil Roberts <neil@linux.intel.com>
      5eb62ad1
    • Neil Roberts's avatar
      Don't use cogl_get_draw_framebuffer when flushing pipeline state · 75226501
      Neil Roberts authored
      Some of the state when flushing a pipeline depends on the current
      framebuffer being used. These are:
      
      • The matrix stack, so that it can flip vertically or not depending on
        whether the framebuffer is offscreen.
      • The colormask. This is combined with the framebuffer's color mask.
      • The cull face mode. If the framebuffer is offscreen then backface
        culling is translated to frontface culling and vice-versa.
      
      These states were not working if the new framebuffer draw_primitive
      API was used because in that case the framebuffer is not pushed to the
      framebuffer stack so it would use the wrong one. This patch changes it
      to use ctx->current_draw_buffer which is a pointer to the framebuffer
      whose state was last flushed.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=670793Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      75226501
    • Neil Roberts's avatar
      Port the test-pixel-buffer test · 6ad168e4
      Neil Roberts authored
      This ports the text-pixel-buffer test from being a Clutter test to a
      straight Cogl test.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      6ad168e4
    • Neil Roberts's avatar
      cogl-bitmap: Add a public accessor for the underlying pixel buffer · 76c2bd84
      Neil Roberts authored
      This adds a small cogl_bitmap_get_buffer public function. Note that
      this can return NULL if the bitmap was not created with a pixel
      buffer. It might be nice to change this eventually so that all bitmaps
      have a pixel buffer.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      76c2bd84
    • Neil Roberts's avatar
      Add the missing cast macros for some buffer objects · 71145888
      Neil Roberts authored
      CoglPixelBuffer, CoglAttributeBuffer and CoglIndexBuffer were missing
      public cast macros.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      71145888
    • Neil Roberts's avatar
      Make _cogl_bitmap_get_{width,height,format,rowstride} public · 1397a2da
      Neil Roberts authored
      This are now marked as public experimental
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      1397a2da
    • Neil Roberts's avatar
      Change API so that CoglPixelBuffer no longer knows its w/h/format · 3700cc26
      Neil Roberts authored
      The idea is that CoglPixelBuffer should just be a buffer that can be
      used for pixel data and it has no idea about the details of any images
      that are stored in it. This is analogous to CoglAttributeBuffer which
      itself does not have any information about the attributes. When you
      want to use a pixel buffer you should create a CoglBitmap which points
      to a region of the attribute buffer and provides the extra needed
      information such as the width, height and format. That way it is also
      possible to use a single CoglPixelBuffer with multiple bitmaps.
      
      The changes that are made are:
      
      • cogl_pixel_buffer_new_with_size has been removed and in its place is
        cogl_bitmap_new_with_size. This will create a pixel buffer at the
        right size and rowstride for the given width/height/format and
        immediately create a single CoglBitmap to point into it. The old
        function had an out-parameter for the stride of the image but with
        the new API this should be queriable from the bitmap (although there
        is no function for this yet).
      
      • There is now a public cogl_pixel_buffer_new constructor. This takes
        a size in bytes and data pointer similarly to
        cogl_attribute_buffer_new.
      
      • cogl_texture_new_from_buffer has been removed. If you want to create
        a texture from a pixel buffer you should wrap it up in a bitmap
        first. There is already API to create a texture from a bitmap.
      
      This patch also does a bit of header juggling because cogl-context.h
      was including cogl-texture.h and cogl-framebuffer.h which were causing
      some circular dependencies when cogl-bitmap.h includes cogl-context.h.
      These weren't actually needed in cogl-context.h itself but a few other
      headers were relying on them being included so this adds the #includes
      where necessary.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      3700cc26
    • Neil Roberts's avatar
      Add a public cogl_framebuffer_read_pixels_into_bitmap · 10a38bb1
      Neil Roberts authored
      This adds a public function to read pixels from a framebuffer into a
      CoglBitmap. This replaces the internal function
      _cogl_read_pixels_with_rowstride because a CoglBitmap contains a
      rowstride so it can be used for the same purpose. A CoglBitmap already
      has public API to make one that points to a CoglPixelBuffer so this
      function can be used to read pixels into a PBO. It also avoids the
      need to push the framebuffer on to the context's stack so it provides
      a function which can be used in the 2.0 API after the stack is
      removed.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      10a38bb1
    • Neil Roberts's avatar
      cogl-buffer: Create the buffer store when bound · 25018990
      Neil Roberts authored
      Whenever the buffer is bound with _cogl_buffer_bind Cogl now ensures
      the buffer's data store has been created. Previously it would only
      ensure it was created when it was first mapped or when the first data
      was set on it. This is necessary if we are going to use CoglBuffers
      for retrieving data from GL. In that case the buffer won't be mapped
      or have data set on it before it is used.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      25018990
    • Neil Roberts's avatar
      bitmap: Support pre/unpre-multiplying any format · 1b47ff0d
      Neil Roberts authored
      If the fast-path inplace premult conversion can't be used then it will
      now fallback to unpacking the buffer into a row of guint16s and use
      the generic conversion.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      1b47ff0d
    • Neil Roberts's avatar
      bitmap: Add a function to convert into an existing buffer · 031dd661
      Neil Roberts authored
      This adds _cogl_bitmap_convert_into_bitmap which is the same as
      _cogl_bitmap_convert except that it writes into an existing bitmap
      instead of allocating a new one. _cogl_bitmap_convert now just
      allocates a buffer and calls the new function. This is used in
      _cogl_read_pixels to avoid allocating a second intermediate buffer
      when the pixel format to store in is not GL_RGBA.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      031dd661
    • Neil Roberts's avatar
      _cogl_bitmap_convert: Also handle premult conversions · f4cd5ace
      Neil Roberts authored
      If we are going to unpack the data into a known format anyway we might
      as well do the premult conversion instead of delaying it to do
      in-place. This helps because not all formats with alpha channels are
      handled by the in-place premult conversion code. This removes the
      _cogl_bitmap_convert_format_and_premult function so that now
      _cogl_bitmap_convert is a completely general purpose function that can
      convert from anything to anything. _cogl_bitmap_convert now includes a
      fast path for when the base formats are the same and the premult
      conversion can be handled with the in-place code so that we don't need
      to unpack and can just copy the bitmap instead.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      f4cd5ace
    • Neil Roberts's avatar
      bitmap: Remove the split between 'image library' and 'fallback' · 8ce5f5ad
      Neil Roberts authored
      Previously the bitmap code was setup so that there could be an image
      library used to convert between formats and then some 'fallback' code
      when the image library can't handle the conversion. However there was
      never any implementation of the conversion in the image library so the
      fallback was always used. I don't think this split really makes sense
      so this patch renames cogl-bitmap-fallback to cogl-bitmap-conversion
      and removes the stub conversion functions in the image library.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      8ce5f5ad
    • Neil Roberts's avatar
      tests: Add a test which writes all pixel formats · b85f2e90
      Neil Roberts authored
      This adds a test similar to the test-read-texture-formats test but
      that updates data on a 1x1 pixel RGBA texture instead. On GLES2 this
      should end up testing all of the convesion code because in that case
      GL only supports reading back RGBA data.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      b85f2e90
    • Neil Roberts's avatar
      tests: Test reading all pixel formats · 70dfbdd5
      Neil Roberts authored
      The test-read-alpha-texture test has been replaced with a test that
      tries reading an RGBA texture in all current pixel formats. On GLES2
      this should end up testing all of the convesion code because in that
      case GL only supports reading back RGBA data. The test now works on
      GLES2 since the conversion code for all of the formats has been added
      so this also removes the GL requirement.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      70dfbdd5
    • Neil Roberts's avatar
      bitmap-fallback: Support converting all pixel format types · 908ba29b
      Neil Roberts authored
      _cogl_bitmap_fallback_convert now supports converting to and from all
      of the pixel formats, except it continues to preserve the premult
      status of the original bitmap. The pixels are unpacked into a
      temporary buffer that is either 8-bits per component or 16-bits per
      component RGBA depending on whether the destination format is going to
      use more than 8 bits per component (eg RGBA_1010102). The packing and
      unpacking code is stored in a separate header which is included twice
      to generate the functions needed for both sizes of unpacked data. The
      hope is that when converting between two formats that are both 8-bit
      sized, such as swizzling between BGRA and RGBA, then the
      multiplications and divisions in the code will be optimized out and it
      shouldn't be too inefficient. Previously the inner switch statement to
      decide which conversion to use only operated on one pixel at a time so
      it was probably relatively slow.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      908ba29b
    • Neil Roberts's avatar
      Avoid making up the format COGL_PIXEL_FORMAT_A_8_PRE · 323adc0c
      Neil Roberts authored
      There are a few places in Cogl that try to set the premult bit on a
      pixel format depending on whether it has an alpha channel. However
      this breaks if the pixel format is alpha-only because premultiplying
      data without any RGB components doesn't make any sense. This adds an
      internal macro to check for cases where we should add the premult bit
      called COGL_PIXEL_FORMAT_CAN_HAVE_PREMULT. This now gets used in all
      places that previously just checking for COGL_A_BIT.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=671016Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      323adc0c
    • Neil Roberts's avatar
      Assert that we get a valid format in pixel_format_to_gl{,es} · 2b9aca20
      Neil Roberts authored
      The assert could use a 'default:' label but that would stop GCC from
      giving a warning when a new enum value is added.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=671016Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      2b9aca20
    • Neil Roberts's avatar
      Add a conformance test for reading back an RGBA texture as alpha-only · b6dc2337
      Neil Roberts authored
      This just creates a 1x1 RGBA texture and then reads it back in
      COGL_PIXEL_FORMAT_A_8 format. Gnome Shell is doing this to create a
      shadow and I accidentally broke it so this should hopefully stop that
      happening again.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=671016Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      b6dc2337
    • Matej Urbančič's avatar
      Updated Slovenian translation · 59fd9b49
      Matej Urbančič authored
      59fd9b49
    • Martin Srebotnjak's avatar
      Updated Slovenian translation · 8e5fc7d9
      Martin Srebotnjak authored
      8e5fc7d9
    • Matic Gradišer's avatar
      Updated Slovenian translation · e252dfd4
      Matic Gradišer authored
      e252dfd4
  2. 29 Feb, 2012 1 commit
    • Neil Roberts's avatar
      cogl-winsys-egl-wayland: Include cogl-wayland-renderer.h · 933db018
      Neil Roberts authored
      The Wayland winsys defines functions declared in
      cogl-wayland-renderer.h so it should include the header to make sure
      the declarations are right. This was breaking because currently the
      header #defines the _EXP suffixes on to the function names so it would
      end up exporting the wrong symbol names.
      933db018
  3. 26 Feb, 2012 1 commit
  4. 24 Feb, 2012 3 commits
    • Мирослав Николић's avatar
      60b8e988
    • Robert Bragg's avatar
      tests: Improve thoroughness and reporting of make test · bbcbece6
      Robert Bragg authored
      This patch reworks our conformance testing framework because it seems
      that glib's gtesting framework isn't really well suited to our use case.
      For example we weren't able to test windows builds given the way we
      were using it and also for each test we'd like to repeat the test
      with several different environments so we can test important driver and
      feature combinations.
      
      This patch instead switches away to a simplified but custom approach for
      running our unit tests. We hope that having a more bespoke setup will
      enable us to easily extend it to focus on the details important to us.
      
      Notable changes with this new approach are:
      
      We can now run 'make test' for our mingw windows builds.
      
      We've got rid of all the test-*report* make rules and we're just left
      with 'make test'
      
      'make test' now runs each test several times with different driver and
      feature combinations checking the result for each run. 'make test' will
      then output a concise table of all of the results.
      
      The combinations tested are:
      - OpenGL Fixed Function
      - OpenGL ARBfp
      - OpenGL GLSL
      - OpenGL No NPOT texture support
      - OpenGLES 2.0
      - OpenGLES 2.0 No NPOT texture support
      Reviewed-by: 's avatarNeil Roberts <neil@linux.intel.com>
      bbcbece6
    • Robert Bragg's avatar
      renderer: Adds getters/setters for driver preference · be237cc2
      Robert Bragg authored
      This adds api for explicitly choosing what underlying driver cogl should
      use internally for rendering as well as api for querying back what
      driver is actually in use.
      Reviewed-by: 's avatarNeil Roberts <neil@linux.intel.com>
      be237cc2
  5. 23 Feb, 2012 2 commits
    • Neil Roberts's avatar
      test-sub-texture: Request texture data in premult format · 5928cade
      Neil Roberts authored
      When requesting the texture data to test that we get back what we
      uploaded, we need to ask for it in a premult format otherwise it will
      get converted and the test will fail. This was working for the GL
      driver because of a bug where it would fail to do the conversion.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      5928cade
    • Neil Roberts's avatar
      texture: Handle premult conversions when getting texture data · 39c6bf59
      Neil Roberts authored
      cogl_texture_get_data uses find_best_gl_get_data_format from the
      texture driver which returns the closest format to use for retrieving
      pixel data given an intended format. However this function doesn't
      know about the texture we are reading data from so it doesn't know
      that the data we will actually receive will have the same premult
      status as the texture's format. With the GL driver, this function ends
      up returning exactly the same format as passed in which means it will
      never do a premult conversion. Under GLES it always returns
      COGL_PIXEL_FORMAT_RGBA_8888 so it will always make the data unpremult
      even if the final requested format is premultiplied.
      
      This patch fixes it so that it copies the premult status of the
      closest_format from the format of the underlying texture. That way it
      will later convert or not depending on the requested target format.
      
      Note this patch breaks test-sub-texture with the GL driver because
      that is incorrectly trying to read the texture data back as RGBA_8888
      even though it depends on it not doing a premult conversion. The test
      was already broken with GLES2 and remains broken.
      Reviewed-by: 's avatarRobert Bragg <robert@linux.intel.com>
      39c6bf59
  6. 22 Feb, 2012 6 commits