[cairo-commit] 2 commits - doc/public src/cairo-surface.c src/cairo-tee-surface.c src/cairo-tee-surface-private.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 8 09:48:31 UTC 2023


 doc/public/meson.build          |    1 
 src/cairo-surface.c             |    1 
 src/cairo-tee-surface-private.h |   47 ----------------------------------------
 src/cairo-tee-surface.c         |   41 ----------------------------------
 4 files changed, 90 deletions(-)

New commits:
commit a23af71c9d0d9cae1a3f7f117415195b3f76e4a5
Merge: fe7f1d8cb 6f205ed28
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Feb 8 09:48:29 2023 +0000

    Merge branch 'remove-unused-tee-function' into 'master'
    
    Remove unused _cairo_tee_surface_find_match
    
    See merge request cairo/cairo!447

commit 6f205ed28f29d429c28f3c544f85a90eea47ad34
Author: Uli Schlachter <psychon at znc.in>
Date:   Sun Feb 5 16:15:25 2023 +0100

    Remove unused _cairo_tee_surface_find_match
    
    A little history digging shows that we only ever had one caller of
    _cairo_tee_surface_find_match. Commit 658cdc7c9a "Introduce
    cairo_tee_surface_t" added this code to _cairo_surface_clone_similar():
    
        if (src->type == CAIRO_SURFACE_TYPE_TEE) {
           cairo_surface_t *match;
    
           match = _cairo_tee_surface_find_match (src,
                                                  surface->backend,
                                                  content);
           if (match != NULL)
               src = match;
        }
    
    Then, two years later in 2011, commit af9fbd176b1 "Introduce a new compositor
    architecture" removed _cairo_surface_clone_similar() and thus this code became
    unused.
    
    This commit drops this unused code.
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/doc/public/meson.build b/doc/public/meson.build
index 7f25ea1a9..278ef4703 100644
--- a/doc/public/meson.build
+++ b/doc/public/meson.build
@@ -98,7 +98,6 @@ ignore_headers = [
   'cairo-svg-surface-private.h',
   'cairo-tag-attributes-private.h',
   'cairo-tag-stack-private.h',
-  'cairo-tee-surface-private.h',
   'cairo-time-private.h',
   'cairo-traps-private.h',
   'cairo-tristrip-private.h',
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 609eb9ccf..f1292e0bb 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -49,7 +49,6 @@
 #include "cairo-recording-surface-private.h"
 #include "cairo-region-private.h"
 #include "cairo-surface-inline.h"
-#include "cairo-tee-surface-private.h"
 
 /**
  * SECTION:cairo-surface
diff --git a/src/cairo-tee-surface-private.h b/src/cairo-tee-surface-private.h
deleted file mode 100644
index a83cfc959..000000000
--- a/src/cairo-tee-surface-private.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* cairo - a vector graphics library with display and print output
- *
- * Copyright © 2009 Chris Wilson
- *
- * This library is free software; you can redistribute it and/or
- * modify it either under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation
- * (the "LGPL") or, at your option, under the terms of the Mozilla
- * Public License Version 1.1 (the "MPL"). If you do not alter this
- * notice, a recipient may use your version of this file under either
- * the MPL or the LGPL.
- *
- * You should have received a copy of the LGPL along with this library
- * in the file COPYING-LGPL-2.1; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
- * You should have received a copy of the MPL along with this library
- * in the file COPYING-MPL-1.1
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.1 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
- * OF ANY KIND, either express or implied. See the LGPL or the MPL for
- * the specific language governing rights and limitations.
- *
- * The Original Code is the cairo graphics library.
- *
- * The Initial Developer of the Original Code is University of Southern
- * California.
- *
- * Contributor(s):
- *	Chris Wilson <chris at chris-wilson.co.uk>
- */
-
-#ifndef CAIRO_TEE_SURFACE_PRIVATE_H
-#define CAIRO_TEE_SURFACE_PRIVATE_H
-
-#include "cairoint.h"
-
-cairo_private cairo_surface_t *
-_cairo_tee_surface_find_match (void *abstract_surface,
-			       const cairo_surface_backend_t *backend,
-			       cairo_content_t content);
-
-#endif /* CAIRO_TEE_SURFACE_PRIVATE_H */
diff --git a/src/cairo-tee-surface.c b/src/cairo-tee-surface.c
index 4994a5a60..1d075a29c 100644
--- a/src/cairo-tee-surface.c
+++ b/src/cairo-tee-surface.c
@@ -44,7 +44,6 @@
 
 #include "cairo-default-context-private.h"
 #include "cairo-error-private.h"
-#include "cairo-tee-surface-private.h"
 #include "cairo-recording-surface-inline.h"
 #include "cairo-surface-wrapper-private.h"
 #include "cairo-array-private.h"
@@ -565,43 +564,3 @@ cairo_tee_surface_index (cairo_surface_t *abstract_surface,
 	return slave->target;
     }
 }
-
-cairo_surface_t *
-_cairo_tee_surface_find_match (void *abstract_surface,
-			       const cairo_surface_backend_t *backend,
-			       cairo_content_t content)
-{
-    cairo_tee_surface_t *surface = abstract_surface;
-    cairo_surface_wrapper_t *slaves;
-    int num_slaves, n;
-
-    /* exact match first */
-    if (surface->master.target->backend == backend &&
-	surface->master.target->content == content)
-    {
-	return surface->master.target;
-    }
-
-    num_slaves = _cairo_array_num_elements (&surface->slaves);
-    slaves = _cairo_array_index (&surface->slaves, 0);
-    for (n = 0; n < num_slaves; n++) {
-	if (slaves[n].target->backend == backend &&
-	    slaves[n].target->content == content)
-	{
-	    return slaves[n].target;
-	}
-    }
-
-    /* matching backend? */
-    if (surface->master.target->backend == backend)
-	return surface->master.target;
-
-    num_slaves = _cairo_array_num_elements (&surface->slaves);
-    slaves = _cairo_array_index (&surface->slaves, 0);
-    for (n = 0; n < num_slaves; n++) {
-	if (slaves[n].target->backend == backend)
-	    return slaves[n].target;
-    }
-
-    return NULL;
-}


More information about the cairo-commit mailing list