[Cogl] [PATCH 00/11] Remove automagic texture apis

Robert Bragg robert at sixbynine.org
Thu Jun 27 09:22:07 PDT 2013


From: Robert Bragg <robert at linux.intel.com>

This series removes the texture apis that automatically allocate from multiple
possible texture backends and adds new apis that maintain the same level of
convenience but are more deterministic.

The concern has been that by hiding too many details of how textures are
actually allocated it's too easy for developers to miss-used the underlying
backends, such as by loading lots of large images into the atlas.

This series is also preparation for further work on the texture backends to
optionally allow configuration of textures before allocation, to support
asynchronous texture loading and to stop overloading the CoglPixelFormat
type for representing internal formats.

regards,
- Robert

Robert Bragg (11):
  texture: remove _cogl_texture_prepare_for_upload
  Expose CoglAtlasTexture api
  texture-2d: Add _new_from_file api
  2d-sliced: add _new_from_file/data/bitmap apis
  remove internal use of cogl_texture_new_with_size
  gst: don't use cogl_texture_new_with_data
  bitmap: calc rowstride from width * bpp if 0
  tests: stop using cogl-auto-texture apis
  examples: avoid using the auto-texture apis
  remove unused _cogl_texture_2d_sliced_new_from_foreign
  Remove cogl-auto-texture apis

 cogl-gst/cogl-gst-video-sink.c                | 131 +++++++----
 cogl-pango/cogl-pango-glyph-cache.c           |  11 +-
 cogl/Makefile.am                              |   4 +-
 cogl/cogl-atlas-texture-private.h             |  21 +-
 cogl/cogl-atlas-texture.c                     | 186 +++++++++-------
 cogl/cogl-atlas-texture.h                     | 214 ++++++++++++++++++
 cogl/cogl-atlas.c                             |  50 ++++-
 cogl/cogl-atlas.h                             |   1 -
 cogl/cogl-auto-texture.c                      | 299 --------------------------
 cogl/cogl-bitmap-conversion.c                 |  79 +++++++
 cogl/cogl-bitmap-private.h                    |   6 +
 cogl/cogl-bitmap.c                            |   4 +
 cogl/cogl-driver.h                            |   1 +
 cogl/cogl-primitive.h                         | 136 ++++++------
 cogl/cogl-texture-2d-private.h                |   6 +
 cogl/cogl-texture-2d-sliced-private.h         |  14 +-
 cogl/cogl-texture-2d-sliced.c                 | 281 ++++++++++--------------
 cogl/cogl-texture-2d-sliced.h                 | 165 ++++++++++++++
 cogl/cogl-texture-2d.c                        |  41 +++-
 cogl/cogl-texture-2d.h                        |  27 +++
 cogl/cogl-texture-3d.c                        |  46 ++--
 cogl/cogl-texture-private.h                   |  21 +-
 cogl/cogl-texture-rectangle.c                 |  67 +++---
 cogl/cogl-texture.c                           |  86 --------
 cogl/cogl-texture.h                           | 171 ++-------------
 cogl/cogl-types.h                             |  23 --
 cogl/cogl.h                                   |   1 +
 cogl/cogl.symbols                             |   6 -
 cogl/driver/gl/cogl-texture-2d-gl-private.h   |   1 +
 cogl/driver/gl/cogl-texture-2d-gl.c           |  76 ++++---
 cogl/driver/nop/cogl-texture-2d-nop-private.h |   1 +
 cogl/driver/nop/cogl-texture-2d-nop.c         |   1 +
 cogl/winsys/cogl-texture-pixmap-x11.c         |  56 ++++-
 doc/reference/cogl2/cogl2-sections.txt        |  15 ++
 examples/cogl-crate.c                         |  10 +-
 examples/cogl-gles2-context.c                 |  11 +-
 examples/cogl-msaa.c                          |   7 +-
 test-fixtures/test-utils.c                    | 182 ++++++++++++++++
 test-fixtures/test-utils.h                    | 111 ++++++++++
 tests/conform/test-atlas-migration.c          |  23 +-
 tests/conform/test-backface-culling.c         |  26 +--
 tests/conform/test-blend-strings.c            |  17 +-
 tests/conform/test-color-mask.c               |   4 +-
 tests/conform/test-just-vertex-shader.c       |  15 +-
 tests/conform/test-materials.c                |   4 +-
 tests/conform/test-multitexture.c             |   4 +-
 tests/conform/test-npot-texture.c             |  17 +-
 tests/conform/test-primitive.c                |  15 +-
 tests/conform/test-readpixels.c               |   4 +-
 tests/conform/test-snippets.c                 |  15 +-
 tests/conform/test-texture-get-set-data.c     |  23 +-
 tests/conform/test-texture-mipmap-get-set.c   |  17 +-
 tests/conform/test-texture-mipmaps.c          |   2 +-
 tests/conform/test-texture-no-allocate.c      |  35 +--
 tests/conform/test-texture-rectangle.c        |   4 +-
 tests/conform/test-viewport.c                 |   4 +-
 tests/conform/test-wrap-modes.c               |  19 +-
 57 files changed, 1611 insertions(+), 1206 deletions(-)
 create mode 100644 cogl/cogl-atlas-texture.h
 delete mode 100644 cogl/cogl-auto-texture.c

-- 
1.8.2.1



More information about the Cogl mailing list