mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
[cogl] Updates all file headers and removes lots of trailing white space
Adds missing notices, and ensures all the notices are consistent. The Cogl blurb also now reads: * Cogl * * An object oriented GL/GLES Abstraction/Utility Layer
This commit is contained in:
parent
2d94b3f46f
commit
7e9685294e
12
cogl-color.h
12
cogl-color.h
@ -1,7 +1,9 @@
|
||||
/* cogl-color.h: Color type for COGL
|
||||
* This file is part of Clutter
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -14,7 +16,9 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
|
23
cogl-debug.h
23
cogl-debug.h
@ -1,3 +1,26 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COGL_DEBUG_H__
|
||||
#define __COGL_DEBUG_H__
|
||||
|
||||
|
@ -1,3 +1,26 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef COGL_DEPRECATED_H
|
||||
|
||||
#define cogl_color cogl_color_REPLACED_BY_cogl_set_source_color
|
||||
|
14
cogl-fixed.h
14
cogl-fixed.h
@ -1,7 +1,9 @@
|
||||
/* cogl-fixed.h: Fixed point API
|
||||
* This file is part of Clutter
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -14,7 +16,9 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
@ -725,7 +729,7 @@ CoglFixed cogl_angle_cos (CoglAngle angle);
|
||||
/*< private >*/
|
||||
|
||||
#if defined (G_CAN_INLINE)
|
||||
G_INLINE_FUNC CoglFixed
|
||||
G_INLINE_FUNC CoglFixed
|
||||
cogl_fixed_mul (CoglFixed a,
|
||||
CoglFixed b)
|
||||
{
|
||||
|
@ -1,3 +1,26 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <cogl/cogl.h> can be included directly."
|
||||
#endif
|
||||
|
@ -1,3 +1,29 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Robert Bragg <robert@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __COGL_MATRIX_H
|
||||
#define __COGL_MATRIX_H
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* cogl-offscreen.h: Offscreen objects
|
||||
* This file is part of Clutter
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -14,7 +16,9 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
@ -48,7 +52,7 @@ CoglHandle cogl_offscreen_new_to_texture (CoglHandle texhandle);
|
||||
|
||||
/**
|
||||
* cogl_offscreen_new_multisample:
|
||||
*
|
||||
*
|
||||
*
|
||||
* Returns:
|
||||
*/
|
||||
|
12
cogl-path.h
12
cogl-path.h
@ -1,7 +1,9 @@
|
||||
/* cogl-path.h: Path primitives
|
||||
* This file is part of Clutter
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -14,7 +16,9 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* cogl-shader.h: Shaders and programmable pipeline
|
||||
* This file is part of Clutter
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -14,7 +16,9 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* cogl-texture.h: Texture objects
|
||||
* This file is part of Clutter
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -14,7 +16,9 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
|
21
cogl-types.h
21
cogl-types.h
@ -1,13 +1,14 @@
|
||||
/* cogl-types.h: Shared COGL types
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* This file is part of Clutter
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -15,7 +16,9 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
@ -137,7 +140,7 @@ typedef enum
|
||||
COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT,
|
||||
COGL_PIXEL_FORMAT_YUV = 7,
|
||||
COGL_PIXEL_FORMAT_G_8 = 8,
|
||||
|
||||
|
||||
COGL_PIXEL_FORMAT_RGB_888 = COGL_PIXEL_FORMAT_24,
|
||||
|
||||
COGL_PIXEL_FORMAT_BGR_888 = (COGL_PIXEL_FORMAT_24 |
|
||||
@ -178,7 +181,7 @@ typedef enum
|
||||
COGL_PREMULT_BIT |
|
||||
COGL_BGR_BIT |
|
||||
COGL_AFIRST_BIT),
|
||||
|
||||
|
||||
COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 |
|
||||
COGL_A_BIT |
|
||||
COGL_PREMULT_BIT),
|
||||
@ -186,8 +189,8 @@ typedef enum
|
||||
COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 |
|
||||
COGL_A_BIT |
|
||||
COGL_PREMULT_BIT),
|
||||
|
||||
|
||||
|
||||
|
||||
} CoglPixelFormat;
|
||||
|
||||
#define COGL_TYPE_PIXEL_FORMAT (cogl_pixel_format_get_type ())
|
||||
|
@ -1,13 +1,9 @@
|
||||
/*
|
||||
* Cogl.
|
||||
* Cogl
|
||||
*
|
||||
* An OpenGL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Vertex Buffer API: Handle extensible arrays of vertex attributes
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
*
|
||||
* Authored by: Robert Bragg <robert@linux.intel.com>
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,7 +16,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Robert Bragg <robert@linux.intel.com>
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
|
@ -1,13 +1,12 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -164,7 +162,7 @@ inline static void
|
||||
_cogl_unpremult_alpha_last (const guchar *src, guchar *dst)
|
||||
{
|
||||
guchar alpha = src[3];
|
||||
|
||||
|
||||
dst[0] = ((((gulong) src[0] >> 16) & 0xff) * 255 ) / alpha;
|
||||
dst[1] = ((((gulong) src[1] >> 8) & 0xff) * 255 ) / alpha;
|
||||
dst[2] = ((((gulong) src[2] >> 0) & 0xff) * 255 ) / alpha;
|
||||
@ -175,7 +173,7 @@ inline static void
|
||||
_cogl_unpremult_alpha_first (const guchar *src, guchar *dst)
|
||||
{
|
||||
guchar alpha = src[0];
|
||||
|
||||
|
||||
dst[0] = alpha;
|
||||
dst[1] = ((((gulong) src[1] >> 16) & 0xff) * 255 ) / alpha;
|
||||
dst[2] = ((((gulong) src[2] >> 8) & 0xff) * 255 ) / alpha;
|
||||
@ -187,23 +185,23 @@ _cogl_bitmap_fallback_can_convert (CoglPixelFormat src, CoglPixelFormat dst)
|
||||
{
|
||||
if (src == dst)
|
||||
return FALSE;
|
||||
|
||||
|
||||
switch (src & COGL_UNORDERED_MASK)
|
||||
{
|
||||
case COGL_PIXEL_FORMAT_G_8:
|
||||
case COGL_PIXEL_FORMAT_24:
|
||||
case COGL_PIXEL_FORMAT_32:
|
||||
|
||||
|
||||
if ((dst & COGL_UNORDERED_MASK) != COGL_PIXEL_FORMAT_24 &&
|
||||
(dst & COGL_UNORDERED_MASK) != COGL_PIXEL_FORMAT_32 &&
|
||||
(dst & COGL_UNORDERED_MASK) != COGL_PIXEL_FORMAT_G_8)
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -224,11 +222,11 @@ _cogl_bitmap_fallback_convert (const CoglBitmap *bmp,
|
||||
gint dst_bpp;
|
||||
gint x,y;
|
||||
guchar temp_rgba[4] = {0,0,0,0};
|
||||
|
||||
|
||||
/* Make sure conversion supported */
|
||||
if (!_cogl_bitmap_fallback_can_convert (bmp->format, dst_format))
|
||||
return FALSE;
|
||||
|
||||
|
||||
src_bpp = _cogl_get_format_bpp (bmp->format);
|
||||
dst_bpp = _cogl_get_format_bpp (dst_format);
|
||||
|
||||
@ -237,18 +235,18 @@ _cogl_bitmap_fallback_convert (const CoglBitmap *bmp,
|
||||
dst_bmp->rowstride = sizeof(guchar) * dst_bpp * dst_bmp->width;
|
||||
dst_bmp->format = ((bmp->format & COGL_PREMULT_BIT) |
|
||||
(dst_format & COGL_UNPREMULT_MASK));
|
||||
|
||||
|
||||
/* Allocate a new buffer to hold converted data */
|
||||
dst_bmp->data = g_malloc (sizeof(guchar)
|
||||
* dst_bmp->height
|
||||
* dst_bmp->rowstride);
|
||||
|
||||
|
||||
/* FIXME: Optimize */
|
||||
for (y = 0; y < bmp->height; y++)
|
||||
{
|
||||
src = (guchar*)bmp->data + y * bmp->rowstride;
|
||||
dst = (guchar*)dst_bmp->data + y * dst_bmp->rowstride;
|
||||
|
||||
|
||||
for (x = 0; x < bmp->width; x++)
|
||||
{
|
||||
/* FIXME: Would be nice to at least remove this inner
|
||||
@ -273,7 +271,7 @@ _cogl_bitmap_fallback_convert (const CoglBitmap *bmp,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch (dst_format & COGL_UNPREMULT_MASK)
|
||||
{
|
||||
case COGL_PIXEL_FORMAT_G_8:
|
||||
@ -293,12 +291,12 @@ _cogl_bitmap_fallback_convert (const CoglBitmap *bmp,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
src += src_bpp;
|
||||
dst += dst_bpp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -310,28 +308,28 @@ _cogl_bitmap_fallback_unpremult (const CoglBitmap *bmp,
|
||||
guchar *dst;
|
||||
gint bpp;
|
||||
gint x,y;
|
||||
|
||||
|
||||
/* Make sure format supported for un-premultiplication */
|
||||
if (!_cogl_bitmap_fallback_can_unpremult (bmp->format))
|
||||
return FALSE;
|
||||
|
||||
|
||||
bpp = _cogl_get_format_bpp (bmp->format);
|
||||
|
||||
|
||||
/* Initialize destination bitmap */
|
||||
*dst_bmp = *bmp;
|
||||
dst_bmp->format = (bmp->format & COGL_UNPREMULT_MASK);
|
||||
|
||||
|
||||
/* Allocate a new buffer to hold converted data */
|
||||
dst_bmp->data = g_malloc (sizeof(guchar)
|
||||
* dst_bmp->height
|
||||
* dst_bmp->rowstride);
|
||||
|
||||
|
||||
/* FIXME: Optimize */
|
||||
for (y = 0; y < bmp->height; y++)
|
||||
{
|
||||
src = (guchar*)bmp->data + y * bmp->rowstride;
|
||||
dst = (guchar*)dst_bmp->data + y * dst_bmp->rowstride;
|
||||
|
||||
|
||||
for (x = 0; x < bmp->width; x++)
|
||||
{
|
||||
/* FIXME: Would be nice to at least remove this inner
|
||||
@ -351,12 +349,12 @@ _cogl_bitmap_fallback_unpremult (const CoglBitmap *bmp,
|
||||
else
|
||||
_cogl_unpremult_alpha_last (src, dst);
|
||||
}
|
||||
|
||||
|
||||
src += bpp;
|
||||
dst += bpp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -222,7 +220,7 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
guchar *out_data;
|
||||
guchar *out;
|
||||
gint r;
|
||||
|
||||
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
if (bmp == NULL)
|
||||
@ -232,7 +230,7 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
pixbuf = gdk_pixbuf_new_from_file (filename, error);
|
||||
if (pixbuf == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
/* Get pixbuf properties */
|
||||
has_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
|
||||
color_space = gdk_pixbuf_get_colorspace (pixbuf);
|
||||
@ -241,10 +239,10 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
bits_per_sample = gdk_pixbuf_get_bits_per_sample (pixbuf);
|
||||
n_channels = gdk_pixbuf_get_n_channels (pixbuf);
|
||||
|
||||
|
||||
/* The docs say this is the right way */
|
||||
last_row_size = width * ((n_channels * bits_per_sample + 7) / 8);
|
||||
|
||||
|
||||
/* According to current docs this should be true and so
|
||||
* the translation to cogl pixel format below valid */
|
||||
g_assert (bits_per_sample == 8);
|
||||
@ -253,7 +251,7 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
g_assert (n_channels == 4);
|
||||
else
|
||||
g_assert (n_channels == 3);
|
||||
|
||||
|
||||
/* Translate to cogl pixel format */
|
||||
switch (color_space)
|
||||
{
|
||||
@ -263,19 +261,19 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
COGL_PIXEL_FORMAT_RGBA_8888 :
|
||||
COGL_PIXEL_FORMAT_RGB_888;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
/* Ouch, spec changed! */
|
||||
g_object_unref (pixbuf);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* FIXME: Any way to destroy pixbuf but retain pixel data? */
|
||||
|
||||
|
||||
pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
out_data = (guchar*) g_malloc (height * rowstride);
|
||||
out = out_data;
|
||||
|
||||
|
||||
/* Copy up to last row */
|
||||
for (r = 0; r < height-1; ++r)
|
||||
{
|
||||
@ -283,13 +281,13 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
pixels += rowstride;
|
||||
out += rowstride;
|
||||
}
|
||||
|
||||
|
||||
/* Copy last row */
|
||||
memcpy (out, pixels, last_row_size);
|
||||
|
||||
|
||||
/* Destroy GdkPixbuf object */
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
|
||||
/* Store bitmap info */
|
||||
bmp->data = out_data; /* The stored data the same alignment constraints as a
|
||||
* gdkpixbuf but stores a full rowstride in the last
|
||||
@ -299,7 +297,7 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
bmp->width = width;
|
||||
bmp->height = height;
|
||||
bmp->rowstride = rowstride;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -335,14 +333,14 @@ _cogl_bitmap_from_file (CoglBitmap *bmp,
|
||||
|
||||
if (bmp == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
/* Load from file using stb */
|
||||
pixels = stbi_load (filename,
|
||||
&width, &height, &stb_pixel_format,
|
||||
STBI_rgb_alpha);
|
||||
if (pixels == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
/* Store bitmap info */
|
||||
bmp->data = g_memdup (pixels, height * width * 4);
|
||||
bmp->format = COGL_PIXEL_FORMAT_RGBA_8888;
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -47,7 +45,7 @@ _cogl_get_format_bpp (CoglPixelFormat format)
|
||||
2, /* YUV */
|
||||
1 /* G_8 */
|
||||
};
|
||||
|
||||
|
||||
return bpp_lut [format & COGL_UNORDERED_MASK];
|
||||
}
|
||||
|
||||
@ -59,7 +57,7 @@ _cogl_bitmap_convert_and_premult (const CoglBitmap *bmp,
|
||||
CoglBitmap tmp_bmp = *bmp;
|
||||
CoglBitmap new_bmp = *bmp;
|
||||
gboolean new_bmp_owner = FALSE;
|
||||
|
||||
|
||||
/* Is base format different (not considering premult status)? */
|
||||
if ((bmp->format & COGL_UNPREMULT_MASK) !=
|
||||
(dst_format & COGL_UNPREMULT_MASK))
|
||||
@ -71,12 +69,12 @@ _cogl_bitmap_convert_and_premult (const CoglBitmap *bmp,
|
||||
if (!_cogl_bitmap_fallback_convert (&new_bmp, &tmp_bmp, dst_format))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Update bitmap with new data */
|
||||
new_bmp = tmp_bmp;
|
||||
new_bmp_owner = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* Do we need to unpremultiply */
|
||||
if ((bmp->format & COGL_PREMULT_BIT) == 0 &&
|
||||
(dst_format & COGL_PREMULT_BIT) > 0)
|
||||
@ -89,19 +87,19 @@ _cogl_bitmap_convert_and_premult (const CoglBitmap *bmp,
|
||||
{
|
||||
if (new_bmp_owner)
|
||||
g_free (new_bmp.data);
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Update bitmap with new data */
|
||||
if (new_bmp_owner)
|
||||
g_free (new_bmp.data);
|
||||
|
||||
|
||||
new_bmp = tmp_bmp;
|
||||
new_bmp_owner = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* Do we need to premultiply */
|
||||
if ((bmp->format & COGL_PREMULT_BIT) > 0 &&
|
||||
(dst_format & COGL_PREMULT_BIT) == 0)
|
||||
@ -109,13 +107,13 @@ _cogl_bitmap_convert_and_premult (const CoglBitmap *bmp,
|
||||
/* FIXME: implement premultiplication */
|
||||
if (new_bmp_owner)
|
||||
g_free (new_bmp.data);
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Output new bitmap info */
|
||||
*dst_bmp = new_bmp;
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -133,14 +131,14 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
|
||||
guchar *dstdata;
|
||||
gint bpp;
|
||||
gint line;
|
||||
|
||||
|
||||
/* Intended only for fast copies when format is equal! */
|
||||
g_assert (src->format == dst->format);
|
||||
bpp = _cogl_get_format_bpp (src->format);
|
||||
|
||||
|
||||
srcdata = src->data + src_y * src->rowstride + src_x * bpp;
|
||||
dstdata = dst->data + dst_y * dst->rowstride + dst_x * bpp;
|
||||
|
||||
|
||||
for (line=0; line<height; ++line)
|
||||
{
|
||||
memcpy (dstdata, srcdata, width * bpp);
|
||||
@ -162,7 +160,7 @@ cogl_bitmap_new_from_file (const gchar *filename,
|
||||
GError **error)
|
||||
{
|
||||
CoglBitmap bmp;
|
||||
|
||||
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, COGL_INVALID_HANDLE);
|
||||
|
||||
/* Try loading with imaging backend */
|
||||
@ -177,7 +175,7 @@ cogl_bitmap_new_from_file (const gchar *filename,
|
||||
*error = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (CoglBitmap *) g_memdup (&bmp, sizeof (CoglBitmap));
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,3 +1,26 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Havoc Pennington <hp@pobox.com> for litl
|
||||
*
|
||||
* Copyright (C) 2009 OpenedHand
|
||||
* Copyright (C) 2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -21,6 +19,9 @@
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Havoc Pennington <hp@pobox.com> for litl
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Havoc Pennington <hp@pobox.com> for litl
|
||||
*
|
||||
* Copyright (C) 2009 OpenedHand
|
||||
* Copyright (C) 2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -21,6 +19,9 @@
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Havoc Pennington <hp@pobox.com> for litl
|
||||
*/
|
||||
|
||||
#ifndef __COGL_CURRENT_MATRIX_H
|
||||
|
@ -1,3 +1,26 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
@ -1,3 +1,26 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#define G_IMPLEMENT_INLINES
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007, 2008 OpenedHand
|
||||
* Copyright (C) 2009 Intel Corp.
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,3 +1,29 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Robert Bragg <robert@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __COGL_MATERIAL_PRIVATE_H
|
||||
#define __COGL_MATERIAL_PRIVATE_H
|
||||
|
||||
|
@ -1,3 +1,28 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Robert Bragg <robert@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Havoc Pennington <hp@pobox.com> for litl
|
||||
*
|
||||
* Copyright (C) 2009 OpenedHand
|
||||
* Copyright (C) 2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -21,6 +19,9 @@
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Havoc Pennington <hp@pobox.com> for litl
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Havoc Pennington <hp@pobox.com> for litl
|
||||
*
|
||||
* Copyright (C) 2009 OpenedHand
|
||||
* Copyright (C) 2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -21,6 +19,9 @@
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Havoc Pennington <hp@pobox.com> for litl
|
||||
*/
|
||||
|
||||
#ifndef __COGL_MATRIX_STACK_H
|
||||
|
@ -1,3 +1,29 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Robert Bragg <robert@linux.intel.com>
|
||||
*/
|
||||
|
||||
#include <cogl-matrix.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -1322,9 +1320,9 @@ cogl_path_fill_preserve (void)
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
cogl_clip_ensure ();
|
||||
|
||||
|
||||
if (ctx->path_nodes->len == 0)
|
||||
return;
|
||||
return;
|
||||
|
||||
_cogl_path_fill_nodes ();
|
||||
}
|
||||
@ -1341,12 +1339,12 @@ void
|
||||
cogl_path_stroke_preserve (void)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
cogl_clip_ensure ();
|
||||
|
||||
if (ctx->path_nodes->len == 0)
|
||||
return;
|
||||
|
||||
|
||||
_cogl_path_stroke_nodes();
|
||||
}
|
||||
|
||||
@ -1355,14 +1353,14 @@ cogl_path_move_to (float x,
|
||||
float y)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
/* FIXME: handle multiple contours maybe? */
|
||||
|
||||
|
||||
_cogl_path_add_node (TRUE, x, y);
|
||||
|
||||
|
||||
ctx->path_start.x = x;
|
||||
ctx->path_start.y = y;
|
||||
|
||||
|
||||
ctx->path_pen = ctx->path_start;
|
||||
}
|
||||
|
||||
@ -1371,7 +1369,7 @@ cogl_path_rel_move_to (float x,
|
||||
float y)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
cogl_path_move_to (ctx->path_pen.x + x,
|
||||
ctx->path_pen.y + y);
|
||||
}
|
||||
@ -1381,9 +1379,9 @@ cogl_path_line_to (float x,
|
||||
float y)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
_cogl_path_add_node (FALSE, x, y);
|
||||
|
||||
|
||||
ctx->path_pen.x = x;
|
||||
ctx->path_pen.y = y;
|
||||
}
|
||||
@ -1393,7 +1391,7 @@ cogl_path_rel_line_to (float x,
|
||||
float y)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
cogl_path_line_to (ctx->path_pen.x + x,
|
||||
ctx->path_pen.y + y);
|
||||
}
|
||||
@ -1402,7 +1400,7 @@ void
|
||||
cogl_path_close (void)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
_cogl_path_add_node (FALSE, ctx->path_start.x, ctx->path_start.y);
|
||||
ctx->path_pen = ctx->path_start;
|
||||
}
|
||||
@ -1430,9 +1428,9 @@ cogl_path_polyline (float *coords,
|
||||
gint num_points)
|
||||
{
|
||||
gint c = 0;
|
||||
|
||||
|
||||
cogl_path_move_to (coords[0], coords[1]);
|
||||
|
||||
|
||||
for (c = 1; c < num_points; ++c)
|
||||
cogl_path_line_to (coords[2*c], coords[2*c+1]);
|
||||
}
|
||||
@ -1473,17 +1471,17 @@ _cogl_path_arc (float center_x,
|
||||
float sina = 0x0;
|
||||
float px = 0x0;
|
||||
float py = 0x0;
|
||||
|
||||
|
||||
/* Fix invalid angles */
|
||||
|
||||
|
||||
if (angle_1 == angle_2 || angle_step == 0x0)
|
||||
return;
|
||||
|
||||
|
||||
if (angle_step < 0x0)
|
||||
angle_step = -angle_step;
|
||||
|
||||
|
||||
/* Walk the arc by given step */
|
||||
|
||||
|
||||
a = angle_1;
|
||||
while (a != angle_2)
|
||||
{
|
||||
@ -1492,12 +1490,12 @@ _cogl_path_arc (float center_x,
|
||||
|
||||
px = center_x + (cosa * radius_x);
|
||||
py = center_y + (sina * radius_y);
|
||||
|
||||
|
||||
if (a == angle_1 && move_first)
|
||||
cogl_path_move_to (px, py);
|
||||
else
|
||||
cogl_path_line_to (px, py);
|
||||
|
||||
|
||||
if (G_LIKELY (angle_2 > angle_1))
|
||||
{
|
||||
a += angle_step;
|
||||
@ -1513,7 +1511,7 @@ _cogl_path_arc (float center_x,
|
||||
}
|
||||
|
||||
/* Make sure the final point is drawn */
|
||||
|
||||
|
||||
cosa = cosf (angle_2 * (G_PI/180.0));
|
||||
sina = sinf (angle_2 * (G_PI/180.0));
|
||||
|
||||
@ -1530,7 +1528,7 @@ cogl_path_arc (float center_x,
|
||||
float radius_y,
|
||||
float angle_1,
|
||||
float angle_2)
|
||||
{
|
||||
{
|
||||
float angle_step = 10;
|
||||
/* it is documented that a move to is needed to create a freestanding
|
||||
* arc
|
||||
@ -1552,7 +1550,7 @@ cogl_path_arc_rel (float center_x,
|
||||
float angle_step)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
_cogl_path_arc (ctx->path_pen.x + center_x,
|
||||
ctx->path_pen.y + center_y,
|
||||
radius_x, radius_y,
|
||||
@ -1567,15 +1565,15 @@ cogl_path_ellipse (float center_x,
|
||||
float radius_y)
|
||||
{
|
||||
float angle_step = 10;
|
||||
|
||||
|
||||
/* FIXME: if shows to be slow might be optimized
|
||||
* by mirroring just a quarter of it */
|
||||
|
||||
|
||||
_cogl_path_arc (center_x, center_y,
|
||||
radius_x, radius_y,
|
||||
0, 360,
|
||||
angle_step, 1 /* move first */);
|
||||
|
||||
|
||||
cogl_path_close();
|
||||
}
|
||||
|
||||
@ -1589,7 +1587,7 @@ cogl_path_round_rectangle (float x_1,
|
||||
{
|
||||
float inner_width = x_2 - x_1 - radius * 2;
|
||||
float inner_height = y_2 - y_1 - radius * 2;
|
||||
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
cogl_path_move_to (x_1, y_1 + radius);
|
||||
@ -1598,7 +1596,7 @@ cogl_path_round_rectangle (float x_1,
|
||||
180,
|
||||
270,
|
||||
arc_step);
|
||||
|
||||
|
||||
cogl_path_line_to (ctx->path_pen.x + inner_width,
|
||||
ctx->path_pen.y);
|
||||
cogl_path_arc_rel (0, radius,
|
||||
@ -1606,7 +1604,7 @@ cogl_path_round_rectangle (float x_1,
|
||||
-90,
|
||||
0,
|
||||
arc_step);
|
||||
|
||||
|
||||
cogl_path_line_to (ctx->path_pen.x,
|
||||
ctx->path_pen.y + inner_height);
|
||||
|
||||
@ -1615,7 +1613,7 @@ cogl_path_round_rectangle (float x_1,
|
||||
0,
|
||||
90,
|
||||
arc_step);
|
||||
|
||||
|
||||
cogl_path_line_to (ctx->path_pen.x - inner_width,
|
||||
ctx->path_pen.y);
|
||||
cogl_path_arc_rel (0, -radius,
|
||||
@ -1623,7 +1621,7 @@ cogl_path_round_rectangle (float x_1,
|
||||
90,
|
||||
180,
|
||||
arc_step);
|
||||
|
||||
|
||||
cogl_path_close ();
|
||||
}
|
||||
|
||||
@ -1644,16 +1642,16 @@ _cogl_path_bezier3_sub (CoglBezCubic *cubic)
|
||||
floatVec2 c4;
|
||||
floatVec2 c5;
|
||||
gint cindex;
|
||||
|
||||
|
||||
/* Put first curve on stack */
|
||||
cubics[0] = *cubic;
|
||||
cindex = 0;
|
||||
|
||||
|
||||
while (cindex >= 0)
|
||||
{
|
||||
c = &cubics[cindex];
|
||||
|
||||
|
||||
|
||||
|
||||
/* Calculate distance of control points from their
|
||||
* counterparts on the line between end points */
|
||||
dif1.x = (c->p2.x * 3) - (c->p1.x * 2) - c->p4.x;
|
||||
@ -1669,12 +1667,12 @@ _cogl_path_bezier3_sub (CoglBezCubic *cubic)
|
||||
dif2.x = -dif2.x;
|
||||
if (dif2.y < 0)
|
||||
dif2.y = -dif2.y;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Pick the greatest of two distances */
|
||||
if (dif1.x < dif2.x) dif1.x = dif2.x;
|
||||
if (dif1.y < dif2.y) dif1.y = dif2.y;
|
||||
|
||||
|
||||
/* Cancel if the curve is flat enough */
|
||||
if (dif1.x + dif1.y <= 1.0 ||
|
||||
cindex == _COGL_MAX_BEZ_RECURSE_DEPTH-1)
|
||||
@ -1689,10 +1687,10 @@ _cogl_path_bezier3_sub (CoglBezCubic *cubic)
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* Left recursion goes on top of stack! */
|
||||
cright = c; cleft = &cubics[++cindex];
|
||||
|
||||
|
||||
/* Subdivide into 2 sub-curves */
|
||||
c1.x = ((c->p1.x + c->p2.x) / 2);
|
||||
c1.y = ((c->p1.y + c->p2.y) / 2);
|
||||
@ -1700,21 +1698,21 @@ _cogl_path_bezier3_sub (CoglBezCubic *cubic)
|
||||
mm.y = ((c->p2.y + c->p3.y) / 2);
|
||||
c5.x = ((c->p3.x + c->p4.x) / 2);
|
||||
c5.y = ((c->p3.y + c->p4.y) / 2);
|
||||
|
||||
|
||||
c2.x = ((c1.x + mm.x) / 2);
|
||||
c2.y = ((c1.y + mm.y) / 2);
|
||||
c4.x = ((mm.x + c5.x) / 2);
|
||||
c4.y = ((mm.y + c5.y) / 2);
|
||||
|
||||
|
||||
c3.x = ((c2.x + c4.x) / 2);
|
||||
c3.y = ((c2.y + c4.y) / 2);
|
||||
|
||||
|
||||
/* Add left recursion to stack */
|
||||
cleft->p1 = c->p1;
|
||||
cleft->p2 = c1;
|
||||
cleft->p3 = c2;
|
||||
cleft->p4 = c3;
|
||||
|
||||
|
||||
/* Add right recursion to stack */
|
||||
cright->p1 = c3;
|
||||
cright->p2 = c4;
|
||||
@ -1761,7 +1759,7 @@ cogl_path_rel_curve_to (float x_1,
|
||||
float y_3)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
cogl_path_curve_to (ctx->path_pen.x + x_1,
|
||||
ctx->path_pen.y + y_1,
|
||||
ctx->path_pen.x + x_2,
|
||||
@ -1789,17 +1787,17 @@ _cogl_path_bezier2_sub (CoglBezQuad *quad)
|
||||
floatVec2 c2;
|
||||
floatVec2 c3;
|
||||
gint qindex;
|
||||
|
||||
|
||||
/* Put first curve on stack */
|
||||
quads[0] = *quad;
|
||||
qindex = 0;
|
||||
|
||||
|
||||
/* While stack is not empty */
|
||||
while (qindex >= 0)
|
||||
{
|
||||
|
||||
|
||||
q = &quads[qindex];
|
||||
|
||||
|
||||
/* Calculate distance of control point from its
|
||||
* counterpart on the line between end points */
|
||||
mid.x = ((q->p1.x + q->p3.x) / 2);
|
||||
@ -1808,7 +1806,7 @@ _cogl_path_bezier2_sub (CoglBezQuad *quad)
|
||||
dif.y = (q->p2.y - mid.y);
|
||||
if (dif.x < 0) dif.x = -dif.x;
|
||||
if (dif.y < 0) dif.y = -dif.y;
|
||||
|
||||
|
||||
/* Cancel if the curve is flat enough */
|
||||
if (dif.x + dif.y <= 1.0 ||
|
||||
qindex == _COGL_MAX_BEZ_RECURSE_DEPTH - 1)
|
||||
@ -1818,10 +1816,10 @@ _cogl_path_bezier2_sub (CoglBezQuad *quad)
|
||||
_cogl_path_add_node (FALSE, q->p3.x, q->p3.y);
|
||||
--qindex; continue;
|
||||
}
|
||||
|
||||
|
||||
/* Left recursion goes on top of stack! */
|
||||
qright = q; qleft = &quads[++qindex];
|
||||
|
||||
|
||||
/* Subdivide into 2 sub-curves */
|
||||
c1.x = ((q->p1.x + q->p2.x) / 2);
|
||||
c1.y = ((q->p1.y + q->p2.y) / 2);
|
||||
@ -1829,12 +1827,12 @@ _cogl_path_bezier2_sub (CoglBezQuad *quad)
|
||||
c3.y = ((q->p2.y + q->p3.y) / 2);
|
||||
c2.x = ((c1.x + c3.x) / 2);
|
||||
c2.y = ((c1.y + c3.y) / 2);
|
||||
|
||||
|
||||
/* Add left recursion onto stack */
|
||||
qleft->p1 = q->p1;
|
||||
qleft->p2 = c1;
|
||||
qleft->p3 = c2;
|
||||
|
||||
|
||||
/* Add right recursion onto stack */
|
||||
qright->p1 = c2;
|
||||
qright->p2 = c3;
|
||||
@ -1861,7 +1859,7 @@ cogl_path_curve2_to (float x_1,
|
||||
|
||||
/* Run subdivision */
|
||||
_cogl_path_bezier2_sub (&quad);
|
||||
|
||||
|
||||
/* Add last point */
|
||||
_cogl_path_add_node (FALSE, quad.p3.x, quad.p3.y);
|
||||
ctx->path_pen = quad.p3;
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,18 +1,14 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By: Matthew Allum <mallum@openedhand.com>
|
||||
* Emmanuele Bassi <ebassi@linux.intel.com>
|
||||
*
|
||||
* Copyright (C) 2007, 2008 OpenedHand
|
||||
* Copyright (C) 2009 Intel Corp.
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -20,7 +16,9 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -26,7 +24,7 @@
|
||||
#ifndef __COGL_UTIL_H
|
||||
#define __COGL_UTIL_H
|
||||
|
||||
int
|
||||
int
|
||||
cogl_util_next_p2 (int a);
|
||||
|
||||
#endif /* __COGL_UTIL_H */
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Cogl.
|
||||
* Cogl
|
||||
*
|
||||
* An OpenGL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
*
|
||||
* Authored By: Robert Bragg <robert@linux.intel.com>
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -18,7 +16,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Robert Bragg <robert@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __COGL_VERTEX_BUFFER_H
|
||||
|
@ -1,13 +1,9 @@
|
||||
/*
|
||||
* Cogl.
|
||||
* Cogl
|
||||
*
|
||||
* An OpenGL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Vertex Buffer API: Handle extensible arrays of vertex attributes
|
||||
*
|
||||
* Copyright (C) 2008, 2009 Intel Corporation.
|
||||
*
|
||||
* Authored by: Robert Bragg <robert@linux.intel.com>
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,7 +16,12 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Robert Bragg <robert@linux.intel.com>
|
||||
*/
|
||||
|
||||
/* XXX: For an overview of the functionality implemented here, please
|
||||
|
@ -1,10 +1,9 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007, 2008 OpenedHand
|
||||
* Copyright (C) 2009 Intel Corp.
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -865,26 +863,26 @@ typedef void
|
||||
|
||||
typedef void
|
||||
(APIENTRYP COGL_PFNGLBINDBUFFERARBPROC)
|
||||
(GLenum target,
|
||||
(GLenum target,
|
||||
GLuint buffer);
|
||||
|
||||
typedef void
|
||||
(APIENTRYP COGL_PFNGLBUFFERDATAARBPROC)
|
||||
(GLenum target,
|
||||
GLsizeiptr size,
|
||||
const GLvoid *data,
|
||||
(GLenum target,
|
||||
GLsizeiptr size,
|
||||
const GLvoid *data,
|
||||
GLenum usage);
|
||||
|
||||
typedef void
|
||||
(APIENTRYP COGL_PFNGLBUFFERSUBDATAARBPROC)
|
||||
(GLenum target,
|
||||
GLintptr offset,
|
||||
(GLenum target,
|
||||
GLintptr offset,
|
||||
GLsizeiptr size,
|
||||
const GLvoid *data);
|
||||
|
||||
typedef void *
|
||||
(APIENTRYP COGL_PFNGLMAPBUFFERARBPROC)
|
||||
(GLenum target,
|
||||
(GLenum target,
|
||||
GLenum access);
|
||||
|
||||
typedef GLboolean
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -71,25 +69,25 @@ cogl_offscreen_new_to_texture (CoglHandle texhandle)
|
||||
GLuint fbo_gl_handle;
|
||||
GLuint gl_stencil_handle;
|
||||
GLenum status;
|
||||
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, COGL_INVALID_HANDLE);
|
||||
|
||||
|
||||
if (!cogl_features_available (COGL_FEATURE_OFFSCREEN))
|
||||
return COGL_INVALID_HANDLE;
|
||||
|
||||
|
||||
/* Make texhandle is a valid texture object */
|
||||
if (!cogl_is_texture (texhandle))
|
||||
return COGL_INVALID_HANDLE;
|
||||
|
||||
|
||||
tex = _cogl_texture_pointer_from_handle (texhandle);
|
||||
|
||||
|
||||
/* The texture must not be sliced */
|
||||
if (tex->slice_gl_handles == NULL)
|
||||
return COGL_INVALID_HANDLE;
|
||||
|
||||
|
||||
if (tex->slice_gl_handles->len != 1)
|
||||
return COGL_INVALID_HANDLE;
|
||||
|
||||
|
||||
/* Pick the single texture slice width, height and GL id */
|
||||
x_span = &g_array_index (tex->slice_x_spans, CoglTexSliceSpan, 0);
|
||||
y_span = &g_array_index (tex->slice_y_spans, CoglTexSliceSpan, 0);
|
||||
@ -111,10 +109,10 @@ cogl_offscreen_new_to_texture (CoglHandle texhandle)
|
||||
GE( glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT,
|
||||
GL_STENCIL_ATTACHMENT_EXT,
|
||||
GL_RENDERBUFFER_EXT, gl_stencil_handle) );
|
||||
|
||||
|
||||
/* Make sure it's complete */
|
||||
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
|
||||
|
||||
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
|
||||
{
|
||||
/* Stencil renderbuffers aren't always supported. Try again
|
||||
@ -125,9 +123,9 @@ cogl_offscreen_new_to_texture (CoglHandle texhandle)
|
||||
0) );
|
||||
GE( glDeleteRenderbuffersEXT (1, &gl_stencil_handle) );
|
||||
gl_stencil_handle = 0;
|
||||
|
||||
|
||||
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
|
||||
|
||||
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
|
||||
{
|
||||
/* Still failing, so give up */
|
||||
@ -136,9 +134,9 @@ cogl_offscreen_new_to_texture (CoglHandle texhandle)
|
||||
return COGL_INVALID_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GE( glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0) );
|
||||
|
||||
|
||||
/* Allocate and init a CoglFbo object (store non-wasted size
|
||||
for subsequent blits and viewport setup) */
|
||||
fbo = (CoglFbo*) g_malloc (sizeof (CoglFbo));
|
||||
@ -155,7 +153,7 @@ cogl_offscreen_new_multisample ()
|
||||
{
|
||||
if (!cogl_features_available (COGL_FEATURE_OFFSCREEN_MULTISAMPLE))
|
||||
return COGL_INVALID_HANDLE;
|
||||
|
||||
|
||||
return COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
@ -186,22 +184,22 @@ cogl_offscreen_blit_region (CoglHandle src_buffer,
|
||||
{
|
||||
CoglFbo *src_fbo;
|
||||
CoglFbo *dst_fbo;
|
||||
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (!cogl_features_available (COGL_FEATURE_OFFSCREEN_BLIT))
|
||||
return;
|
||||
|
||||
|
||||
/* Make sure these are valid fbo handles */
|
||||
if (!cogl_is_offscreen (src_buffer))
|
||||
return;
|
||||
|
||||
|
||||
if (!cogl_is_offscreen (dst_buffer))
|
||||
return;
|
||||
|
||||
|
||||
src_fbo = _cogl_offscreen_pointer_from_handle (src_buffer);
|
||||
dst_fbo = _cogl_offscreen_pointer_from_handle (dst_buffer);
|
||||
|
||||
|
||||
/* Copy (and scale) a region from one to another framebuffer */
|
||||
GE( glBindFramebufferEXT (GL_READ_FRAMEBUFFER_EXT, src_fbo->gl_handle) );
|
||||
GE( glBindFramebufferEXT (GL_DRAW_FRAMEBUFFER_EXT, dst_fbo->gl_handle) );
|
||||
@ -216,22 +214,22 @@ cogl_offscreen_blit (CoglHandle src_buffer,
|
||||
{
|
||||
CoglFbo *src_fbo;
|
||||
CoglFbo *dst_fbo;
|
||||
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (!cogl_features_available (COGL_FEATURE_OFFSCREEN_BLIT))
|
||||
return;
|
||||
|
||||
|
||||
/* Make sure these are valid fbo handles */
|
||||
if (!cogl_is_offscreen (src_buffer))
|
||||
return;
|
||||
|
||||
|
||||
if (!cogl_is_offscreen (dst_buffer))
|
||||
return;
|
||||
|
||||
|
||||
src_fbo = _cogl_offscreen_pointer_from_handle (src_buffer);
|
||||
dst_fbo = _cogl_offscreen_pointer_from_handle (dst_buffer);
|
||||
|
||||
|
||||
/* Copy (and scale) whole image from one to another framebuffer */
|
||||
GE( glBindFramebufferEXT (GL_READ_FRAMEBUFFER_EXT, src_fbo->gl_handle) );
|
||||
GE( glBindFramebufferEXT (GL_DRAW_FRAMEBUFFER_EXT, dst_fbo->gl_handle) );
|
||||
@ -244,17 +242,17 @@ void
|
||||
cogl_draw_buffer (CoglBufferTarget target, CoglHandle offscreen)
|
||||
{
|
||||
CoglFbo *fbo = NULL;
|
||||
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (target == COGL_OFFSCREEN_BUFFER)
|
||||
{
|
||||
/* Make sure it is a valid fbo handle */
|
||||
if (!cogl_is_offscreen (offscreen))
|
||||
return;
|
||||
|
||||
|
||||
fbo = _cogl_offscreen_pointer_from_handle (offscreen);
|
||||
|
||||
|
||||
/* Check current draw buffer target */
|
||||
if (ctx->draw_buffer != COGL_OFFSCREEN_BUFFER)
|
||||
{
|
||||
@ -280,16 +278,16 @@ cogl_draw_buffer (CoglBufferTarget target, CoglHandle offscreen)
|
||||
_cogl_set_current_matrix (COGL_MATRIX_MODELVIEW);
|
||||
_cogl_current_matrix_identity ();
|
||||
}
|
||||
|
||||
|
||||
/* Setup new viewport and matrices */
|
||||
GE( glViewport (0, 0, fbo->width, fbo->height) );
|
||||
_cogl_current_matrix_translate (-1.0f, -1.0f, 0.0f);
|
||||
_cogl_current_matrix_scale (2.0f / fbo->width, 2.0f / fbo->height, 1.0f);
|
||||
|
||||
|
||||
/* Bind offscreen framebuffer object */
|
||||
GE( glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, fbo->gl_handle) );
|
||||
GE( glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE) );
|
||||
|
||||
|
||||
/* Some implementation require a clear before drawing
|
||||
to an fbo. Luckily it is affected by scissor test. */
|
||||
/* FIXME: test where exactly this is needed end whether
|
||||
@ -299,7 +297,7 @@ cogl_draw_buffer (CoglBufferTarget target, CoglHandle offscreen)
|
||||
GE( glEnable (GL_SCISSOR_TEST) );
|
||||
GE( glClear (GL_COLOR_BUFFER_BIT) );
|
||||
GE( glPopAttrib () );
|
||||
|
||||
|
||||
}
|
||||
else if ((target & COGL_WINDOW_BUFFER) ||
|
||||
(target & COGL_MASK_BUFFER))
|
||||
@ -317,11 +315,11 @@ cogl_draw_buffer (CoglBufferTarget target, CoglHandle offscreen)
|
||||
_cogl_set_current_matrix (COGL_MATRIX_MODELVIEW);
|
||||
_cogl_current_matrix_pop ();
|
||||
}
|
||||
|
||||
|
||||
/* Bind window framebuffer object */
|
||||
GE( glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0) );
|
||||
|
||||
|
||||
|
||||
|
||||
if (target == COGL_WINDOW_BUFFER)
|
||||
{
|
||||
/* Draw to RGB channels */
|
||||
@ -338,7 +336,7 @@ cogl_draw_buffer (CoglBufferTarget target, CoglHandle offscreen)
|
||||
GE( glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Store new target */
|
||||
ctx->draw_buffer = target;
|
||||
}
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -96,7 +94,7 @@ cogl_program_attach_shader (CoglHandle program_handle,
|
||||
CoglShader *shader;
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (!cogl_is_program (program_handle) || !cogl_is_shader (shader_handle))
|
||||
return;
|
||||
|
||||
@ -111,7 +109,7 @@ cogl_program_link (CoglHandle handle)
|
||||
{
|
||||
CoglProgram *program;
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (!cogl_is_program (handle))
|
||||
return;
|
||||
|
||||
@ -126,7 +124,7 @@ cogl_program_use (CoglHandle handle)
|
||||
CoglProgram *program;
|
||||
GLhandleARB gl_handle;
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (handle != COGL_INVALID_HANDLE && !cogl_is_program (handle))
|
||||
return;
|
||||
|
||||
@ -147,7 +145,7 @@ cogl_program_get_uniform_location (CoglHandle handle,
|
||||
{
|
||||
CoglProgram *program;
|
||||
_COGL_GET_CONTEXT (ctx, 0);
|
||||
|
||||
|
||||
if (!cogl_is_program (handle))
|
||||
return 0;
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -75,7 +73,7 @@ cogl_shader_source (CoglHandle handle,
|
||||
{
|
||||
CoglShader *shader;
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (!cogl_is_shader (handle))
|
||||
return;
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -21,6 +19,11 @@
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors:
|
||||
* Matthew Allum <mallum@openedhand.com>
|
||||
* Neil Roberts <neil@linux.intel.com>
|
||||
* Robert Bragg <robert@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -356,7 +354,7 @@ cogl_gles2_get_fragment_shader (const CoglGles2WrapperSettings *settings)
|
||||
g_string_append (shader_source, cogl_fixed_fragment_shader_main_declare);
|
||||
|
||||
g_string_append (shader_source, cogl_fixed_fragment_shader_main_start);
|
||||
|
||||
|
||||
/* This pointless extra variable is needed to work around an
|
||||
apparent bug in the PowerVR drivers. Without it the alpha
|
||||
blending seems to stop working */
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -89,7 +87,7 @@ cogl_program_attach_shader (CoglHandle program_handle,
|
||||
CoglProgram *program;
|
||||
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (!cogl_is_program (program_handle) || !cogl_is_shader (shader_handle))
|
||||
return;
|
||||
|
||||
@ -116,7 +114,7 @@ void
|
||||
cogl_program_use (CoglHandle handle)
|
||||
{
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (handle != COGL_INVALID_HANDLE && !cogl_is_program (handle))
|
||||
return;
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -69,7 +67,7 @@ cogl_shader_source (CoglHandle handle,
|
||||
{
|
||||
CoglShader *shader;
|
||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||
|
||||
|
||||
if (!cogl_is_shader (handle))
|
||||
return;
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -44,7 +42,7 @@ cogl_util_next_p2 (int a)
|
||||
{
|
||||
int rval=1;
|
||||
|
||||
while(rval < a)
|
||||
while(rval < a)
|
||||
rval <<= 1;
|
||||
|
||||
return rval;
|
||||
|
@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2007 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -26,7 +24,7 @@
|
||||
#ifndef __COGL_UTIL_H
|
||||
#define __COGL_UTIL_H
|
||||
|
||||
int
|
||||
int
|
||||
cogl_util_next_p2 (int a);
|
||||
|
||||
#endif /* __COGL_UTIL_H */
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009 OpenedHand
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -1,16 +1,36 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Cogl
|
||||
#
|
||||
# An object oriented GL/GLES Abstraction/Utility Layer
|
||||
#
|
||||
# Copyright (C) 2008,2009 Intel Corporation.
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the
|
||||
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
output_copyright ()
|
||||
{
|
||||
cat <<EOF > "$1";
|
||||
/*
|
||||
* Clutter COGL
|
||||
* Cogl
|
||||
*
|
||||
* A basic GL/GLES Abstraction/Utility Layer
|
||||
* An object oriented GL/GLES Abstraction/Utility Layer
|
||||
*
|
||||
* Authored By Matthew Allum <mallum@openedhand.com>
|
||||
*
|
||||
* Copyright (C) 2008 OpenedHand
|
||||
* Copyright (C) 2008,2009 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
Loading…
Reference in New Issue
Block a user