Commit 8653c269 authored by Chris Wilson's avatar Chris Wilson 🤔
Browse files

Split cairo-recording-surface-private into struct+inlines

References: https://bugs.freedesktop.org/show_bug.cgi?id=48577

Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 3266f936
......@@ -95,6 +95,7 @@ cairo_private = \
cairo-path-private.h \
cairo-pattern-private.h \
cairo-private.h \
cairo-recording-surface-inline.h \
cairo-recording-surface-private.h \
cairo-reference-count-private.h \
cairo-region-private.h \
......@@ -113,6 +114,7 @@ cairo_private = \
cairo-surface-observer-private.h \
cairo-surface-offset-private.h \
cairo-surface-subsurface-private.h \
cairo-surface-snapshot-inline.h \
cairo-surface-snapshot-private.h \
cairo-surface-wrapper-private.h \
cairo-time-private.h \
......
......@@ -41,8 +41,8 @@
#include "cairo-default-context-private.h"
#include "cairo-error-private.h"
#include "cairo-paginated-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-surface-snapshot-inline.h"
#include "cairo-surface-subsurface-private.h"
#include "cairo-region-private.h"
......
......@@ -52,7 +52,7 @@
#include "cairo-paginated-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-surface-observer-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-surface-snapshot-inline.h"
#include "cairo-surface-subsurface-private.h"
#define PIXMAN_MAX_INT ((pixman_fixed_1 >> 1) - pixman_fixed_e) /* need to ensure deltas also fit */
......
......@@ -36,8 +36,8 @@
#include "cairo-image-surface-private.h"
#include "cairo-path-private.h"
#include "cairo-pattern-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-surface-snapshot-inline.h"
#include <float.h>
......
......@@ -59,7 +59,7 @@
#include "cairo-paginated-private.h"
#include "cairo-scaled-font-subsets-private.h"
#include "cairo-surface-clipper-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-surface-snapshot-inline.h"
#include "cairo-surface-subsurface-private.h"
#include "cairo-type3-glyph-surface-private.h"
......
......@@ -71,7 +71,7 @@
#include "cairo-paginated-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-surface-clipper-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-surface-snapshot-inline.h"
#include "cairo-surface-subsurface-private.h"
#include "cairo-output-stream-private.h"
#include "cairo-type3-glyph-surface-private.h"
......
/* cairo - a vector graphics library with display and print output
*
* Copyright © 2005 Red Hat, Inc
*
* 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 Red Hat, Inc.
*
* Contributor(s):
* Kristian Høgsberg <krh@redhat.com>
* Adrian Johnson <ajohnson@redneon.com>
*/
#ifndef CAIRO_RECORDING_SURFACE_INLINE_H
#define CAIRO_RECORDING_SURFACE_INLINE_H
#include "cairo-recording-surface-private.h"
static inline cairo_bool_t
_cairo_recording_surface_get_bounds (cairo_surface_t *surface,
cairo_rectangle_t *extents)
{
cairo_recording_surface_t *recording = (cairo_recording_surface_t *)surface;
if (recording->unbounded)
return FALSE;
*extents = recording->extents_pixels;
return TRUE;
}
/**
* _cairo_surface_is_recording:
* @surface: a #cairo_surface_t
*
* Checks if a surface is a #cairo_recording_surface_t
*
* Return value: %TRUE if the surface is a recording surface
**/
static inline cairo_bool_t
_cairo_surface_is_recording (const cairo_surface_t *surface)
{
return surface->backend->type == CAIRO_SURFACE_TYPE_RECORDING;
}
#endif /* CAIRO_RECORDING_SURFACE_INLINE_H */
......@@ -184,30 +184,4 @@ _cairo_recording_surface_get_ink_bbox (cairo_recording_surface_t *surface,
cairo_box_t *bbox,
const cairo_matrix_t *transform);
static inline cairo_bool_t
_cairo_recording_surface_get_bounds (cairo_surface_t *surface,
cairo_rectangle_t *extents)
{
cairo_recording_surface_t *recording = (cairo_recording_surface_t *)surface;
if (recording->unbounded)
return FALSE;
*extents = recording->extents_pixels;
return TRUE;
}
/**
* _cairo_surface_is_recording:
* @surface: a #cairo_surface_t
*
* Checks if a surface is a #cairo_recording_surface_t
*
* Return value: %TRUE if the surface is a recording surface
**/
static inline cairo_bool_t
_cairo_surface_is_recording (const cairo_surface_t *surface)
{
return surface->backend->type == CAIRO_SURFACE_TYPE_RECORDING;
}
#endif /* CAIRO_RECORDING_SURFACE_H */
......@@ -86,7 +86,7 @@
#include "cairo-default-context-private.h"
#include "cairo-error-private.h"
#include "cairo-image-surface-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-surface-wrapper-private.h"
#include "cairo-traps-private.h"
......
......@@ -77,10 +77,10 @@
#include "cairo-image-surface-private.h"
#include "cairo-output-stream-private.h"
#include "cairo-pattern-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-scaled-font-private.h"
#include "cairo-surface-clipper-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-surface-snapshot-inline.h"
#include "cairo-surface-subsurface-private.h"
#include "cairo-surface-wrapper-private.h"
......
......@@ -48,7 +48,7 @@
#include "cairo-paginated-private.h"
#include "cairo-pattern-private.h"
#include "cairo-region-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-spans-compositor-private.h"
#include "cairo-surface-subsurface-private.h"
#include "cairo-surface-snapshot-private.h"
......
......@@ -36,7 +36,7 @@
#ifndef CAIRO_SURFACE_SNAPSHOT_INLINE_H
#define CAIRO_SURFACE_SNAPSHOT_INLINE_H
#include "cairo-surface-private.h"
#include "cairo-surface-snapshot-private.h"
static inline cairo_bool_t
_cairo_surface_snapshot_is_reused (cairo_surface_t *surface)
......
......@@ -46,22 +46,4 @@ struct _cairo_surface_snapshot {
cairo_surface_t *clone;
};
static inline cairo_bool_t
_cairo_surface_snapshot_is_reused (cairo_surface_t *surface)
{
return CAIRO_REFERENCE_COUNT_GET_VALUE (&surface->ref_count) > 2;
}
static inline cairo_surface_t *
_cairo_surface_snapshot_get_target (cairo_surface_t *surface)
{
return ((cairo_surface_snapshot_t *) surface)->target;
}
static inline cairo_bool_t
_cairo_surface_is_snapshot (cairo_surface_t *surface)
{
return surface->backend->type == (cairo_surface_type_t)CAIRO_INTERNAL_SURFACE_TYPE_SNAPSHOT;
}
#endif /* CAIRO_SURFACE_SNAPSHOT_PRIVATE_H */
......@@ -41,7 +41,7 @@
#include "cairo-error-private.h"
#include "cairo-image-surface-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-surface-snapshot-inline.h"
static cairo_status_t
_cairo_surface_snapshot_finish (void *abstract_surface)
......
......@@ -50,7 +50,7 @@
#include "cairo-error-private.h"
#include "cairo-image-info-private.h"
#include "cairo-image-surface-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-output-stream-private.h"
#include "cairo-path-fixed-private.h"
#include "cairo-paginated-private.h"
......
......@@ -45,7 +45,7 @@
#include "cairo-default-context-private.h"
#include "cairo-error-private.h"
#include "cairo-tee-surface-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-surface-wrapper-private.h"
#include "cairo-array-private.h"
#include "cairo-image-surface-private.h"
......
......@@ -51,9 +51,9 @@
#include "cairo-image-surface-private.h"
#include "cairo-pattern-private.h"
#include "cairo-paginated-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-surface-subsurface-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-surface-snapshot-inline.h"
#include "cairo-surface-observer-private.h"
#include "cairo-region-private.h"
#include "cairo-spans-private.h"
......
......@@ -43,7 +43,7 @@
#include "cairo-error-private.h"
#include "cairo-image-surface-private.h"
#include "cairo-path-fixed-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-surface-clipper-private.h"
#include <pixman.h>
......
......@@ -40,10 +40,10 @@
#include "cairo-image-surface-private.h"
#include "cairo-region-private.h"
#include "cairo-surface-offset-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-surface-snapshot-inline.h"
#include "cairo-surface-subsurface-private.h"
#include "cairo-traps-private.h"
#include "cairo-recording-surface-private.h"
#include "cairo-recording-surface-inline.h"
#include "cairo-paginated-private.h"
#define PIXMAN_MAX_INT ((pixman_fixed_1 >> 1) - pixman_fixed_e) /* need to ensure deltas also fit */
......
......@@ -53,7 +53,7 @@
#include "cairo-surface-backend-private.h"
#include "cairo-surface-offset-private.h"
#include "cairo-surface-observer-private.h"
#include "cairo-surface-snapshot-private.h"
#include "cairo-surface-snapshot-inline.h"
#include "cairo-surface-subsurface-private.h"
#define PIXMAN_MAX_INT ((pixman_fixed_1 >> 1) - pixman_fixed_e) /* need to ensure deltas also fit */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment