Commit 21bade4a6985ad7f3015d7caf3fa484dfdeec3a1

Authored by unknown
2 parents 30e4c7db df4a4894

Import upstream version 0.9.8.2+bzr3377

Showing 60 changed files with 1215 additions and 287 deletions   Show diff stats
CMakeLists.txt
... ... @@ -79,6 +79,9 @@ set (COMPIZ_I18N_DIR ${CMAKE_SOURCE_DIR}/po)
79 79  
80 80 # Don't allow subdirectories to add schema recompile rule
81 81 set_property (GLOBAL
  82 + PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
  83 + TRUE)
  84 +set_property (GLOBAL
82 85 PROPERTY COMPIZ_INHIBIT_ADD_INSTALL_RECOMPILE_RULE
83 86 TRUE)
84 87  
... ...
VERSION
1   -0.9.8.2
  1 +0.9.8.3
... ...
cmake/CompizCommon.cmake
... ... @@ -443,8 +443,12 @@ macro (compiz_add_plugins_in_folder folder)
443 443 )
444 444  
445 445 foreach (_plugin ${_plugins_in})
446   - get_filename_component (_plugin_dir ${_plugin} PATH)
447   - add_subdirectory (${folder}/${_plugin_dir})
  446 + get_filename_component (_plugin_dir ${_plugin} PATH)
  447 + string (TOUPPER ${_plugin_dir} _plugin_upper)
  448 + if (NOT COMPIZ_DISABLE_PLUGIN_${_plugin_upper})
  449 + add_subdirectory (${folder}/${_plugin_dir})
  450 + set (COMPIZ_ENABLED_PLUGIN_${_plugin_upper} Y CACHE INTERNAL "")
  451 + endif ()
448 452 endforeach ()
449 453 endmacro ()
450 454  
... ...
cmake/CompizGSettings.cmake
... ... @@ -106,37 +106,83 @@ function (compiz_install_gsettings_schema _src _dst)
106 106 USE_GSETTINGS)
107 107 endfunction ()
108 108  
109   -function (add_gsettings_schema_to_recompilation_list _target_name_for_schema)
  109 +function (add_gsettings_local_recompilation_rule _schemas)
110 110  
111   - find_program (GLIB_COMPILE_SCHEMAS glib-compile-schemas)
112   - mark_as_advanced (GLIB_COMPILE_SCHEMAS)
  111 + get_property (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE_SET
  112 + GLOBAL
  113 + PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
  114 + SET)
  115 +
  116 + if (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE_SET)
  117 + get_property (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE
  118 + GLOBAL
  119 + PROPERTY GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE)
  120 + else (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE_SET)
  121 + set (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE FALSE)
  122 + endif (GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE_SET)
113 123  
114 124 get_property (GSETTINGS_LOCAL_COMPILE_TARGET_SET
115 125 GLOBAL
116 126 PROPERTY GSETTINGS_LOCAL_COMPILE_TARGET_SET
117 127 SET)
118 128  
119   - if (NOT GSETTINGS_LOCAL_COMPILE_TARGET_SET AND
120   - GLIB_COMPILE_SCHEMAS)
  129 + if (NOT GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE AND
  130 + NOT GSETTINGS_LOCAL_COMPILE_TARGET_SET)
