mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 12:32:05 +00:00
af7398788a
Texture allocation is now consistently handled lazily such that the internal format can now be controlled using cogl_texture_set_components() and cogl_texture_set_premultiplied() before allocating the texture with cogl_texture_allocate(). This means that the internal_format arguments to texture constructors are now redundant and since most of the texture constructors now can't ever fail the error arguments are also redundant. This now means we no longer use CoglPixelFormat in the public api for describing the internal format of textures which had been bad solution originally due to how specific CoglPixelFormat is which is missleading when we don't support such explicit control over the internal format. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 99a53c82e9ab0a1e5ee35941bf83dc334b1fbe87) Note: there are numerous API changes for functions currently marked as 'unstable' which we don't think are in use by anyone depending on a stable 1.x api. Compared to the original patch though this avoids changing the cogl_texture_rectangle_new_with_size() api which we know is used by Mutter.
61 lines
2.0 KiB
C
61 lines
2.0 KiB
C
/*
|
|
* 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, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef __COGL_TEXTURE_2D_SLICED_PRIVATE_H
|
|
#define __COGL_TEXTURE_2D_SLICED_PRIVATE_H
|
|
|
|
#include "cogl-bitmap-private.h"
|
|
#include "cogl-pipeline-private.h"
|
|
#include "cogl-texture-private.h"
|
|
#include "cogl-texture-2d-sliced.h"
|
|
|
|
#include <glib.h>
|
|
|
|
struct _CoglTexture2DSliced
|
|
{
|
|
CoglTexture _parent;
|
|
|
|
GArray *slice_x_spans;
|
|
GArray *slice_y_spans;
|
|
GArray *slice_textures;
|
|
int max_waste;
|
|
CoglPixelFormat internal_format;
|
|
};
|
|
|
|
CoglTexture2DSliced *
|
|
_cogl_texture_2d_sliced_new_from_foreign (CoglContext *context,
|
|
unsigned int gl_handle,
|
|
unsigned int gl_target,
|
|
int width,
|
|
int height,
|
|
int x_pot_waste,
|
|
int y_pot_waste,
|
|
CoglPixelFormat format);
|
|
|
|
CoglTexture2DSliced *
|
|
_cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp,
|
|
int max_waste,
|
|
CoglBool can_convert_in_place);
|
|
|
|
#endif /* __COGL_TEXTURE_2D_SLICED_PRIVATE_H */
|