r300g: align the height of NPOT textures to POT
[mesa.git] / src / gallium / state_trackers / xorg / xvmc / surface.c
index 6b7dbf11dcf3df1a16a0a43eaf9465a74cfe1ba7..12d94e0c5ca1d6be028dc7f131afabd5791606f3 100644 (file)
@@ -1,3 +1,30 @@
+/**************************************************************************
+ *
+ * Copyright 2009 Younes Manton.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
 #include <assert.h>
 #include <X11/Xlibint.h>
 #include <pipe/p_video_context.h>
@@ -74,13 +101,12 @@ CreateOrResizeBackBuffer(struct pipe_video_context *vpipe, unsigned int width, u
    memset(&template, 0, sizeof(struct pipe_texture));
    template.target = PIPE_TEXTURE_2D;
    /* XXX: Needs to match the drawable's format? */
-   template.format = PIPE_FORMAT_X8R8G8B8_UNORM;
+   template.format = PIPE_FORMAT_B8G8R8X8_UNORM;
    template.last_level = 0;
-   template.width[0] = width;
-   template.height[0] = height;
-   template.depth[0] = 1;
-   pf_get_block(template.format, &template.block);
-   template.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET;
+   template.width0 = width;
+   template.height0 = height;
+   template.depth0 = 1;
+   template.tex_usage = PIPE_TEXTURE_USAGE_SHARED;
 
    tex = vpipe->screen->texture_create(vpipe->screen, &template);
    if (!tex)