-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Kristian Høgsberg wrote:
> diff --git a/src/mesa/drivers/dri/intel/intel_screen.c
> b/src/mesa/drivers/dri/intel/intel_screen.c
> index f7ce87e..c2c8c6e 100644
> --- a/src/mesa/drivers/dri/intel/intel_screen.c
> +++ b/src/mesa/drivers/dri/intel/intel_screen.c
> @@ -41,6 +41,7 @@
> #include "intel_fbo.h"
> #include "intel_screen.h"
> #include "intel_tex.h"
> +#include "intel_regions.h"
>
> #include "i915_drm.h"
>
> @@ -141,11 +142,84 @@ static const struct __DRI2flushExtensionRec
> intelFlushExtension = {
> intelDRI2FlushInvalidate,
> };
>
> +static __DRIimage *
> +intel_create_image_internal(__DRIcontext *context,
> + int width, int height, int internal_format,
> + int name, int pitch, void *loaderPrivate)
> +{
> + __DRIimage *image;
> + struct intel_context *intel = context->driverPrivate;
> + int cpp;
> +
> + image = CALLOC(sizeof *image);
> + image->internal_format = internal_format;
> + switch (internal_format) {
> + case GL_RGBA:
> + image->format = MESA_FORMAT_ARGB8888;
> + image->data_type = GL_UNSIGNED_BYTE;
> + break;
> + case GL_RGB:
> + image->format = MESA_FORMAT_XRGB8888;
> + image->data_type = GL_UNSIGNED_BYTE;
> + break;
> + }
No love for 565 or 4444 pixmaps?
> + image->data = loaderPrivate;
> + cpp = _mesa_get_format_bytes(image->format);
> +
> + if (name == 0) {
> + pitch = ((cpp * width + 63) & ~63) / cpp;
> + image->region = intel_region_alloc(intel, I915_TILING_NONE,
> + cpp, width, height, pitch, GL_TRUE);
> + } else {
> + image->region = intel_region_alloc_for_handle(intel, cpp, width,
> height,
> + pitch, name, "image");
> +
> + }
> + if (image->region == NULL) {
> + FREE(image);
> + return NULL;
> + }
> +
> + return image;
> +}
> +
> +static __DRIimage *
> +intel_create_image(__DRIcontext *context,
> + int width, int height, int format, void *private)
> +{
> + return intel_create_image_internal(context, width, height, format,
> + 0, 0, private);
> +}
> +
> +static __DRIimage *
> +intel_create_image_from_name(__DRIcontext *context,
> + int width, int height, int format,
> + int name, int pitch, void *private)
> +{
> + return intel_create_image_internal(context, width, height, format,
> + name, pitch, private);
> +}
> +
> +static void
> +intel_destroy_image(__DRIimage *image)
> +{
> + intel_region_release(&image->region);
> + FREE(image);
> +}
> +
> +static struct __DRIimageExtensionRec intelImageExtension = {
> + { __DRI_IMAGE, __DRI_IMAGE_VERSION },
> + intel_create_image,
> + intel_create_image_from_name,
> + intel_destroy_image,
> +};
> +
> static const __DRIextension *intelScreenExtensions[] = {
> &driReadDrawableExtension,
> &intelTexOffsetExtension.base,
> &intelTexBufferExtension.base,
> &intelFlushExtension.base,
> + &intelImageExtension.base,
> NULL
> };
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkt1+QcACgkQX1gOwKyEAw86TwCaA0ChepQbp8rofpICru3ddV+A
FHEAn0VUedBg5sFzus0/S2qyEQ5gHLBD
=/x8V
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev