tests/graw: raw -> graw
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 10 May 2010 23:36:15 +0000 (00:36 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 11 May 2010 06:03:27 +0000 (07:03 +0100)
for consistency

src/gallium/SConscript
src/gallium/tests/graw/SConscript [new file with mode: 0644]
src/gallium/tests/graw/clear.c [new file with mode: 0644]
src/gallium/tests/raw/SConscript [deleted file]
src/gallium/tests/raw/clear.c [deleted file]

index ed4d217379e1020b878b60551e8bda9a1671573a..02e6ea7a9f769f86c79676e49fd79b81fe95e99f 100644 (file)
@@ -25,4 +25,4 @@ SConscript('targets/SConscript')
 
 if platform != 'embedded':
        SConscript('tests/unit/SConscript')
-       SConscript('tests/raw/SConscript')
+       SConscript('tests/graw/SConscript')
diff --git a/src/gallium/tests/graw/SConscript b/src/gallium/tests/graw/SConscript
new file mode 100644 (file)
index 0000000..8a92ac2
--- /dev/null
@@ -0,0 +1,23 @@
+Import('*')
+
+try:
+    graw
+except NameError:
+    print 'warning: graw library not avaiable: skipping build of graw test'
+    Return()
+
+env = env.Clone()
+
+env.Prepend(LIBPATH = [graw.dir])
+env.Prepend(LIBS = ['graw'])
+
+progs = [
+    'clear'
+]
+
+for prog in progs:
+    env.Program(
+        target = prog,
+        source = prog + '.c',
+    )
+
diff --git a/src/gallium/tests/graw/clear.c b/src/gallium/tests/graw/clear.c
new file mode 100644 (file)
index 0000000..84dd780
--- /dev/null
@@ -0,0 +1,96 @@
+/* Display a cleared blue window.  This demo has no dependencies on
+ * any utility code, just the graw interface and gallium.
+ */
+
+#include "state_tracker/graw.h"
+#include "pipe/p_screen.h"
+#include "pipe/p_context.h"
+#include "pipe/p_state.h"
+#include "pipe/p_defines.h"
+
+#include "util/u_debug.h"       /* debug_dump_surface_bmp() */
+#include "os/os_time.h"       /* os_time_sleep() */
+
+enum pipe_format formats[] = {
+   PIPE_FORMAT_R8G8B8A8_UNORM,
+   PIPE_FORMAT_B8G8R8A8_UNORM,
+   PIPE_FORMAT_NONE
+};
+
+static const int WIDTH = 300;
+static const int HEIGHT = 300;
+
+int main( int argc, char *argv[] )
+{
+   struct pipe_screen *screen;
+   struct pipe_context *pipe;
+   struct pipe_surface *surf;
+   struct pipe_framebuffer_state fb;
+   struct pipe_resource *tex, templat;
+   void *window = NULL;
+   float clear_color[4] = {1,0,1,1};
+   int i;
+
+   screen = graw_init();
+   if (screen == NULL)
+      exit(1);
+
+   for (i = 0; 
+        window == NULL && formats[i] != PIPE_FORMAT_NONE;
+        i++) {
+      
+      window = graw_create_window(0,0,300,300, formats[i]);
+   }
+   
+   if (window == NULL)
+      exit(2);
+   
+   pipe = screen->context_create(screen, NULL);
+   if (pipe == NULL)
+      exit(3);
+
+   templat.target = PIPE_TEXTURE_2D;
+   templat.format = formats[i];
+   templat.width0 = WIDTH;
+   templat.height0 = HEIGHT;
+   templat.depth0 = 1;
+   templat.last_level = 0;
+   templat.nr_samples = 1;
+   templat.bind = (PIPE_BIND_RENDER_TARGET |
+                        PIPE_BIND_DISPLAY_TARGET);
+   
+   tex = screen->resource_create(screen,
+                                &templat);
+   if (tex == NULL)
+      exit(4);
+
+   surf = screen->get_tex_surface(screen, tex, 0, 0, 0,
+                                  PIPE_BIND_RENDER_TARGET |
+                                  PIPE_BIND_DISPLAY_TARGET);
+   if (surf == NULL)
+      exit(5);
+
+   memset(&fb, 0, sizeof fb);
+   fb.nr_cbufs = 1;
+   fb.width = WIDTH;
+   fb.height = HEIGHT;
+   fb.cbufs[0] = surf;
+
+   pipe->set_framebuffer_state(pipe, &fb);
+   pipe->clear(pipe, PIPE_CLEAR_COLOR, clear_color, 0, 0);
+   pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+
+   /* At the moment, libgraw includes/makes available all the symbols
+    * from gallium/auxiliary, including these debug helpers.  Will
+    * eventually want to bless some of these paths, and lock the
+    * others down so they aren't accessible from test programs.
+    */
+   if (0)
+      debug_dump_surface_bmp(pipe, "result.bmp", surf);
+
+   screen->flush_frontbuffer(screen, surf, window);
+
+   os_time_sleep(100*1000*100);
+
+   return 0;
+}
diff --git a/src/gallium/tests/raw/SConscript b/src/gallium/tests/raw/SConscript
deleted file mode 100644 (file)
index 8a92ac2..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Import('*')
-
-try:
-    graw
-except NameError:
-    print 'warning: graw library not avaiable: skipping build of graw test'
-    Return()
-
-env = env.Clone()
-
-env.Prepend(LIBPATH = [graw.dir])
-env.Prepend(LIBS = ['graw'])
-
-progs = [
-    'clear'
-]
-
-for prog in progs:
-    env.Program(
-        target = prog,
-        source = prog + '.c',
-    )
-
diff --git a/src/gallium/tests/raw/clear.c b/src/gallium/tests/raw/clear.c
deleted file mode 100644 (file)
index 84dd780..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Display a cleared blue window.  This demo has no dependencies on
- * any utility code, just the graw interface and gallium.
- */
-
-#include "state_tracker/graw.h"
-#include "pipe/p_screen.h"
-#include "pipe/p_context.h"
-#include "pipe/p_state.h"
-#include "pipe/p_defines.h"
-
-#include "util/u_debug.h"       /* debug_dump_surface_bmp() */
-#include "os/os_time.h"       /* os_time_sleep() */
-
-enum pipe_format formats[] = {
-   PIPE_FORMAT_R8G8B8A8_UNORM,
-   PIPE_FORMAT_B8G8R8A8_UNORM,
-   PIPE_FORMAT_NONE
-};
-
-static const int WIDTH = 300;
-static const int HEIGHT = 300;
-
-int main( int argc, char *argv[] )
-{
-   struct pipe_screen *screen;
-   struct pipe_context *pipe;
-   struct pipe_surface *surf;
-   struct pipe_framebuffer_state fb;
-   struct pipe_resource *tex, templat;
-   void *window = NULL;
-   float clear_color[4] = {1,0,1,1};
-   int i;
-
-   screen = graw_init();
-   if (screen == NULL)
-      exit(1);
-
-   for (i = 0; 
-        window == NULL && formats[i] != PIPE_FORMAT_NONE;
-        i++) {
-      
-      window = graw_create_window(0,0,300,300, formats[i]);
-   }
-   
-   if (window == NULL)
-      exit(2);
-   
-   pipe = screen->context_create(screen, NULL);
-   if (pipe == NULL)
-      exit(3);
-
-   templat.target = PIPE_TEXTURE_2D;
-   templat.format = formats[i];
-   templat.width0 = WIDTH;
-   templat.height0 = HEIGHT;
-   templat.depth0 = 1;
-   templat.last_level = 0;
-   templat.nr_samples = 1;
-   templat.bind = (PIPE_BIND_RENDER_TARGET |
-                        PIPE_BIND_DISPLAY_TARGET);
-   
-   tex = screen->resource_create(screen,
-                                &templat);
-   if (tex == NULL)
-      exit(4);
-
-   surf = screen->get_tex_surface(screen, tex, 0, 0, 0,
-                                  PIPE_BIND_RENDER_TARGET |
-                                  PIPE_BIND_DISPLAY_TARGET);
-   if (surf == NULL)
-      exit(5);
-
-   memset(&fb, 0, sizeof fb);
-   fb.nr_cbufs = 1;
-   fb.width = WIDTH;
-   fb.height = HEIGHT;
-   fb.cbufs[0] = surf;
-
-   pipe->set_framebuffer_state(pipe, &fb);
-   pipe->clear(pipe, PIPE_CLEAR_COLOR, clear_color, 0, 0);
-   pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
-
-   /* At the moment, libgraw includes/makes available all the symbols
-    * from gallium/auxiliary, including these debug helpers.  Will
-    * eventually want to bless some of these paths, and lock the
-    * others down so they aren't accessible from test programs.
-    */
-   if (0)
-      debug_dump_surface_bmp(pipe, "result.bmp", surf);
-
-   screen->flush_frontbuffer(screen, surf, window);
-
-   os_time_sleep(100*1000*100);
-
-   return 0;
-}