121 131  
122   - add_custom_command (OUTPUT ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled
123   - COMMAND ${GLIB_COMPILE_SCHEMAS} --targetdir=${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/
124   - ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/
125   - COMMENT "Recompiling GSettings schemas locally"
126   - )
  132 + find_program (GLIB_COMPILE_SCHEMAS glib-compile-schemas)
  133 + mark_as_advanced (GLIB_COMPILE_SCHEMAS)
  134 +
  135 + if (GLIB_COMPILE_SCHEMAS)
  136 +
  137 + set (_compiled_gschemas ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled)
  138 +
  139 + # Invalidate the rule
  140 + if (EXISTS ${_compiled_gschemas})
  141 + execute_process (COMMAND rm ${_compiled_gschemas})
  142 + endif (EXISTS ${_compiled_gschemas})
  143 +
  144 + add_custom_command (OUTPUT ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled
  145 + COMMAND ${GLIB_COMPILE_SCHEMAS} --targetdir=${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/
  146 + ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/
  147 + COMMENT "Recompiling GSettings schemas locally"
  148 + DEPENDS ${${_schemas}}
  149 + )
  150 +
  151 + add_custom_target (compiz_gsettings_compile_local ALL
  152 + DEPENDS ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled)
127 153  
128   - add_custom_target (compiz_gsettings_compile_local ALL
129   - DEPENDS ${CMAKE_BINARY_DIR}/generated/glib-2.0/schemas/gschemas.compiled)
  154 + set_property (GLOBAL
  155 + PROPERTY GSETTINGS_LOCAL_COMPILE_TARGET_SET
  156 + TRUE)
130 157  
131   - set_property (GLOBAL
132   - PROPERTY GSETTINGS_LOCAL_COMPILE_TARGET_SET
133   - TRUE)
  158 + endif (GLIB_COMPILE_SCHEMAS)
134 159  
135   - endif (NOT GSETTINGS_LOCAL_COMPILE_TARGET_SET AND
136   - GLIB_COMPILE_SCHEMAS)
  160 + endif (NOT GSETTINGS_LOCAL_COMPILE_INHIBIT_RULE AND
  161 + NOT GSETTINGS_LOCAL_COMPILE_TARGET_SET)
  162 +
  163 +endfunction ()
  164 +
  165 +function (add_all_gsettings_schemas_to_local_recompilation_rule)
  166 +
  167 + get_property (GSETTINGS_LOCAL_COMPILE_SCHEMAS
  168 + GLOBAL
  169 + PROPERTY GSETTINGS_LOCAL_COMPILE_SCHEMAS)
  170 +
  171 + # Deferencing it appears to just give it the first schema, that's not what
  172 + # we really want, so just pass the reference and double-dereference
  173 + # internally
  174 + add_gsettings_local_recompilation_rule (GSETTINGS_LOCAL_COMPILE_SCHEMAS)
  175 +
  176 +endfunction ()
  177 +
  178 +function (add_gsettings_schema_to_recompilation_list _schema_file_name)
  179 +
  180 + set_property (GLOBAL
  181 + APPEND
  182 + PROPERTY GSETTINGS_LOCAL_COMPILE_SCHEMAS
  183 + "${_schema_file_name}")
137 184  
138   - add_dependencies (compiz_gsettings_compile_local
139   - ${_target_name_for_schema})
  185 + add_all_gsettings_schemas_to_local_recompilation_rule ()
140 186  
141 187 endfunction ()
142 188  
... ...
cmake/CompizPackage.cmake
... ... @@ -67,7 +67,7 @@ function (compiz_print_plugin_stats _folder)
67 67 string (TOUPPER ${_plugin_name} _PLUGIN)
68 68 compiz_format_string (${_plugin_name} 14 _plugin_name)
69 69  
70   - if (COMPIZ_DISABLE_PLUGIN_${_PLUGIN})
  70 + if (NOT COMPIZ_ENABLED_PLUGIN_${_PLUGIN})
71 71 compiz_color_message (" ${_plugin_name}: ${_escape}[1;34mDisabled${_escape}[0m")
72 72 else ()
73 73 if (COMPIZ_${_PLUGIN}_BUILD)
... ...
compizconfig/libcompizconfig/src/main.c
... ... @@ -4879,7 +4879,7 @@ ccsGetUpgradeFilesForProcessing (const char *upgradePath,
4879 4879 struct dirent **nameList = NULL;
4880 4880 unsigned int nFile = scandir (upgradePath, &nameList, upgradeNameFilter, alphasort);
4881 4881  
4882   - if (nFile <= 0)
  4882 + if (!nFile)
4883 4883 return 0;
4884 4884  
4885 4885 *passedNameList = nameList;
... ...
gtk/window-decorator/CMakeLists.txt
... ... @@ -23,6 +23,12 @@ if (USE_GTK)
23 23 ${COMPIZ_LINK_DIRS}
24 24 )
25 25  
  26 + add_library (gtk_window_decorator_metacity_window_decoration_util
  27 + ${CMAKE_CURRENT_SOURCE_DIR}/gwd-metacity-window-decoration-util.c)
  28 +
  29 + add_library (gtk_window_decorator_cairo_window_decoration_util
  30 + ${CMAKE_CURRENT_SOURCE_DIR}/gwd-cairo-window-decoration-util.c)
  31 +
26 32 add_library (gtk_window_decorator_settings_interface STATIC
27 33 ${CMAKE_CURRENT_SOURCE_DIR}/gwd-settings-interface.c)
28 34  
... ... @@ -47,7 +53,9 @@ if (USE_GTK)
47 53 gtk_window_decorator_settings_writable_interface
48 54 gtk_window_decorator_settings
49 55 gtk_window_decorator_settings_storage_interface
50   - gtk_window_decorator_settings_storage_xproperty_interface)
  56 + gtk_window_decorator_settings_storage_xproperty_interface
  57 + gtk_window_decorator_metacity_window_decoration_util
  58 + gtk_window_decorator_cairo_window_decoration_util)
51 59  
52 60 if (USE_GCONF)
53 61 set (gwd_schema ${CMAKE_CURRENT_BINARY_DIR}/gwd.schemas)
... ...
gtk/window-decorator/cairo.c
... ... @@ -24,6 +24,7 @@
24 24 */
25 25  
26 26 #include "gtk-window-decorator.h"
  27 +#include "gwd-cairo-window-decoration-util.h"
