diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-19 11:59:54 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-19 13:17:29 +0100 |
commit | df62accbda19276c68753e799a32443b47d4e939 (patch) | |
tree | 8e8680b65f2fafeda14796868f168be5b68b5f3b | |
parent | 590202dbfba709cfdd8ad3c241e7af06b3c542e9 (diff) |
Split cairo-surface-subsurface-private into struct+inlines
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/Makefile.sources | 1 | ||||
-rw-r--r-- | src/cairo-analysis-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-cogl-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-gl-operand.c | 2 | ||||
-rw-r--r-- | src/cairo-paginated-surface.c | 2 | ||||
-rw-r--r-- | src/cairo-surface-observer.c | 2 | ||||
-rw-r--r-- | src/cairo-surface-subsurface-inline.h | 72 | ||||
-rw-r--r-- | src/cairo-surface-subsurface-private.h | 32 | ||||
-rw-r--r-- | src/cairo-xlib-source.c | 2 |
9 files changed, 80 insertions, 37 deletions
diff --git a/src/Makefile.sources b/src/Makefile.sources index 84c4c29b..9ea87f86 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -116,6 +116,7 @@ cairo_private = \ cairo-surface-observer-inline.h \ cairo-surface-observer-private.h \ cairo-surface-offset-private.h \ + cairo-surface-subsurface-inline.h \ cairo-surface-subsurface-private.h \ cairo-surface-snapshot-inline.h \ cairo-surface-snapshot-private.h \ diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c index de2e7d30..5583f251 100644 --- a/src/cairo-analysis-surface.c +++ b/src/cairo-analysis-surface.c @@ -43,7 +43,7 @@ #include "cairo-paginated-private.h" #include "cairo-recording-surface-inline.h" #include "cairo-surface-snapshot-inline.h" -#include "cairo-surface-subsurface-private.h" +#include "cairo-surface-subsurface-inline.h" #include "cairo-region-private.h" typedef struct { diff --git a/src/cairo-cogl-surface.c b/src/cairo-cogl-surface.c index 81e768bf..ed86acca 100644 --- a/src/cairo-cogl-surface.c +++ b/src/cairo-cogl-surface.c @@ -46,7 +46,7 @@ #include "cairo-cogl-context-private.h" #include "cairo-cogl-utils-private.h" #include "cairo-box-inline.h" -#include "cairo-surface-subsurface-private.h" +#include "cairo-surface-subsurface-inline.h" #include "cairo-surface-fallback-private.h" #include "cairo-surface-offset-private.h" diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c index ddff5e7b..a6c7185b 100644 --- a/src/cairo-gl-operand.c +++ b/src/cairo-gl-operand.c @@ -50,7 +50,7 @@ #include "cairo-image-surface-private.h" #include "cairo-surface-backend-private.h" #include "cairo-surface-offset-private.h" -#include "cairo-surface-subsurface-private.h" +#include "cairo-surface-subsurface-inline.h" static cairo_int_status_t _cairo_gl_create_gradient_texture (cairo_gl_surface_t *dst, diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c index 957cf7bd..fe9ccee6 100644 --- a/src/cairo-paginated-surface.c +++ b/src/cairo-paginated-surface.c @@ -50,7 +50,7 @@ #include "cairo-analysis-surface-private.h" #include "cairo-error-private.h" #include "cairo-image-surface-private.h" -#include "cairo-surface-subsurface-private.h" +#include "cairo-surface-subsurface-inline.h" static const cairo_surface_backend_t cairo_paginated_surface_backend; diff --git a/src/cairo-surface-observer.c b/src/cairo-surface-observer.c index ff902763..49291411 100644 --- a/src/cairo-surface-observer.c +++ b/src/cairo-surface-observer.c @@ -46,7 +46,7 @@ #include "cairo-pattern-private.h" #include "cairo-output-stream-private.h" #include "cairo-recording-surface-private.h" -#include "cairo-surface-subsurface-private.h" +#include "cairo-surface-subsurface-inline.h" #include "cairo-reference-count-private.h" #if CAIRO_HAS_SCRIPT_SURFACE diff --git a/src/cairo-surface-subsurface-inline.h b/src/cairo-surface-subsurface-inline.h new file mode 100644 index 00000000..0cd09e63 --- /dev/null +++ b/src/cairo-surface-subsurface-inline.h @@ -0,0 +1,72 @@ +/* cairo - a vector graphics library with display and print output + * + * Copyright © 2009 Intel Corporation + * + * 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 Intel Corporation. + * + * Contributor(s): + * Chris Wilson <chris@chris-wilson.co.uk> + */ + +#ifndef CAIRO_SURFACE_SUBSURFACE_INLINE_H +#define CAIRO_SURFACE_SUBSURFACE_INLINE_H + +#include "cairo-surface-subsurface-private.h" + +static inline cairo_surface_t * +_cairo_surface_subsurface_get_target (cairo_surface_t *surface) +{ + return ((cairo_surface_subsurface_t *) surface)->target; +} + +static inline void +_cairo_surface_subsurface_offset (cairo_surface_t *surface, + int *x, int *y) +{ + cairo_surface_subsurface_t *ss = (cairo_surface_subsurface_t *) surface; + *x += ss->extents.x; + *y += ss->extents.y; +} + +static inline cairo_surface_t * +_cairo_surface_subsurface_get_target_with_offset (cairo_surface_t *surface, + int *x, int *y) +{ + cairo_surface_subsurface_t *ss = (cairo_surface_subsurface_t *) surface; + *x += ss->extents.x; + *y += ss->extents.y; + return ss->target; +} + +static inline cairo_bool_t +_cairo_surface_is_subsurface (cairo_surface_t *surface) +{ + return surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE; +} + +#endif /* CAIRO_SURFACE_SUBSURFACE_INLINE_H */ diff --git a/src/cairo-surface-subsurface-private.h b/src/cairo-surface-subsurface-private.h index 6dcdb511..89c5cc01 100644 --- a/src/cairo-surface-subsurface-private.h +++ b/src/cairo-surface-subsurface-private.h @@ -48,38 +48,8 @@ struct _cairo_surface_subsurface { cairo_surface_t *snapshot; }; -static inline cairo_surface_t * -_cairo_surface_subsurface_get_target (cairo_surface_t *surface) -{ - return ((cairo_surface_subsurface_t *) surface)->target; -} - -static inline void -_cairo_surface_subsurface_offset (cairo_surface_t *surface, - int *x, int *y) -{ - cairo_surface_subsurface_t *ss = (cairo_surface_subsurface_t *) surface; - *x += ss->extents.x; - *y += ss->extents.y; -} - -static inline cairo_surface_t * -_cairo_surface_subsurface_get_target_with_offset (cairo_surface_t *surface, - int *x, int *y) -{ - cairo_surface_subsurface_t *ss = (cairo_surface_subsurface_t *) surface; - *x += ss->extents.x; - *y += ss->extents.y; - return ss->target; -} - -static inline cairo_bool_t -_cairo_surface_is_subsurface (cairo_surface_t *surface) -{ - return surface->backend->type == CAIRO_SURFACE_TYPE_SUBSURFACE; -} - cairo_private void _cairo_surface_subsurface_set_snapshot (cairo_surface_t *surface, cairo_surface_t *snapshot); + #endif /* CAIRO_SURFACE_SUBSURFACE_PRIVATE_H */ diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c index 7a26b07d..f8dac70b 100644 --- a/src/cairo-xlib-source.c +++ b/src/cairo-xlib-source.c @@ -54,7 +54,7 @@ #include "cairo-surface-offset-private.h" #include "cairo-surface-observer-private.h" #include "cairo-surface-snapshot-inline.h" -#include "cairo-surface-subsurface-private.h" +#include "cairo-surface-subsurface-inline.h" #define PIXMAN_MAX_INT ((pixman_fixed_1 >> 1) - pixman_fixed_e) /* need to ensure deltas also fit */ |