[gegl] tests: add test verifying writing to mipmap levels!=0



commit c95e6a6bd54a8739c7c8ccc742eea698f5e0db9b
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Jul 1 08:42:51 2014 +0200

    tests: add test verifying writing to mipmap levels!=0

 tests/buffer/reference/test_mipmap.buf  |   45 +++++++++++++++++++++
 tests/buffer/reference/test_mipmap2.buf |   67 +++++++++++++++++++++++++++++++
 tests/buffer/tests/test_mipmap.c        |   11 -----
 tests/buffer/tests/test_mipmap2.c       |   40 ++++++++++++++++++
 4 files changed, 152 insertions(+), 11 deletions(-)
---
diff --git a/tests/buffer/reference/test_mipmap.buf b/tests/buffer/reference/test_mipmap.buf
new file mode 100644
index 0000000..1441f09
--- /dev/null
+++ b/tests/buffer/reference/test_mipmap.buf
@@ -0,0 +1,45 @@
+Test: test_mipmap
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒     ▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒     ▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒     ▒▒▒▒▒▐
+▌▓▓▓▓▓▓▓▓▓▓     ▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓     ▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌████████████████████▐
+▌████████████████████▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌████████████████████▐
+▌████████████████████▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
diff --git a/tests/buffer/reference/test_mipmap2.buf b/tests/buffer/reference/test_mipmap2.buf
new file mode 100644
index 0000000..4d0344d
--- /dev/null
+++ b/tests/buffer/reference/test_mipmap2.buf
@@ -0,0 +1,67 @@
+Test: test_mipmap2
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌░░░░░░░░░░░░░░░░░░░░▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▐
+▌████████████████████▐
+▌████████████████████▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌                    ▐
+▌░░░░░░░░░░          ▐
+▌░░▒░███░░░          ▐
+▌░░░    ░░░          ▐
+▌▒▒     ▒▒▒          ▐
+▌▒▒     ▒▒▒          ▐
+▌▓▓     ▓▓▓          ▐
+▌▓▓▓▓▓▓▓▓▓▓          ▐
+▌▓▓▓▓▓▓▓▓▓▓          ▐
+▌██████████          ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
+▛▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▜
+▌                    ▐
+▌░░▒▒░               ▐
+▌▒  ░▒               ▐
+▌▓░░▒▓               ▐
+▌█████               ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▌                    ▐
+▙▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▟
diff --git a/tests/buffer/tests/test_mipmap.c b/tests/buffer/tests/test_mipmap.c
index 48750f0..9de06a8 100644
--- a/tests/buffer/tests/test_mipmap.c
+++ b/tests/buffer/tests/test_mipmap.c
@@ -24,15 +24,4 @@ TEST ()
   g_object_unref (buffer);
   g_object_unref (buffer2);
   test_end ();
-
-
-  /* test writing to only higher mipmap levels,.   what happens to reads there
-   * and above?
-   *
-   *   below - perhaps synthesising these - bypassing cache would not be
-   *   half-bad? if the result is not for a 1:1 render?
-   *
-   */
-
-
 }
diff --git a/tests/buffer/tests/test_mipmap2.c b/tests/buffer/tests/test_mipmap2.c
new file mode 100644
index 0000000..497522b
--- /dev/null
+++ b/tests/buffer/tests/test_mipmap2.c
@@ -0,0 +1,40 @@
+TEST ()
+{
+  GeglBuffer    *buffer2, *buffer;
+  GeglRectangle  bound = {0, 0, 20, 20};
+  //GeglRectangle  source = {2, 2, 5, 5};
+  GeglRectangle  dest = {4, 4, 5, 5};
+  float *blank = g_malloc0 (100000);
+  gchar *temp = g_malloc0 (100000);
+  test_start ();
+
+  buffer2 = gegl_buffer_new (&bound, babl_format ("Y float"));
+  buffer = gegl_buffer_new (&bound, babl_format ("Y float"));
+
+  vgrad (buffer2);
+  blank[0] = 0.5;
+  blank[1] = 0.25;
+  blank[2] = 1.0;
+  blank[3] = 1.0;
+  blank[4] = 1.0;
+  blank[5] = 0.2;
+
+  /* we need to expand the width/height to compensate for the level */
+  dest.width  *= 2;
+  dest.height *= 2;
+  gegl_buffer_set (buffer2, &dest, 1, babl_format ("Y float"), blank, GEGL_AUTO_ROWSTRIDE);
+  print_buffer (buffer2);
+
+  gegl_buffer_get (buffer2, &bound, 0.5, babl_format ("Y float"), temp, GEGL_AUTO_ROWSTRIDE, 
GEGL_ABYSS_NONE);
+  gegl_buffer_set (buffer, &bound, 0, babl_format ("Y float"), temp, GEGL_AUTO_ROWSTRIDE);
+
+  print_buffer (buffer);
+
+  gegl_buffer_get (buffer2, &bound, 0.25, babl_format ("Y float"), temp, GEGL_AUTO_ROWSTRIDE, 
GEGL_ABYSS_NONE);
+  gegl_buffer_set (buffer, &bound, 0, babl_format ("Y float"), temp, GEGL_AUTO_ROWSTRIDE);
+
+  print_buffer (buffer);
+
+  test_end ();
+
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]