27 28  
28 29 void
29 30 rounded_rectangle (cairo_t *cr,
... ... @@ -922,8 +923,9 @@ update_border_extents (decor_frame_t *frame)
922 923 {
923 924 frame = gwd_decor_frame_ref (frame);
924 925  
925   - frame->win_extents = frame->win_extents;
926   - frame->max_win_extents = frame->win_extents;
  926 + gwd_cairo_window_decoration_get_extents (&frame->win_extents,
  927 + &frame->max_win_extents);
  928 +
927 929 frame->titlebar_height = frame->max_titlebar_height =
928 930 (frame->text_height < 17) ? 17 : frame->text_height;
929 931  
... ...
gtk/window-decorator/decorator.c
... ... @@ -1034,17 +1034,8 @@ update_frames_shadows (gpointer key,
1034 1034  
1035 1035 }
1036 1036  
1037   -void
1038   -cairo_get_shadow (decor_frame_t *d, decor_shadow_options_t *opts, gboolean active)
1039   -{
1040   - if (active)
1041   - g_object_get (settings, "active-shadow", &opts, NULL);
1042   - else
1043   - g_object_get (settings, "inactive-shadow", &opts, NULL);
1044   -}
1045   -
1046   -void
1047   -meta_get_shadow (decor_frame_t *frame, decor_shadow_options_t *opts, gboolean active)
  1037 +static void
  1038 +get_shadow_common (decor_frame_t *d, decor_shadow_options_t *opts, gboolean active)
1048 1039 {
1049 1040 decor_shadow_options_t *setting_opts = NULL;
1050 1041  
... ... @@ -1059,6 +1050,18 @@ meta_get_shadow (decor_frame_t *frame, decor_shadow_options_t *opts, gboolean ac
1059 1050 }
1060 1051 }
1061 1052  
  1053 +void
  1054 +cairo_get_shadow (decor_frame_t *frame, decor_shadow_options_t *opts, gboolean active)
  1055 +{
  1056 + get_shadow_common (frame, opts, active);
  1057 +}
  1058 +
  1059 +void
  1060 +meta_get_shadow (decor_frame_t *frame, decor_shadow_options_t *opts, gboolean active)
  1061 +{
  1062 + get_shadow_common (frame, opts, active);
  1063 +}
  1064 +
1062 1065 int
1063 1066 update_shadow (void)
1064 1067 {
... ...
gtk/window-decorator/frames.c
... ... @@ -232,7 +232,6 @@ decor_frame_new (const gchar *type)
232 232  
233 233 gtk_widget_set_size_request (frame->style_window_rgba, 0, 0);
234 234 gtk_window_move (GTK_WINDOW (frame->style_window_rgba), -100, -100);
235   - gtk_widget_show_all (frame->style_window_rgba);
236 235  
237 236 frame->pango_context = gtk_widget_create_pango_context (frame->style_window_rgba);
238 237  
... ... @@ -250,7 +249,6 @@ decor_frame_new (const gchar *type)
250 249  
251 250 gtk_widget_set_size_request (frame->style_window_rgb, 0, 0);
252 251 gtk_window_move (GTK_WINDOW (frame->style_window_rgb), -100, -100);
253   - gtk_widget_show_all (frame->style_window_rgb);
254 252  
255 253 g_signal_connect_data (frame->style_window_rgb, "style-set",
256 254 G_CALLBACK (style_changed),
... ...
gtk/window-decorator/gwd-cairo-window-decoration-util.c 0 → 100644
... ... @@ -0,0 +1,56 @@
  1 +/*
  2 + * Copyright © 2012 Canonical Ltd
  3 + *
  4 + * This program is free software; you can redistribute it and/or modify
  5 + * it under the terms of the GNU General Public License as published by
  6 + * the Free Software Foundation; either version 2 of the License, or
  7 + * (at your option) any later version.
  8 + *
  9 + * This program is distributed in the hope that it will be useful,
  10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 + * GNU General Public License for more details.
  13 + *
  14 + * You should have received a copy of the GNU General Public License
  15 + * along with this program; if not, write to the Free Software Foundation,
  16 + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17 + *
  18 + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
  19 + */
  20 +#include <decoration.h>
  21 +#include "gwd-cairo-window-decoration-util.h"
  22 +
  23 +static const decor_extents_t gwd_cairo_window_decoration_default_win_extents =
  24 +{
  25 + 6, 6, 10, 6
  26 +};
  27 +
  28 +static const decor_extents_t gwd_cairo_window_decoration_default_max_win_extents =
  29 +{
  30 + 6, 6, 4, 6
  31 +};
  32 +
  33 +const decor_extents_t *
  34 +gwd_cairo_window_decoration_get_default_max_win_extents ()
  35 +{
  36 + return &gwd_cairo_window_decoration_default_max_win_extents;
  37 +}
  38 +
  39 +
  40 +const decor_extents_t *
  41 +gwd_cairo_window_decoration_get_default_win_extents ()
  42 +{
  43 + return &gwd_cairo_window_decoration_default_win_extents;
  44 +}
  45 +
  46 +void
  47 +gwd_cairo_window_decoration_get_extents (decor_extents_t *win_extents,
  48 + decor_extents_t *max_win_extents)
  49 +{
  50 + memcpy (win_extents,
  51 + gwd_cairo_window_decoration_get_default_max_win_extents (),
  52 + sizeof (decor_extents_t));
  53 + memcpy (max_win_extents,
  54 + gwd_cairo_window_decoration_get_default_win_extents (),
  55 + sizeof (decor_extents_t));
  56 +}
... ...
gtk/window-decorator/gwd-cairo-window-decoration-util.h 0 → 100644
... ... @@ -0,0 +1,38 @@
  1 +/*
  2 + * Copyright © 2012 Canonical Ltd
  3 + *
  4 + * This program is free software; you can redistribute it and/or modify
  5 + * it under the terms of the GNU General Public License as published by
  6 + * the Free Software Foundation; either version 2 of the License, or
  7 + * (at your option) any later version.
  8 + *
  9 + * This program is distributed in the hope that it will be useful,
  10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 + * GNU General Public License for more details.
  13 + *
  14 + * You should have received a copy of the GNU General Public License
  15 + * along with this program; if not, write to the Free Software Foundation,
  16 + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17 + *
  18 + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
  19 + */
  20 +#ifndef _GWD_CAIRO_WINDOW_DECORATION_UTIL_H
  21 +#define _GWD_CAIRO_WINDOW_DECORATION_UTIL_H
  22 +
  23 +#include <glib.h>
  24 +
  25 +G_BEGIN_DECLS
  26 +
  27 +typedef struct _decor_extents decor_extents_t;
  28 +
  29 +const decor_extents_t * gwd_cairo_window_decoration_get_default_max_win_extents ();
  30 +const decor_extents_t * gwd_cairo_window_decoration_get_default_win_extents ();
  31 +
  32 +void
  33 +gwd_cairo_window_decoration_get_extents (decor_extents_t *win_extents,
  34 + decor_extents_t *max_win_extents);
  35 +
  36 +G_END_DECLS;
  37 +
  38 +#endif
... ...
gtk/window-decorator/gwd-metacity-window-decoration-util.c 0 → 100644
... ... @@ -0,0 +1,45 @@
  1 +/*
  2 + * Copyright © 2012 Canonical Ltd
  3 + *
  4 + * This program is free software; you can redistribute it and/or modify
  5 + * it under the terms of the GNU General Public License as published by
  6 + * the Free Software Foundation; either version 2 of the License, or
  7 + * (at your option) any later version.
  8 + *
  9 + * This program is distributed in the hope that it will be useful,
  10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 + * GNU General Public License for more details.
  13 + *
  14 + * You should have received a copy of the GNU General Public License
  15 + * along with this program; if not, write to the Free Software Foundation,
  16 + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17 + *
  18 + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
  19 + */
  20 +#include <string.h>
  21 +#include <glib.h>
  22 +#include "gwd-metacity-window-decoration-util.h"
  23 +
  24 +gboolean
  25 +gwd_metacity_window_decoration_update_meta_theme (const gchar *theme,
  26 + GWDMetaThemeGetCurrentProc get_current,
  27 + GWDMetaThemeSetProc set_current)
  28 +{
  29 + if (!theme)
  30 + return FALSE;
  31 +
  32 + /* meta_theme_get_current seems to return the last
  33 + * good theme now, so if one was already set this function
  34 + * will be ineffectual, so we need to check if the theme
  35 + * is obviously bad as the user intended to disable metacity
  36 + * themes */
  37 + if (!strlen (theme))
  38 + return FALSE;
  39 +
  40 + (*set_current) (theme, TRUE);
  41 + if (!(*get_current) ())
  42 + return FALSE;
  43 +
  44 + return TRUE;
  45 +}
... ...
gtk/window-decorator/gwd-metacity-window-decoration-util.h 0 → 100644
... ... @@ -0,0 +1,39 @@
  1 +/*
  2 + * Copyright © 2012 Canonical Ltd
  3 + *
  4 + * This program is free software; you can redistribute it and/or modify
  5 + * it under the terms of the GNU General Public License as published by
  6 + * the Free Software Foundation; either version 2 of the License, or
  7 + * (at your option) any later version.
  8 + *
  9 + * This program is distributed in the hope that it will be useful,
  10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 + * GNU General Public License for more details.
  13 + *
  14 + * You should have received a copy of the GNU General Public License
  15 + * along with this program; if not, write to the Free Software Foundation,
  16 + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17 + *
  18 + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
  19 + */
  20 +#ifndef _GWD_METACITY_WINDOW_DECORATION_UTIL_H
  21 +#define _GWD_METACITY_WINDOW_DECORATION_UTIL_H
  22 +
  23 +#include <glib.h>
  24 +
  25 +G_BEGIN_DECLS
  26 +
  27 +typedef struct _MetaTheme MetaTheme;
  28 +typedef MetaTheme * (*GWDMetaThemeGetCurrentProc) ();
  29 +typedef void (*GWDMetaThemeSetProc) (const gchar *theme,
  30 + gboolean force_update);
  31 +
  32 +gboolean
  33 +gwd_metacity_window_decoration_update_meta_theme (const gchar *theme,
  34 + GWDMetaThemeGetCurrentProc get_current,
  35 + GWDMetaThemeSetProc set_current);
  36 +
  37 +G_END_DECLS;
  38 +
  39 +#endif
... ...
gtk/window-decorator/gwd-settings-notified.c
... ... @@ -21,6 +21,7 @@
21 21  
22 22 #include "gwd-settings-notified-interface.h"
23 23 #include "gwd-settings-notified.h"
  24 +#include "gwd-metacity-window-decoration-util.h"
24 25  
25 26 #include "gtk-window-decorator.h"
26 27  
... ... @@ -119,22 +120,9 @@ gwd_settings_notified_impl_update_metacity_theme (GWDSettingsNotified *notified)
119 120 const gchar *meta_theme = NULL;
120 121 g_object_get (settings, "metacity-theme", &meta_theme, NULL);
121 122  
122   - if (meta_theme)
123   - {
124   - const gchar *theme = meta_theme;
125   -
126   - if (theme)
127   - {
128   - meta_theme_set_current (theme, TRUE);
129   - if (!meta_theme_get_current ())
130   - {
131   - g_warning ("specified a theme that does not exist! falling back to cairo decoration\n");
132   - meta_theme = NULL;
133   - }
134   - }
135   - }
136   -
137   - if (meta_theme)
  123 + if (gwd_metacity_window_decoration_update_meta_theme (meta_theme,
  124 + meta_theme_get_current,
  125 + meta_theme_set_current))
138 126 {
139 127 theme_draw_window_decoration = meta_draw_window_decoration;
140 128 theme_calc_decoration_size = meta_calc_decoration_size;
... ... @@ -146,6 +134,7 @@ gwd_settings_notified_impl_update_metacity_theme (GWDSettingsNotified *notified)
146 134 }
147 135 else
148 136 {
  137 + g_log ("gtk-window-decorator", G_LOG_LEVEL_INFO, "using cairo decoration");
149 138 theme_draw_window_decoration = draw_window_decoration;
150 139 theme_calc_decoration_size = calc_decoration_size;
151 140 theme_update_border_extents = update_border_extents;
... ... @@ -172,6 +161,7 @@ gwd_settings_notified_impl_update_metacity_theme (GWDSettingsNotified *notified)
172 161 static gboolean
173 162 gwd_settings_notified_impl_update_metacity_button_layout (GWDSettingsNotified *notified)
174 163 {
  164 +#ifdef USE_METACITY
175 165 const gchar *button_layout;
176 166 g_object_get (settings, "metacity-button-layout", &button_layout, NULL);
177 167  
... ... @@ -190,6 +180,7 @@ gwd_settings_notified_impl_update_metacity_button_layout (GWDSettingsNotified *n
190 180 return TRUE;
191 181 }
192 182  
  183 +#endif
193 184 return FALSE;
194 185 }
195 186  
... ...
gtk/window-decorator/gwd-settings-storage-gsettings.c
... ... @@ -125,7 +125,7 @@ gwd_settings_storage_gsettings_update_attach_modal_dialogs (GWDSettingsStorage *
125 125 GWDSettingsStorageGSettings *storage = GWD_SETTINGS_STORAGE_GSETTINGS (settings);
126 126 GWDSettingsStorageGSettingsPrivate *priv = GET_PRIVATE (storage);
127 127  
128   - if (!priv->gwd)
  128 + if (!priv->mutter)
129 129 return FALSE;
130 130  
131 131 return gwd_settings_writable_attach_modal_dialogs_changed (priv->writable,
... ...
gtk/window-decorator/gwd-settings.c
... ... @@ -357,10 +357,10 @@ gwd_settings_metacity_theme_changed (GWDSettingsWritable *settings,
357 357  
358 358 static gboolean
359 359 gwd_settings_opacity_changed (GWDSettingsWritable *settings,
360   - gdouble inactive_opacity,
361 360 gdouble active_opacity,
362   - gboolean inactive_shade_opacity,
363   - gboolean active_shade_opacity)
  361 + gdouble inactive_opacity,
  362 + gboolean active_shade_opacity,
  363 + gboolean inactive_shade_opacity)
364 364 {
365 365 GWDSettingsImpl *settings_impl = GWD_SETTINGS_IMPL (settings);
366 366 GWDSettingsImplPrivate *priv = GET_PRIVATE (settings_impl);
... ...
gtk/window-decorator/tests/CMakeLists.txt
... ... @@ -111,4 +111,34 @@ if (COMPIZ_TEST_GTK_WINDOW_DECORATOR_FOUND)
111 111 COVERAGE
112 112 ${COMPIZ_TEST_GWD_SETTINGS_COVERAGE_TARGETS})
113 113  
  114 + add_executable (compiz_test_gwd_cairo_decorations
  115 + ${CMAKE_CURRENT_SOURCE_DIR}/test_gwd_cairo_decorations.cpp)
  116 +
  117 + target_link_libraries (compiz_test_gwd_cairo_decorations
  118 + gtk_window_decorator_cairo_window_decoration_util
  119 + ${COMPIZ_TEST_GTK_WINDOW_DECORATOR_LIBRARIES}
  120 + ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
  121 + ${GTEST_BOTH_LIBRARIES}
  122 + ${GMOCK_LIBRARY}
  123 + ${GMOCK_MAIN_LIBRARY}
  124 + decoration)
  125 +
  126 + compiz_discover_tests (compiz_test_gwd_cairo_decorations COVERAGE
  127 + gtk_window_decorator_cairo_window_decoration_util)
  128 +
  129 + add_executable (compiz_test_gwd_metacity_decorations
  130 + ${CMAKE_CURRENT_SOURCE_DIR}/test_gwd_metacity_decorations.cpp)
  131 +
  132 + target_link_libraries (compiz_test_gwd_metacity_decorations
  133 + gtk_window_decorator_metacity_window_decoration_util
  134 + ${COMPIZ_TEST_GTK_WINDOW_DECORATOR_LIBRARIES}
  135 + ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
  136 + ${GTEST_BOTH_LIBRARIES}
  137 + ${GMOCK_LIBRARY}
  138 + ${GMOCK_MAIN_LIBRARY}
  139 + decoration)
  140 +
  141 + compiz_discover_tests (compiz_test_gwd_metacity_decorations COVERAGE
  142 + gtk_window_decorator_metacity_window_decoration_util)
  143 +
114 144 endif (COMPIZ_TEST_GTK_WINDOW_DECORATOR_FOUND)
... ...
gtk/window-decorator/tests/test_gwd_cairo_decorations.cpp 0 → 100644
... ... @@ -0,0 +1,52 @@
  1 +/*
  2 + * Copyright © 2010 Canonical Ltd
  3 + *
  4 + * This program is free software; you can redistribute it and/or modify
  5 + * it under the terms of the GNU General Public License as published by
  6 + * the Free Software Foundation; either version 2 of the License, or
  7 + * (at your option) any later version.
  8 + *
  9 + * This program is distributed in the hope that it will be useful,
  10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 + * GNU General Public License for more details.
  13 + *
  14 + * You should have received a copy of the GNU General Public License
  15 + * along with this program; if not, write to the Free Software Foundation,
  16 + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17 + *
  18 + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
  19 + */
  20 +
  21 +#include <gtest/gtest.h>
  22 +#include <decoration.h>
  23 +
  24 +#include "gwd-cairo-window-decoration-util.h"
  25 +
  26 +bool
  27 +operator== (const decor_extents_t &rhs,
  28 + const decor_extents_t &lhs)
  29 +{
  30 + return decor_extents_cmp (&rhs, &lhs);
  31 +}
  32 +
  33 +class GWDCairoDecorationsTest :
  34 + public ::testing::Test
  35 +{
  36 +};
  37 +
  38 +namespace
  39 +{
  40 + const decor_extents_t *defaultWinExtents = gwd_cairo_window_decoration_get_default_win_extents ();
  41 + const decor_extents_t *defaultMaxWinExtents = gwd_cairo_window_decoration_get_default_max_win_extents ();
  42 +}
  43 +
  44 +TEST (GWDCairoDecorationsTest, TestGetCairoDecorationExtents)
  45 +{
  46 + decor_extents_t winExtents, maxWinExtents;
  47 +
  48 + gwd_cairo_window_decoration_get_extents (&winExtents, &maxWinExtents);
  49 +
  50 + EXPECT_EQ (winExtents, *defaultWinExtents);
  51 + EXPECT_EQ (maxWinExtents, *defaultMaxWinExtents);
  52 +}
... ...
gtk/window-decorator/tests/test_gwd_metacity_decorations.cpp 0 → 100644
... ... @@ -0,0 +1,82 @@
  1 +/*
  2 + * Copyright © 2010 Canonical Ltd
  3 + *
  4 + * This program is free software; you can redistribute it and/or modify
  5 + * it under the terms of the GNU General Public License as published by
  6 + * the Free Software Foundation; either version 2 of the License, or
  7 + * (at your option) any later version.
  8 + *
  9 + * This program is distributed in the hope that it will be useful,
  10 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12 + * GNU General Public License for more details.
  13 + *
  14 + * You should have received a copy of the GNU General Public License
  15 + * along with this program; if not, write to the Free Software Foundation,
  16 + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17 + *
  18 + * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
  19 + */
  20 +
  21 +#include <string>
  22 +#include <gtest/gtest.h>
  23 +#include <gmock/gmock.h>
  24 +#include "gwd-metacity-window-decoration-util.h"
  25 +
  26 +class GWDMetacityDecorationUtilTest :
  27 + public ::testing::Test
  28 +{
  29 +};
  30 +
  31 +MATCHER(IsTrue, "Is TRUE") { if (arg) return true; else return false; }
  32 +MATCHER(IsFalse, "Is FALSE") { if (!arg) return true; else return false; }
  33 +
  34 +namespace
  35 +{
  36 + MetaTheme * get_current_returns_null ()
  37 + {
  38 + return NULL;
  39 + }
  40 +
  41 + MetaTheme * get_current_returns_nonnull ()
  42 + {
  43 + return (MetaTheme *) 1;
  44 + }
  45 +
  46 + void set_current_seam (const gchar *theme,
  47 + gboolean force)
  48 + {
  49 + }
  50 +
  51 + const std::string emptyTheme ("");
  52 + const std::string realTheme ("Adwaita");
  53 + const std::string badTheme ("Clearlooks");
  54 +}
  55 +
  56 +TEST (GWDMetacityDecorationUtilTest, TestNULLDecorationRevertsToCairo)
  57 +{
  58 + EXPECT_THAT (gwd_metacity_window_decoration_update_meta_theme (NULL,
  59 + get_current_returns_nonnull,
  60 + set_current_seam), IsFalse ());
  61 +}
  62 +
  63 +TEST (GWDMetacityDecorationUtilTest, TestEmptyStringDecorationRevertsToCairo)
  64 +{
  65 + EXPECT_THAT (gwd_metacity_window_decoration_update_meta_theme (emptyTheme.c_str (),
  66 + get_current_returns_nonnull,
  67 + set_current_seam), IsFalse ());
  68 +}
  69 +
  70 +TEST (GWDMetacityDecorationUtilTest, TestBadThemeStringDecorationRevertsToCairo)
  71 +{
  72 + EXPECT_THAT (gwd_metacity_window_decoration_update_meta_theme (badTheme.c_str (),
  73 + get_current_returns_null,
  74 + set_current_seam), IsFalse ());
  75 +}
  76 +
  77 +TEST (GWDMetacityDecorationUtilTest, TestGoodThemeStringDecorationUsesMetacity)
  78 +{
  79 + EXPECT_THAT (gwd_metacity_window_decoration_update_meta_theme (realTheme.c_str (),
  80 + get_current_returns_nonnull,
  81 + set_current_seam), IsTrue ());
  82 +}
... ...
gtk/window-decorator/tests/test_gwd_settings.cpp
... ... @@ -922,10 +922,10 @@ TEST_F(GWDSettingsTest, TestMetacityOpacityChanged)
922 922 {
923 923 EXPECT_CALL (*mGMockNotified, updateDecorations ());
924 924 EXPECT_THAT (gwd_settings_writable_opacity_changed (GWD_SETTINGS_WRITABLE_INTERFACE (mSettings.get ()),
925   - testing_values::INACTIVE_OPACITY_VALUE,
926 925 testing_values::ACTIVE_OPACITY_VALUE,
927   - testing_values::INACTIVE_SHADE_OPACITY_VALUE,
928   - testing_values::ACTIVE_SHADE_OPACITY_VALUE), GBooleanTrue ());
  926 + testing_values::INACTIVE_OPACITY_VALUE,
  927 + testing_values::ACTIVE_SHADE_OPACITY_VALUE,
  928 + testing_values::INACTIVE_SHADE_OPACITY_VALUE), GBooleanTrue ());
929 929  
930 930 AutoUnsetGValue metacityInactiveOpacityValue (G_TYPE_DOUBLE);
931 931 AutoUnsetGValue metacityActiveOpacityValue (G_TYPE_DOUBLE);
... ... @@ -963,10 +963,10 @@ TEST_F(GWDSettingsTest, TestMetacityOpacityChanged)
963 963 TEST_F(GWDSettingsTest, TestMetacityOpacityChangedIsDefault)
964 964 {
965 965 EXPECT_THAT (gwd_settings_writable_opacity_changed (GWD_SETTINGS_WRITABLE_INTERFACE (mSettings.get ()),
966   - METACITY_INACTIVE_OPACITY_DEFAULT,
967 966 METACITY_ACTIVE_OPACITY_DEFAULT,
968   - METACITY_INACTIVE_SHADE_OPACITY_DEFAULT,
969   - METACITY_ACTIVE_SHADE_OPACITY_DEFAULT), GBooleanFalse ());
  967 + METACITY_INACTIVE_OPACITY_DEFAULT,
  968 + METACITY_ACTIVE_SHADE_OPACITY_DEFAULT,
  969 + METACITY_INACTIVE_SHADE_OPACITY_DEFAULT), GBooleanFalse ());
970 970 }
971 971  
972 972 TEST_F(GWDSettingsTest, TestButtonLayoutChanged)
... ...
include/decoration.h
... ... @@ -511,6 +511,10 @@ decor_post_generate_request (Display *xdisplay,
511 511 unsigned int frame_actions);
512 512  
513 513 int
  514 +decor_extents_cmp (const decor_extents_t *a,
  515 + const decor_extents_t *b);
  516 +
  517 +int
514 518 decor_shadow_options_cmp (const decor_shadow_options_t *a,
515 519 const decor_shadow_options_t *b);
516 520  
... ...
libdecoration/decoration.c
... ... @@ -413,7 +413,7 @@ decor_quad_cmp (const decor_quad_t *a, const decor_quad_t *b)
413 413 );
414 414 }
415 415  
416   -static int
  416 +int
417 417 decor_extents_cmp (const decor_extents_t *a, const decor_extents_t *b)
418 418 {
419 419 /* Use binary | to avoid branch prediction slow-downs */
... ...
plugins/bench/bench.xml.in
... ... @@ -50,14 +50,14 @@
50 50 <option name="position_x" type="int">
51 51 <_short>X position</_short>
52 52 <_long>X Position of benchmark window</_long>
53   - <default>0</default>
  53 + <default>100</default>
54 54 <min>0</min>
55 55 <max>4096</max>
56 56 </option>
57 57 <option name="position_y" type="int">
58 58 <_short>Y position</_short>
59 59 <_long>Y Position of benchmark window</_long>
60   - <default>0</default>
  60 + <default>50</default>
61 61 <min>0</min>
62 62 <max>4096</max>
63 63 </option>
... ...
plugins/copytex/src/copytex.cpp
... ... @@ -37,10 +37,11 @@ static GLTexture::Matrix _identity_matrix = {
37 37 };
38 38  
39 39 GLTexture::List
40   -CopyPixmap::bindPixmapToTexture (Pixmap pixmap,
41   - int width,
42   - int height,
43   - int depth)
  40 +CopyPixmap::bindPixmapToTexture (Pixmap pixmap,
  41 + int width,
  42 + int height,
  43 + int depth,
  44 + compiz::opengl::PixmapSource source)
44 45 {
45 46 if (depth != 32 && depth != 24)
46 47 return GLTexture::List ();
... ...
plugins/copytex/src/copytex.h
... ... @@ -52,10 +52,11 @@ class CopyPixmap {
52 52  
53 53 ~CopyPixmap ();
54 54  
55   - static GLTexture::List bindPixmapToTexture (Pixmap pixmap,
56   - int width,
57   - int height,
58   - int depth);
  55 + static GLTexture::List bindPixmapToTexture (Pixmap pixmap,
  56 + int width,
  57 + int height,
  58 + int depth,
  59 + compiz::opengl::PixmapSource source);
59 60  
60 61 public:
61 62 Textures textures;
... ...
plugins/decor/src/decor.cpp
... ... @@ -159,6 +159,8 @@ DecorWindow::glDraw (const GLMatrix &amp;transform,
159 159 {
160 160 bool status;
161 161  
  162 + status = gWindow->glDraw (transform, attrib, region, mask);
  163 +
162 164 /* Don't render dock decorations (shadows) on just any old window */
163 165 if (!(window->type () & CompWindowTypeDockMask))
164 166 {
... ... @@ -198,8 +200,6 @@ DecorWindow::glDraw (const GLMatrix &amp;transform,
198 200 }
199 201 }
200 202  
201   - status = gWindow->glDraw (transform, attrib, region, mask);
202   -
203 203 return status;
204 204 }
205 205  
... ... @@ -337,7 +337,9 @@ DecorTexture::DecorTexture (DecorPixmapInterface::Ptr pixmap) :
337 337 }
338 338  
339 339 bindFailed = false;
340   - textures = GLTexture::bindPixmapToTexture (pixmap->getPixmap (), width, height, depth);
  340 + textures = GLTexture::bindPixmapToTexture (pixmap->getPixmap (),
  341 + width, height, depth,
  342 + compiz::opengl::ExternallyManaged);
341 343 if (textures.size () != 1)
342 344 {
343 345 bindFailed = true;
... ...
plugins/opacify/src/opacify.cpp
... ... @@ -414,7 +414,7 @@ OpacifyScreen::OpacifyScreen (CompScreen *screen) :
414 414 optionSetTimeoutNotify (boost::bind (&OpacifyScreen::optionChanged,
415 415 this, _1, _2));
416 416  
417   - screen->handleEventSetEnabled (this, optionGetInitToggle ());
  417 + setFunctions (optionGetInitToggle ());
418 418 }
419 419  
420 420 bool
... ...
plugins/opengl/CMakeLists.txt
... ... @@ -5,10 +5,14 @@ include (CompizPlugin)
5 5 set (INTERNAL_LIBRARIES
6 6 compiz_opengl_double_buffer
7 7 compiz_opengl_fsregion
  8 + compiz_opengl_glx_tfp_bind
8 9 )
9 10  
10 11 add_subdirectory (src/doublebuffer)
11 12 add_subdirectory (src/fsregion)
  13 +add_subdirectory (src/glxtfpbind)
  14 +
  15 +include_directories (src/glxtfpbind/include)
12 16  
13 17 if (USE_GLES)
14 18 compiz_plugin(opengl PLUGINDEPS composite CFLAGSADD "-DUSE_GLES -std=c++0x" LIBRARIES ${OPENGLES2_LIBRARIES} ${INTERNAL_LIBRARIES} dl INCDIRS ${OPENGLES2_INCLUDE_DIR})
... ...
plugins/opengl/include/opengl/doublebuffer.h
... ... @@ -19,11 +19,13 @@ class DoubleBuffer
19 19 virtual void blit (const CompRegion &region) const = 0;
20 20 virtual bool fallbackBlitAvailable () const = 0;
21 21 virtual void fallbackBlit (const CompRegion &region) const = 0;
  22 + virtual void copyFrontToBack () const = 0;
22 23  
23 24 typedef enum
24 25 {
25 26 VSYNC,
26   - PERSISTENT_BACK_BUFFER,
  27 + HAVE_PERSISTENT_BACK_BUFFER,
  28 + NEED_PERSISTENT_BACK_BUFFER,
27 29 _NSETTINGS
28 30 } Setting;
29 31  
... ...
plugins/opengl/include/opengl/opengl.h
... ... @@ -50,7 +50,7 @@
50 50 #include <opengl/programcache.h>
51 51 #include <opengl/shadercache.h>
52 52  
53   -#define COMPIZ_OPENGL_ABI 5
  53 +#define COMPIZ_OPENGL_ABI 6
54 54  
55 55 /*
56 56 * Some plugins check for #ifdef USE_MODERN_COMPIZ_GL. Support it for now, but
... ...
plugins/opengl/include/opengl/pixmapsource.h 0 → 100644
... ... @@ -0,0 +1,40 @@
  1 +/*
  2 + *
  3 + * Copyright (c) 2012 Canonical Ltd.
  4 + * Authors: Sam Spilsbury <sam.spilsbury@canonical.com>
  5 + *
  6 + * Permission is hereby granted, free of charge, to any person obtaining a
  7 + * copy of this software and associated documentation files (the "Software"),
  8 + * to deal in the Software without restriction, including without limitation
  9 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10 + * and/or sell copies of the Software, and to permit persons to whom the
  11 + * Software is furnished to do so, subject to the following conditions:
  12 + *
  13 + * The above copyright notice and this permission notice shall be included in
  14 + * all copies or substantial portions of the Software.
  15 + *
  16 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  21 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  22 + * DEALINGS IN THE SOFTWARE.
  23 + */
  24 +
  25 +#ifndef _COMPIZ_OPENGL_PIXMAP_SOURCE_H
  26 +#define _COMPIZ_OPENGL_PIXMAP_SOURCE_H
  27 +
  28 +namespace compiz
  29 +{
  30 + namespace opengl
  31 + {
  32 + typedef enum _PixmapSource
  33 + {
  34 + InternallyManaged = 0,
  35 + ExternallyManaged = 1
  36 + } PixmapSource;
  37 + }
  38 +}
  39 +
  40 +#endif
... ...
plugins/opengl/include/opengl/texture.h
... ... @@ -43,6 +43,8 @@
43 43  
44 44 #include <vector>
45 45  
  46 +#include <opengl/pixmapsource.h>
  47 +
46 48  
47 49 #define POWER_OF_TWO(v) ((v & (v - 1)) == 0)
48 50  
... ... @@ -104,7 +106,7 @@ class GLTexture : public CompRect {
104 106 void clear ();
105 107 };
106 108  
107   - typedef boost::function<List (Pixmap, int, int, int)> BindPixmapProc;
  109 + typedef boost::function<List (Pixmap, int, int, int, compiz::opengl::PixmapSource)> BindPixmapProc;
108 110 typedef unsigned int BindPixmapHandle;
109 111  
110 112 public:
... ... @@ -181,11 +183,14 @@ class GLTexture : public CompRect {
181 183 * @param width Specifies the width of the texture
182 184 * @param height Specifies the height of the texture
183 185 * @param depth Specifies the color depth of the texture
  186 + * @param source Whether the pixmap lifecycle is managed externall
184 187 */
185   - static List bindPixmapToTexture (Pixmap pixmap,
186   - int width,
187   - int height,
188   - int depth);
  188 + static List bindPixmapToTexture (Pixmap pixmap,
  189 + int width,
  190 + int height,
  191 + int depth,
  192 + compiz::opengl::PixmapSource source
  193 + = compiz::opengl::InternallyManaged);
189 194  
190 195 /**
191 196 * Returns a GLTexture::List with the contents of of
... ...
plugins/opengl/src/doublebuffer/src/double-buffer.cpp
... ... @@ -41,7 +41,8 @@ namespace opengl
41 41 DoubleBuffer::DoubleBuffer ()
42 42 {
43 43 setting[VSYNC] = true;
44   - setting[PERSISTENT_BACK_BUFFER] = false;
  44 + setting[HAVE_PERSISTENT_BACK_BUFFER] = false;
  45 + setting[NEED_PERSISTENT_BACK_BUFFER] = false;
45 46 }
46 47  
47 48 DoubleBuffer::~DoubleBuffer ()
... ... @@ -59,7 +60,14 @@ DoubleBuffer::render (const CompRegion &amp;region,
59 60 bool fullscreen)
60 61 {
61 62 if (fullscreen)
  63 + {
62 64 swap ();
  65 + if (setting[NEED_PERSISTENT_BACK_BUFFER] &&
  66 + !setting[HAVE_PERSISTENT_BACK_BUFFER])
  67 + {
  68 + copyFrontToBack ();
  69 + }
  70 + }
63 71 else if (blitAvailable ())
64 72 blit (region);
65 73 else if (fallbackBlitAvailable ())
... ...
plugins/opengl/src/doublebuffer/tests/test-opengl-double-buffer.cpp
... ... @@ -18,6 +18,7 @@ class MockDoubleBuffer :
18 18 MOCK_CONST_METHOD1 (blit, void (const CompRegion &));
19 19 MOCK_CONST_METHOD0 (fallbackBlitAvailable, bool ());
20 20 MOCK_CONST_METHOD1 (fallbackBlit, void (const CompRegion &));
  21 + MOCK_CONST_METHOD0 (copyFrontToBack, void ());
21 22 };
22 23  
23 24 class DoubleBufferTest :
... ... @@ -38,6 +39,7 @@ class CompizOpenGLDoubleBufferDeathTest :
38 39 TEST_F(DoubleBufferTest, TestPaintedFullAlwaysSwaps)
39 40 {
40 41 EXPECT_CALL (db, swap ());
  42 + EXPECT_CALL (db, copyFrontToBack ()).Times (0);
41 43  
42 44 db.render (blitRegion, true);
43 45 }
... ... @@ -46,6 +48,31 @@ TEST_F(DoubleBufferTest, TestNoPaintedFullscreenOrFBOAlwaysBlitsSubBuffer)
46 48 {
47 49 EXPECT_CALL (db, blitAvailable ()).WillOnce (Return (true));
48 50 EXPECT_CALL (db, blit (_));
  51 + EXPECT_CALL (db, copyFrontToBack ()).Times (0);
  52 +
  53 + db.render (blitRegion, false);
  54 +}
  55 +
  56 +TEST_F(DoubleBufferTest, SwapWithoutFBO)
  57 +{
  58 + db.set (DoubleBuffer::HAVE_PERSISTENT_BACK_BUFFER, false);
  59 + db.set (DoubleBuffer::NEED_PERSISTENT_BACK_BUFFER, true);
  60 +
  61 + EXPECT_CALL (db, swap ());
  62 + EXPECT_CALL (db, copyFrontToBack ()).Times (1);
  63 +
  64 + db.render (blitRegion, true);
  65 +}
  66 +
  67 +TEST_F(DoubleBufferTest, BlitWithoutFBO)
  68 +{
  69 + db.set (DoubleBuffer::HAVE_PERSISTENT_BACK_BUFFER, false);
  70 + db.set (DoubleBuffer::NEED_PERSISTENT_BACK_BUFFER, false);
  71 +
  72 + EXPECT_CALL (db, blitAvailable ()).WillRepeatedly (Return (true));
  73 + EXPECT_CALL (db, blit (_));