mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-04 06:20:19 +01:00
PDF: Add new, private test function: cairo_pdf_test_force_fallbacks
This commit is contained in:
parent
65b9217cad
commit
11b2481862
4 changed files with 82 additions and 2 deletions
|
|
@ -28,6 +28,7 @@ IGNORE_HFILES= \
|
|||
cairo-hash-private.h \
|
||||
cairo-meta-surface-private.h \
|
||||
cairo-path-fixed-private.h \
|
||||
cairo-pdf-test.h \
|
||||
cairo-private.h \
|
||||
cairo-win32-private.h \
|
||||
cairo-xlib-private.h \
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ endif
|
|||
|
||||
if CAIRO_HAS_PDF_SURFACE
|
||||
libcairo_pdf_headers = cairo-pdf.h
|
||||
libcairo_pdf_sources = cairo-pdf-surface.c
|
||||
libcairo_pdf_sources = cairo-pdf-surface.c cairo-pdf-test.h
|
||||
libcairo_font_subset_sources = cairo-font-subset.c cairo-font-subset-private.h
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include "cairoint.h"
|
||||
#include "cairo-pdf.h"
|
||||
#include "cairo-pdf-test.h"
|
||||
#include "cairo-scaled-font-subsets-private.h"
|
||||
#include "cairo-ft-private.h"
|
||||
#include "cairo-paginated-surface-private.h"
|
||||
|
|
@ -760,7 +761,7 @@ emit_image (cairo_pdf_surface_t *surface,
|
|||
* future). */
|
||||
|
||||
/* These are the only image formats we currently support, (which
|
||||
* makes things a lot simpler here). This is enforeced through
|
||||
* makes things a lot simpler here). This is enforced through
|
||||
* _analyze_operation which only accept source surfaces of
|
||||
* CONTENT_COLOR or CONTENT_COLOR_ALPHA.
|
||||
*/
|
||||
|
|
@ -2022,11 +2023,34 @@ _pattern_supported (cairo_pattern_t *pattern)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static cairo_bool_t cairo_pdf_force_fallbacks = FALSE;
|
||||
|
||||
/**
|
||||
* cairo_pdf_test_force_fallbacks
|
||||
*
|
||||
* Force the PDF surface backend to use image fallbacks for every
|
||||
* operation.
|
||||
*
|
||||
* <note>
|
||||
* This function is <emphasis>only</emphasis> intended for internal
|
||||
* testing use within the cairo distribution. It is not installed in
|
||||
* any public header file.
|
||||
* </note>
|
||||
**/
|
||||
void
|
||||
cairo_pdf_test_force_fallbacks (void)
|
||||
{
|
||||
cairo_pdf_force_fallbacks = TRUE;
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_operation_supported (cairo_pdf_surface_t *surface,
|
||||
cairo_operator_t op,
|
||||
cairo_pattern_t *pattern)
|
||||
{
|
||||
if (cairo_pdf_force_fallbacks)
|
||||
return FALSE;
|
||||
|
||||
if (! _pattern_supported (pattern))
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
55
src/cairo-pdf-test.h
Normal file
55
src/cairo-pdf-test.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/* cairo - a vector graphics library with display and print output
|
||||
*
|
||||
* Copyright © 2006 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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):
|
||||
* Carl D. Worth <cworth@cworth.org>
|
||||
*/
|
||||
|
||||
#ifndef CAIRO_PDF_TEST_H
|
||||
#define CAIRO_PDF_TEST_H
|
||||
|
||||
#include <cairo.h>
|
||||
|
||||
#if CAIRO_HAS_PDF_SURFACE
|
||||
|
||||
#include <cairo-pdf.h>
|
||||
|
||||
CAIRO_BEGIN_DECLS
|
||||
|
||||
void
|
||||
cairo_pdf_test_force_fallbacks (void);
|
||||
|
||||
CAIRO_END_DECLS
|
||||
|
||||
#endif /* CAIRO_HAS_PDF_SURFACE */
|
||||
#endif /* CAIRO_PDF_TEST_H */
|
||||
|
||||
Loading…
Add table
Reference in a new issue