Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /* cairo - a vector graphics library with display and print output
  2.  *
  3.  * Copyright © 2009 Eric Anholt
  4.  * Copyright © 2009 Chris Wilson
  5.  * Copyright © 2005,2010 Red Hat, Inc
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it either under the terms of the GNU Lesser General Public
  9.  * License version 2.1 as published by the Free Software Foundation
  10.  * (the "LGPL") or, at your option, under the terms of the Mozilla
  11.  * Public License Version 1.1 (the "MPL"). If you do not alter this
  12.  * notice, a recipient may use your version of this file under either
  13.  * the MPL or the LGPL.
  14.  *
  15.  * You should have received a copy of the LGPL along with this library
  16.  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
  17.  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
  18.  * You should have received a copy of the MPL along with this library
  19.  * in the file COPYING-MPL-1.1
  20.  *
  21.  * The contents of this file are subject to the Mozilla Public License
  22.  * Version 1.1 (the "License"); you may not use this file except in
  23.  * compliance with the License. You may obtain a copy of the License at
  24.  * http://www.mozilla.org/MPL/
  25.  *
  26.  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
  27.  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
  28.  * the specific language governing rights and limitations.
  29.  *
  30.  * The Original Code is the cairo graphics library.
  31.  *
  32.  * The Initial Developer of the Original Code is Red Hat, Inc.
  33.  *
  34.  * Contributor(s):
  35.  *      Benjamin Otte <otte@gnome.org>
  36.  *      Carl Worth <cworth@cworth.org>
  37.  *      Chris Wilson <chris@chris-wilson.co.uk>
  38.  *      Eric Anholt <eric@anholt.net>
  39.  */
  40.  
  41. #ifndef CAIRO_GL_GRADIENT_PRIVATE_H
  42. #define CAIRO_GL_GRADIENT_PRIVATE_H
  43.  
  44. #define GL_GLEXT_PROTOTYPES
  45.  
  46. #include "cairo-cache-private.h"
  47. #include "cairo-device-private.h"
  48. #include "cairo-reference-count-private.h"
  49. #include "cairo-pattern-private.h"
  50. #include "cairo-types-private.h"
  51.  
  52. #include "cairo-gl.h"
  53.  
  54. #if CAIRO_HAS_GL_SURFACE
  55. #include <GL/gl.h>
  56. #include <GL/glext.h>
  57. #elif CAIRO_HAS_GLESV2_SURFACE
  58. #include <GLES2/gl2.h>
  59. #include <GLES2/gl2ext.h>
  60. #endif
  61.  
  62. #define CAIRO_GL_GRADIENT_CACHE_SIZE 4096
  63.  
  64. /* XXX: Declare in a better place */
  65. typedef struct _cairo_gl_context cairo_gl_context_t;
  66.  
  67. typedef struct _cairo_gl_gradient {
  68.     cairo_cache_entry_t           cache_entry;
  69.     cairo_reference_count_t       ref_count;
  70.     cairo_device_t               *device; /* NB: we don't hold a reference */
  71.     GLuint                        tex;
  72.     unsigned int                  n_stops;
  73.     const cairo_gradient_stop_t  *stops;
  74.     cairo_gradient_stop_t         stops_embedded[1];
  75. } cairo_gl_gradient_t;
  76.  
  77. cairo_private cairo_int_status_t
  78. _cairo_gl_gradient_create (cairo_gl_context_t           *ctx,
  79.                            unsigned int                  n_stops,
  80.                            const cairo_gradient_stop_t  *stops,
  81.                            cairo_gl_gradient_t         **gradient_out);
  82.  
  83. cairo_private_no_warn cairo_gl_gradient_t *
  84. _cairo_gl_gradient_reference (cairo_gl_gradient_t *gradient);
  85.  
  86. cairo_private void
  87. _cairo_gl_gradient_destroy (cairo_gl_gradient_t *gradient);
  88.  
  89. cairo_private cairo_bool_t
  90. _cairo_gl_gradient_equal (const void *key_a, const void *key_b);
  91.  
  92.  
  93. #endif /* CAIRO_GL_GRADIENT_PRIVATE_H */
  94.