~ubuntu-branches/ubuntu/lucid/mutter/lucid-201002130022

« back to all changes in this revision

Viewing changes to src/compositor/mutter-texture-tower.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2010-01-08 14:40:43 UTC
  • mfrom: (0.1.7 sid) (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100108144043-x04o6jk3bcpsqosy
Tags: 2.28.1~git20091208-1ubuntu1
* Merge with Debian squeeze.
* debian/rules: Replace remaining occurances of "metacity" with "mutter". 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 
2
/*
 
3
 * MutterTextureTower
 
4
 *
 
5
 * Mipmap emulation by creation of scaled down images
 
6
 *
 
7
 * Copyright (C) 2009 Red Hat, Inc.
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU General Public License as
 
11
 * published by the Free Software Foundation; either version 2 of the
 
12
 * License, or (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful, but
 
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
 * General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
22
 * 02111-1307, USA.
 
23
 */
 
24
 
 
25
#ifndef __MUTTER_TEXTURE_TOWER_H__
 
26
#define __MUTTER_TEXTURE_TOWER_H__
 
27
 
 
28
#include <clutter/clutter.h>
 
29
 
 
30
G_BEGIN_DECLS
 
31
 
 
32
/**
 
33
 * SECTION:MutterTextureTower
 
34
 * @short_description: mipmap emulation by creation of scaled down images
 
35
 *
 
36
 * A #MutterTextureTower is used to get good looking scaled down images when
 
37
 * we can't use the GL drivers mipmap support. There are two separate reasons
 
38
 *
 
39
 *  - Some cards (including radeon cards <= r5xx) only support
 
40
 *    TEXTURE_RECTANGLE_ARB and not NPOT textures. Rectangular textures
 
41
 *    are defined not to support mipmapping.
 
42
 *  - Even when NPOT textures are available, the combination of NPOT
 
43
 *    textures, texture_from_pixmap, and mipmapping doesn't typically
 
44
 *    work, since the X server doesn't allocate pixmaps in the right
 
45
 *    layout for mipmapping.
 
46
 *
 
47
 * So, what we do is create the "mipmap" levels ourselves by successive
 
48
 * power-of-two scaledowns, and when rendering pick the single texture
 
49
 * that best matches the scale we are rendering at. (Since we aren't
 
50
 * typically using perspective transforms, we'll frequently have a single
 
51
 * scale for the entire texture.)
 
52
 */
 
53
 
 
54
typedef struct _MutterTextureTower MutterTextureTower;
 
55
 
 
56
MutterTextureTower *mutter_texture_tower_new               (void);
 
57
void                mutter_texture_tower_free              (MutterTextureTower *tower);
 
58
void                mutter_texture_tower_set_base_texture  (MutterTextureTower *tower,
 
59
                                                            CoglHandle          texture);
 
60
void                mutter_texture_tower_update_area       (MutterTextureTower *tower,
 
61
                                                            int                 x,
 
62
                                                            int                 y,
 
63
                                                            int                 width,
 
64
                                                            int                 height);
 
65
CoglHandle          mutter_texture_tower_get_paint_texture (MutterTextureTower *tower);
 
66
 
 
67
G_BEGIN_DECLS
 
68
 
 
69
#endif /* __MUTTER_TEXTURE_TOWER_H__ */