This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository efl.
View the commit online.
commit 8a0c92fffbd5d6f565730429f7289696997e6a9c
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 28 22:23:02 2026 -0600
evas/benchmarks: add software map drawing
Nothing in evas_bench drew a mapped image, and expedite has no
anti-aliased map test, which takes a rasterizer of its own.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/benchmarks/evas/evas_bench.c | 1 +
src/benchmarks/evas/evas_bench.h | 1 +
src/benchmarks/evas/evas_bench_map.c | 126 +++++++++++++++++++++++++++++++++++
src/benchmarks/evas/meson.build | 1 +
4 files changed, 129 insertions(+)
diff --git a/src/benchmarks/evas/evas_bench.c b/src/benchmarks/evas/evas_bench.c
index b29b709add..69c1a65f9f 100644
--- a/src/benchmarks/evas/evas_bench.c
+++ b/src/benchmarks/evas/evas_bench.c
@@ -22,6 +22,7 @@ static const Evas_Benchmark_Case etc[] = {
{ "Loader", evas_bench_loader, EINA_TRUE },
{ "Saver", evas_bench_saver, EINA_TRUE },
{ "Textgrid", evas_bench_textgrid, EINA_TRUE },
+ { "Map", evas_bench_map, EINA_TRUE },
{ NULL, NULL, EINA_FALSE }
};
diff --git a/src/benchmarks/evas/evas_bench.h b/src/benchmarks/evas/evas_bench.h
index 9c3e34f4ea..714d02243d 100644
--- a/src/benchmarks/evas/evas_bench.h
+++ b/src/benchmarks/evas/evas_bench.h
@@ -6,6 +6,7 @@
void evas_bench_loader(Eina_Benchmark *bench);
void evas_bench_saver(Eina_Benchmark *bench);
void evas_bench_textgrid(Eina_Benchmark *bench);
+void evas_bench_map(Eina_Benchmark *bench);
#endif
diff --git a/src/benchmarks/evas/evas_bench_map.c b/src/benchmarks/evas/evas_bench_map.c
new file mode 100644
index 0000000000..f77c82494a
--- /dev/null
+++ b/src/benchmarks/evas/evas_bench_map.c
@@ -0,0 +1,126 @@
+/*
+ * Software map rendering benchmark.
+ *
+ * Redraws one large mapped image per frame: sampled or smooth, smooth on an
+ * anti-aliased object (which has its own rasterizer), flat (turned in the
+ * screen plane) or at an angle.
+ */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "Evas.h"
+#include "Evas_Engine_Buffer.h"
+#include "evas_bench.h"
+
+#define CANVAS_W 800
+#define CANVAS_H 600
+
+#define SRC_W 720
+#define SRC_H 420
+
+static Evas *
+_setup_evas(void *pixels)
+{
+ Evas *evas;
+ Evas_Engine_Info_Buffer *einfo;
+
+ evas = evas_new();
+
+ evas_output_method_set(evas, evas_render_method_lookup("buffer"));
+ einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(evas);
+
+ einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
+ einfo->info.dest_buffer = pixels;
+ einfo->info.dest_buffer_row_bytes = CANVAS_W * sizeof(int);
+
+ evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);
+
+ evas_output_size_set(evas, CANVAS_W, CANVAS_H);
+ evas_output_viewport_set(evas, 0, 0, CANVAS_W, CANVAS_H);
+
+ return evas;
+}
+
+static void
+_frames(int frames, Eina_Bool smooth, Eina_Bool anti_alias, Eina_Bool angled)
+{
+ const int x[4] = { 50, 750, 750, 50 }, y[4] = { 30, 30, 570, 570 };
+ const int u[4] = { 0, SRC_W, SRC_W, 0 }, v[4] = { 0, 0, SRC_H, SRC_H };
+ Evas *e;
+ Evas_Object *img;
+ Evas_Map *map;
+ unsigned int *pixels, *source;
+ int i;
+
+ pixels = malloc(CANVAS_W * CANVAS_H * sizeof(*pixels));
+ if (!pixels) return;
+ e = _setup_evas(pixels);
+
+ img = evas_object_image_filled_add(e);
+ evas_object_image_size_set(img, SRC_W, SRC_H);
+ source = evas_object_image_data_get(img, EINA_TRUE);
+ for (i = 0; i < (SRC_W * SRC_H); i++)
+ source[i] = 0xff000000 | ((i * 2654435761u) >> 8);
+ evas_object_image_data_set(img, source);
+ evas_object_image_data_update_add(img, 0, 0, SRC_W, SRC_H);
+ evas_object_resize(img, SRC_W, SRC_H);
+ evas_object_anti_alias_set(img, anti_alias);
+ evas_object_show(img);
+
+ map = evas_map_new(4);
+ for (i = 0; i < 4; i++)
+ {
+ int z = (angled && ((i == 1) || (i == 2))) ? 300 : 0;
+
+ evas_map_point_coord_set(map, i, x[i], y[i], z);
+ evas_map_point_image_uv_set(map, i, u[i], v[i]);
+ }
+ if (angled)
+ evas_map_util_3d_perspective(map, CANVAS_W / 2, CANVAS_H / 2, 0, 500);
+ else
+ /* an upright rectangle would be drawn by the image scaler instead */
+ evas_map_util_rotate(map, 10, CANVAS_W / 2, CANVAS_H / 2);
+ evas_map_smooth_set(map, smooth);
+ evas_object_map_set(img, map);
+ evas_object_map_enable_set(img, EINA_TRUE);
+
+ for (i = 0; i < frames; i++)
+ {
+ evas_damage_rectangle_add(e, 0, 0, CANVAS_W, CANVAS_H);
+ evas_render_updates_free(evas_render_updates(e));
+ }
+
+ evas_map_free(map);
+ evas_free(e);
+ free(pixels);
+}
+
+#define MAP_BENCH(name, smooth, anti_alias, angled) \
+static void \
+name(int request) \
+{ \
+ _frames(request, smooth, anti_alias, angled); \
+}
+
+MAP_BENCH(_sampled, EINA_FALSE, EINA_FALSE, EINA_FALSE)
+MAP_BENCH(_smooth, EINA_TRUE, EINA_FALSE, EINA_FALSE)
+MAP_BENCH(_anti_alias, EINA_TRUE, EINA_TRUE, EINA_FALSE)
+MAP_BENCH(_sampled_angled, EINA_FALSE, EINA_FALSE, EINA_TRUE)
+MAP_BENCH(_smooth_angled, EINA_TRUE, EINA_FALSE, EINA_TRUE)
+MAP_BENCH(_anti_alias_angled, EINA_TRUE, EINA_TRUE, EINA_TRUE)
+
+void
+evas_bench_map(Eina_Benchmark *bench)
+{
+ eina_benchmark_register(bench, "sampled", EINA_BENCHMARK(_sampled), 100, 500, 100);
+ eina_benchmark_register(bench, "smooth", EINA_BENCHMARK(_smooth), 100, 500, 100);
+ eina_benchmark_register(bench, "anti-alias", EINA_BENCHMARK(_anti_alias), 100, 500, 100);
+ eina_benchmark_register(bench, "sampled-angled", EINA_BENCHMARK(_sampled_angled), 100, 500, 100);
+ eina_benchmark_register(bench, "smooth-angled", EINA_BENCHMARK(_smooth_angled), 100, 500, 100);
+ eina_benchmark_register(bench, "anti-alias-angled", EINA_BENCHMARK(_anti_alias_angled),
+ 100, 500, 100);
+}
diff --git a/src/benchmarks/evas/meson.build b/src/benchmarks/evas/meson.build
index 4641be098d..cff43f754c 100644
--- a/src/benchmarks/evas/meson.build
+++ b/src/benchmarks/evas/meson.build
@@ -4,6 +4,7 @@ evas_bench_src = files(
'evas_bench_loader.c',
'evas_bench_saver.c',
'evas_bench_textgrid.c',
+ 'evas_bench_map.c',
)
evas_bench = executable('evas_bench',
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.