diff options
author | Neil Roberts <neil@linux.intel.com> | 2011-08-31 17:22:20 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-09-05 19:02:04 +0100 |
commit | 503f138fb67f6c0d742055bc7ed9974dd9af2e05 (patch) | |
tree | 19cab64afd9e604f2594e2fd864aea6c386bee1b /cogl/cogl-texture-private.h | |
parent | 5ac563afdbd626cc0f1f1b1062ba7e7cd58dd9be (diff) | |
download | cogl-503f138fb67f6c0d742055bc7ed9974dd9af2e05.tar.gz |
texture: Call _cogl_texture_prepare_for_upload in set_region impl
Instead of calling _cogl_texutre_prepare_for_upload in
cogl_texture_set_region_from_bitmap the call is now deferred to the
implementation of the virtual for set_region. This is needed if the
texture backend is using a different format for the actual GL texture
than what is reported by cogl_texture_get_format. This happens for
example with atlas textures which report the original internal format
specified when the texture was created but actually always store the
data in an RGBA texture.
Also when creating an atlas texture from a bitmap it was preparing the
bitmap to be uploaded to the original format instead of the format of
the actual texture used for the atlas. Then it was using
cogl_texture_set_region_from_bitmap to upload the 5 pieces to make the
copies of the edge pixels. This would end up converting the image to
the actual format 5 times. The atlas textures have now been changed to
prepare the bitmap for the right format.
https://bugzilla.gnome.org/show_bug.cgi?id=657840
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl-texture-private.h')
-rw-r--r-- | cogl/cogl-texture-private.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h index 767069a4..01fba91b 100644 --- a/cogl/cogl-texture-private.h +++ b/cogl/cogl-texture-private.h @@ -67,8 +67,10 @@ struct _CoglTextureVtable backend */ /* This should update the specified sub region of the texture with a - sub region of the given bitmap. The bitmap will have first been - converted to a suitable format for uploading if neccessary. */ + sub region of the given bitmap. The bitmap is not converted + before being passed so the implementation is expected to call + _cogl_texture_prepare_for_upload with a suitable destination + format before uploading */ gboolean (* set_region) (CoglTexture *tex, int src_x, int src_y, |