[cairo-commit] boilerplate/cairo-boilerplate-directfb.c boilerplate/cairo-boilerplate-drm.c boilerplate/cairo-boilerplate-egl.c boilerplate/cairo-boilerplate-pdf.c boilerplate/cairo-boilerplate-ps.c boilerplate/cairo-boilerplate-quartz.c boilerplate/cairo-boilerplate-script.c boilerplate/cairo-boilerplate-skia.c boilerplate/cairo-boilerplate-svg.c boilerplate/cairo-boilerplate-test-surfaces.c boilerplate/cairo-boilerplate-vg.c boilerplate/cairo-boilerplate-wgl.c boilerplate/cairo-boilerplate-win32.c boilerplate/cairo-boilerplate-win32-printing.c
Chris Wilson
ickle at kemper.freedesktop.org
Thu Jun 2 01:15:05 PDT 2011
boilerplate/cairo-boilerplate-directfb.c | 2 ++
boilerplate/cairo-boilerplate-drm.c | 2 ++
boilerplate/cairo-boilerplate-egl.c | 1 +
boilerplate/cairo-boilerplate-pdf.c | 2 ++
boilerplate/cairo-boilerplate-ps.c | 4 ++++
boilerplate/cairo-boilerplate-quartz.c | 2 ++
boilerplate/cairo-boilerplate-script.c | 1 +
boilerplate/cairo-boilerplate-skia.c | 2 ++
boilerplate/cairo-boilerplate-svg.c | 4 ++++
boilerplate/cairo-boilerplate-test-surfaces.c | 8 ++++++++
boilerplate/cairo-boilerplate-vg.c | 4 ++++
boilerplate/cairo-boilerplate-wgl.c | 1 +
boilerplate/cairo-boilerplate-win32-printing.c | 2 ++
boilerplate/cairo-boilerplate-win32.c | 2 ++
14 files changed, 37 insertions(+)
New commits:
commit d673b9547f29bec74ccaa74e2660223cc2feb5c8
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Thu Jun 2 09:11:32 2011 +0100
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 at chris-wilson.co.uk>
diff --git a/boilerplate/cairo-boilerplate-directfb.c b/boilerplate/cairo-boilerplate-directfb.c
index 6b657f1..cc69f85 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 40c7049..8f04314 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 6ecb8a8..0e1c9b9 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 ea66c23..53bf55b 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 e4a3f71..a3f7507 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 67bd5bb..6b9697a 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 f84594d..f031744 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 eb3d440..2bd31b0 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 7e7f1e7..b5a7d0d 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 993e211..909475b 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 d5a1372..a49ed5d 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 2215659..8ae1dcb 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 0d70620..ee76bf6 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 5194bef..f7be663 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,
More information about the cairo-commit
mailing list