mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-27 17:56:15 +00:00
tests/gem_render_copy: Only dump pngs when the -d option is given
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
parent
9cd092fac1
commit
145722187c
@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "rendercopy.h"
|
#include "rendercopy.h"
|
||||||
|
|
||||||
@ -88,8 +89,19 @@ int main(int argc, char **argv)
|
|||||||
struct intel_batchbuffer *batch = NULL;
|
struct intel_batchbuffer *batch = NULL;
|
||||||
struct scratch_buf src, dst;
|
struct scratch_buf src, dst;
|
||||||
render_copyfunc_t render_copy = NULL;
|
render_copyfunc_t render_copy = NULL;
|
||||||
|
int opt;
|
||||||
int opt_dump_png = false;
|
int opt_dump_png = false;
|
||||||
|
|
||||||
|
while ((opt = getopt(argc, argv, "d")) != -1) {
|
||||||
|
switch (opt) {
|
||||||
|
case 'd':
|
||||||
|
opt_dump_png = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
igt_fixture {
|
igt_fixture {
|
||||||
data.drm_fd = drm_open_any();
|
data.drm_fd = drm_open_any();
|
||||||
data.devid = intel_get_drm_devid(data.drm_fd);
|
data.devid = intel_get_drm_devid(data.drm_fd);
|
||||||
@ -111,8 +123,10 @@ int main(int argc, char **argv)
|
|||||||
scratch_buf_check(&data, &src, WIDTH / 2, HEIGHT / 2, SRC_COLOR);
|
scratch_buf_check(&data, &src, WIDTH / 2, HEIGHT / 2, SRC_COLOR);
|
||||||
scratch_buf_check(&data, &dst, WIDTH / 2, HEIGHT / 2, DST_COLOR);
|
scratch_buf_check(&data, &dst, WIDTH / 2, HEIGHT / 2, DST_COLOR);
|
||||||
|
|
||||||
scratch_buf_write_to_png(&src, "source.png");
|
if (opt_dump_png) {
|
||||||
scratch_buf_write_to_png(&dst, "destination.png");
|
scratch_buf_write_to_png(&src, "source.png");
|
||||||
|
scratch_buf_write_to_png(&dst, "destination.png");
|
||||||
|
}
|
||||||
|
|
||||||
render_copy(batch,
|
render_copy(batch,
|
||||||
&src, 0, 0, WIDTH, HEIGHT,
|
&src, 0, 0, WIDTH, HEIGHT,
|
||||||
@ -121,7 +135,8 @@ int main(int argc, char **argv)
|
|||||||
scratch_buf_check(&data, &dst, 10, 10, DST_COLOR);
|
scratch_buf_check(&data, &dst, 10, 10, DST_COLOR);
|
||||||
scratch_buf_check(&data, &dst, WIDTH - 10, HEIGHT - 10, SRC_COLOR);
|
scratch_buf_check(&data, &dst, WIDTH - 10, HEIGHT - 10, SRC_COLOR);
|
||||||
|
|
||||||
scratch_buf_write_to_png(&dst, "result.png");
|
if (opt_dump_png)
|
||||||
|
scratch_buf_write_to_png(&dst, "result.png");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user