summaryrefslogtreecommitdiff
path: root/boilerplate
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-02 09:11:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-02 09:11:32 +0100
commitd673b9547f29bec74ccaa74e2660223cc2feb5c8 (patch)
treece720589d39753a30a782f38eae61c65faf8e02c /boilerplate
parent72b6299c1239c53baa38f44bc898c0c184ce3c71 (diff)
boilerplate: Introduce create_similar hook
A deficiency of cairo-perf-trace is that it currently always uses similar surfaces for new surface which are kindly cleared by Cairo. This does not accurately reflect the captured trace and introduces large bandwidth overheads that distort the profiles. So we introduce a new boilerplate hook so that the targets can create a surface without incurring additional overheads. [Fixes the broken partial commit of bf1b08d066e.] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'boilerplate')
-rw-r--r--boilerplate/cairo-boilerplate-directfb.c2
-rw-r--r--boilerplate/cairo-boilerplate-drm.c2
-rw-r--r--boilerplate/cairo-boilerplate-egl.c1
-rw-r--r--boilerplate/cairo-boilerplate-pdf.c2
-rw-r--r--boilerplate/cairo-boilerplate-ps.c4
-rw-r--r--boilerplate/cairo-boilerplate-quartz.c2
-rw-r--r--boilerplate/cairo-boilerplate-script.c1
-rw-r--r--boilerplate/cairo-boilerplate-skia.c2
-rw-r--r--boilerplate/cairo-boilerplate-svg.c4
-rw-r--r--boilerplate/cairo-boilerplate-test-surfaces.c8
-rw-r--r--boilerplate/cairo-boilerplate-vg.c4
-rw-r--r--boilerplate/cairo-boilerplate-wgl.c1
-rw-r--r--boilerplate/cairo-boilerplate-win32-printing.c2
-rw-r--r--boilerplate/cairo-boilerplate-win32.c2
14 files changed, 37 insertions, 0 deletions
diff --git a/boilerplate/cairo-boilerplate-directfb.c b/boilerplate/cairo-boilerplate-directfb.c
index 6b657f1d..cc69f85c 100644
--- a/boilerplate/cairo-boilerplate-directfb.c
+++ b/boilerplate/cairo-boilerplate-directfb.c
@@ -213,6 +213,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_CONTENT_COLOR, 0,
"cairo_directfb_surface_create",
_cairo_boilerplate_directfb_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -224,6 +225,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_directfb_surface_create",
_cairo_boilerplate_directfb_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
diff --git a/boilerplate/cairo-boilerplate-drm.c b/boilerplate/cairo-boilerplate-drm.c
index 40c7049d..8f043149 100644
--- a/boilerplate/cairo-boilerplate-drm.c
+++ b/boilerplate/cairo-boilerplate-drm.c
@@ -80,6 +80,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_DRM, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_drm_surface_create",
_cairo_boilerplate_drm_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -93,6 +94,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_DRM, CAIRO_CONTENT_COLOR, 1,
"cairo_drm_surface_create",
_cairo_boilerplate_drm_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
diff --git a/boilerplate/cairo-boilerplate-egl.c b/boilerplate/cairo-boilerplate-egl.c
index 6ecb8a8b..0e1c9b96 100644
--- a/boilerplate/cairo-boilerplate-egl.c
+++ b/boilerplate/cairo-boilerplate-egl.c
@@ -161,6 +161,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_egl_device_create",
_cairo_boilerplate_egl_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c
index ea66c23e..53bf55ba 100644
--- a/boilerplate/cairo-boilerplate-pdf.c
+++ b/boilerplate/cairo-boilerplate-pdf.c
@@ -248,6 +248,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
"cairo_pdf_surface_create",
_cairo_boilerplate_pdf_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_pdf_force_fallbacks,
_cairo_boilerplate_pdf_finish_surface,
_cairo_boilerplate_pdf_get_image_surface,
@@ -260,6 +261,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
"cairo_pdf_surface_create",
_cairo_boilerplate_pdf_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_pdf_force_fallbacks,
_cairo_boilerplate_pdf_finish_surface,
_cairo_boilerplate_pdf_get_image_surface,
diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c
index e4a3f714..a3f75077 100644
--- a/boilerplate/cairo-boilerplate-ps.c
+++ b/boilerplate/cairo-boilerplate-ps.c
@@ -309,6 +309,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
"cairo_ps_surface_create",
_cairo_boilerplate_ps2_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_ps_force_fallbacks,
_cairo_boilerplate_ps_finish_surface,
_cairo_boilerplate_ps_get_image_surface,
@@ -321,6 +322,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
"cairo_ps_surface_create",
_cairo_boilerplate_ps2_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_ps_force_fallbacks,
_cairo_boilerplate_ps_finish_surface,
_cairo_boilerplate_ps_get_image_surface,
@@ -334,6 +336,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
"cairo_ps_surface_create",
_cairo_boilerplate_ps3_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_ps_force_fallbacks,
_cairo_boilerplate_ps_finish_surface,
_cairo_boilerplate_ps_get_image_surface,
@@ -346,6 +349,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
"cairo_ps_surface_create",
_cairo_boilerplate_ps3_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_ps_force_fallbacks,
_cairo_boilerplate_ps_finish_surface,
_cairo_boilerplate_ps_get_image_surface,
diff --git a/boilerplate/cairo-boilerplate-quartz.c b/boilerplate/cairo-boilerplate-quartz.c
index 67bd5bbb..6b9697a5 100644
--- a/boilerplate/cairo-boilerplate-quartz.c
+++ b/boilerplate/cairo-boilerplate-quartz.c
@@ -54,6 +54,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_quartz_surface_create",
_cairo_boilerplate_quartz_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -65,6 +66,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_CONTENT_COLOR, 0,
"cairo_quartz_surface_create",
_cairo_boilerplate_quartz_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
diff --git a/boilerplate/cairo-boilerplate-script.c b/boilerplate/cairo-boilerplate-script.c
index f84594d3..f0317440 100644
--- a/boilerplate/cairo-boilerplate-script.c
+++ b/boilerplate/cairo-boilerplate-script.c
@@ -131,6 +131,7 @@ static const cairo_boilerplate_target_t target[] = {{
CAIRO_SURFACE_TYPE_SCRIPT, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_script_surface_create",
_cairo_boilerplate_script_create_surface,
+ cairo_surface_create_similar,
NULL,
_cairo_boilerplate_script_finish_surface,
_cairo_boilerplate_script_get_image_surface,
diff --git a/boilerplate/cairo-boilerplate-skia.c b/boilerplate/cairo-boilerplate-skia.c
index eb3d4406..2bd31b00 100644
--- a/boilerplate/cairo-boilerplate-skia.c
+++ b/boilerplate/cairo-boilerplate-skia.c
@@ -35,6 +35,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_SKIA, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_skia_surface_create",
_cairo_boilerplate_skia_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -45,6 +46,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_SKIA, CAIRO_CONTENT_COLOR, 0,
"cairo_skia_surface_create",
_cairo_boilerplate_skia_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
diff --git a/boilerplate/cairo-boilerplate-svg.c b/boilerplate/cairo-boilerplate-svg.c
index 7e7f1e78..b5a7d0d7 100644
--- a/boilerplate/cairo-boilerplate-svg.c
+++ b/boilerplate/cairo-boilerplate-svg.c
@@ -285,6 +285,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg11_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_svg_force_fallbacks,
_cairo_boilerplate_svg_finish_surface,
_cairo_boilerplate_svg_get_image_surface,
@@ -297,6 +298,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg11_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_svg_force_fallbacks,
_cairo_boilerplate_svg_finish_surface,
_cairo_boilerplate_svg_get_image_surface,
@@ -309,6 +311,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg12_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_svg_force_fallbacks,
_cairo_boilerplate_svg_finish_surface,
_cairo_boilerplate_svg_get_image_surface,
@@ -321,6 +324,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg12_create_surface,
+ cairo_surface_create_similar,
_cairo_boilerplate_svg_force_fallbacks,
_cairo_boilerplate_svg_finish_surface,
_cairo_boilerplate_svg_get_image_surface,
diff --git a/boilerplate/cairo-boilerplate-test-surfaces.c b/boilerplate/cairo-boilerplate-test-surfaces.c
index 993e211d..909475b3 100644
--- a/boilerplate/cairo-boilerplate-test-surfaces.c
+++ b/boilerplate/cairo-boilerplate-test-surfaces.c
@@ -235,6 +235,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_fallback_surface_create",
_cairo_boilerplate_test_fallback_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -246,6 +247,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_CONTENT_COLOR, 0,
"_cairo_test_fallback_surface_create",
_cairo_boilerplate_test_fallback_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -257,6 +259,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_fallback16_surface_create",
_cairo_boilerplate_test_fallback16_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
NULL, /* _cairo_boilerplate_get_image_surface, */
cairo_surface_write_to_png,
@@ -268,6 +271,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_CONTENT_COLOR, 0,
"_cairo_test_fallback16_surface_create",
_cairo_boilerplate_test_fallback16_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
NULL, /* _cairo_boilerplate_get_image_surface, */
cairo_surface_write_to_png,
@@ -280,6 +284,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_paginated_surface_create",
_cairo_boilerplate_test_paginated_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_test_paginated_get_image_surface,
_cairo_boilerplate_test_paginated_surface_write_to_png,
@@ -292,6 +297,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_CONTENT_COLOR, 0,
"_cairo_test_paginated_surface_create",
_cairo_boilerplate_test_paginated_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_test_paginated_get_image_surface,
_cairo_boilerplate_test_paginated_surface_write_to_png,
@@ -306,6 +312,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_wrapping_surface_create",
_cairo_boilerplate_test_wrapping_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -319,6 +326,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_null_surface_create",
_cairo_boilerplate_test_null_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
NULL, NULL, NULL,
NULL, NULL,
diff --git a/boilerplate/cairo-boilerplate-vg.c b/boilerplate/cairo-boilerplate-vg.c
index d5a13729..a49ed5df 100644
--- a/boilerplate/cairo-boilerplate-vg.c
+++ b/boilerplate/cairo-boilerplate-vg.c
@@ -307,6 +307,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_vg_context_create_for_glx",
_cairo_boilerplate_vg_create_surface_glx,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -320,6 +321,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR, 1,
"cairo_vg_context_create_for_glx",
_cairo_boilerplate_vg_create_surface_glx,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -335,6 +337,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_vg_context_create_for_egl",
_cairo_boilerplate_vg_create_surface_egl,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -348,6 +351,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR, 1,
"cairo_vg_context_create_for_egl",
_cairo_boilerplate_vg_create_surface_egl,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
diff --git a/boilerplate/cairo-boilerplate-wgl.c b/boilerplate/cairo-boilerplate-wgl.c
index 2215659f..8ae1dcba 100644
--- a/boilerplate/cairo-boilerplate-wgl.c
+++ b/boilerplate/cairo-boilerplate-wgl.c
@@ -213,6 +213,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_gl_surface_create",
_cairo_boilerplate_wgl_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
diff --git a/boilerplate/cairo-boilerplate-win32-printing.c b/boilerplate/cairo-boilerplate-win32-printing.c
index 0d706204..ee76bf64 100644
--- a/boilerplate/cairo-boilerplate-win32-printing.c
+++ b/boilerplate/cairo-boilerplate-win32-printing.c
@@ -350,6 +350,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
"cairo_win32_printing_surface_create",
_cairo_boilerplate_win32_printing_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_win32_printing_get_image_surface,
_cairo_boilerplate_win32_printing_surface_write_to_png,
@@ -361,6 +362,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_RECORDING, CAIRO_CONTENT_COLOR, 0,
"cairo_win32_printing_surface_create",
_cairo_boilerplate_win32_printing_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_win32_printing_get_image_surface,
_cairo_boilerplate_win32_printing_surface_write_to_png,
diff --git a/boilerplate/cairo-boilerplate-win32.c b/boilerplate/cairo-boilerplate-win32.c
index 5194befc..f7be6634 100644
--- a/boilerplate/cairo-boilerplate-win32.c
+++ b/boilerplate/cairo-boilerplate-win32.c
@@ -54,6 +54,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 0,
"cairo_win32_surface_create_with_dib",
_cairo_boilerplate_win32_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,
@@ -67,6 +68,7 @@ static const cairo_boilerplate_target_t targets[] = {
CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_win32_surface_create_with_dib",
_cairo_boilerplate_win32_create_surface,
+ cairo_surface_create_similar,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png,