[Spice-devel] [PATCH 7/8] s/USE_OGL/USE_OPENGL

Christophe Fergeau cfergeau at redhat.com
Thu Apr 21 05:00:21 PDT 2011


This is more explicit about what it does, and not much longer
---
 client/application.cpp           |    6 ++--
 client/application.h             |    2 +-
 client/common.h                  |    2 +-
 client/display_channel.cpp       |   40 +++++++++++++++++++-------------------
 client/display_channel.h         |   12 +++++-----
 client/red_client.cpp            |    2 +-
 client/red_window.h              |    2 +-
 client/screen.cpp                |    6 ++--
 client/screen.h                  |    6 ++--
 client/windows/red_pixmap_sw.cpp |    4 +-
 client/windows/red_window.cpp    |    2 +-
 client/x11/pixels_source_p.h     |   20 +++++++++---------
 client/x11/platform.cpp          |   24 +++++++++++-----------
 client/x11/red_drawable.cpp      |   28 +++++++++++++-------------
 client/x11/red_window.cpp        |   24 +++++++++++-----------
 client/x11/red_window_p.h        |   16 +++++++-------
 client/x11/x_platform.h          |    4 +-
 configure.ac                     |    2 +-
 server/red_dispatcher.c          |   10 ++++----
 server/red_worker.c              |    8 +++---
 20 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/client/application.cpp b/client/application.cpp
index 1f3ad24..bc6a6ee 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -35,7 +35,7 @@
 #endif
 #include "platform.h"
 #include "red_sw_canvas.h"
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "red_gl_canvas.h"
 #endif
 #include "quic.h"
@@ -2051,7 +2051,7 @@ bool Application::set_canvas_option(CmdLineParser& parser, char *val, const char
 #ifdef WIN32
     canvas_types["gdi"] = CANVAS_OPTION_GDI;
 #endif
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     canvas_types["gl_fbo"] = CANVAS_OPTION_OGL_FBO;
     canvas_types["gl_pbuff"] = CANVAS_OPTION_OGL_PBUFF;
 #endif
@@ -2548,7 +2548,7 @@ void Application::init_globals()
     SSL_load_error_strings();
 
     sw_canvas_init();
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     gl_canvas_init();
 #endif
     quic_init();
diff --git a/client/application.h b/client/application.h
index 4133dfe..a08da13 100644
--- a/client/application.h
+++ b/client/application.h
@@ -112,7 +112,7 @@ enum CanvasOption {
 #ifdef WIN32
     CANVAS_OPTION_GDI,
 #endif
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     CANVAS_OPTION_OGL_FBO,
     CANVAS_OPTION_OGL_PBUFF,
 #endif
diff --git a/client/common.h b/client/common.h
index 80911d2..30fbf79 100644
--- a/client/common.h
+++ b/client/common.h
@@ -65,7 +65,7 @@
 #else
 #include <unistd.h>
 #include <X11/X.h>
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include <GL/glx.h>
 #endif
 #endif
diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index 16a014c..dbe7d0b 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -22,7 +22,7 @@
 #include "common.h"
 #include "canvas.h"
 #include "red_pixmap.h"
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "red_pixmap_gl.h"
 #endif
 #include "debug.h"
@@ -31,7 +31,7 @@
 #include "display_channel.h"
 #include "application.h"
 #include "screen.h"
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "red_gl_canvas.h"
 #endif
 #include "red_sw_canvas.h"
@@ -485,7 +485,7 @@ void StreamsTrigger::on_event()
     _channel.on_streams_trigger();
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 
 GLInterruptRecreate::GLInterruptRecreate(DisplayChannel& channel)
     : _channel (channel)
@@ -604,7 +604,7 @@ DisplayChannel::DisplayChannel(RedClient& client, uint32_t id,
     , _inputs_channel (NULL)
     , _active_streams (NULL)
     , _streams_trigger (*this)
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     , _gl_interrupt_recreate (*this)
 #endif
     , _interrupt_update (*this)
@@ -641,7 +641,7 @@ DisplayChannel::DisplayChannel(RedClient& client, uint32_t id,
     handler->set_handler(SPICE_MSG_DISPLAY_SURFACE_DESTROY, &DisplayChannel::handle_surface_destroy);
 
     get_process_loop().add_trigger(_streams_trigger);
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     get_process_loop().add_trigger(_gl_interrupt_recreate);
 #endif
     get_process_loop().add_trigger(_interrupt_update);
@@ -725,7 +725,7 @@ void DisplayChannel::copy_pixels(const QRegion& dest_region,
     canvas->copy_pixels(dest_region, NULL, &dest_pixmap);
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 void DisplayChannel::recreate_ogl_context_interrupt()
 {
     Canvas* canvas;
@@ -883,7 +883,7 @@ void DisplayChannel::set_capture_mode(bool on)
 
 void DisplayChannel::update_interrupt()
 {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     Canvas *canvas;
 #endif
 
@@ -891,7 +891,7 @@ void DisplayChannel::update_interrupt()
         return;
     }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     canvas = surfaces_mngr.get_canvas(0);
     if (canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
         ((GCanvas *)(canvas))->pre_gl_copy();
@@ -900,14 +900,14 @@ void DisplayChannel::update_interrupt()
 
     screen()->update();
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     if (canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
         ((GCanvas *)(canvas))->post_gl_copy();
     }
 #endif
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 
 void DisplayChannel::pre_migrate()
 {
@@ -915,7 +915,7 @@ void DisplayChannel::pre_migrate()
 
 void DisplayChannel::post_migrate()
 {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     if (surfaces_mngr.get_canvas(0)->get_pixmap_type() == CANVAS_TYPE_GL) {
         _gl_interrupt_recreate.trigger();
     }
@@ -1083,7 +1083,7 @@ bool DisplayChannel::create_sw_canvas(int surface_id, int width, int height, uin
     return true;
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 bool DisplayChannel::create_ogl_canvas(int surface_id, int width, int height, uint32_t format,
                                        bool recreate, RenderType rendertype)
 {
@@ -1143,7 +1143,7 @@ void DisplayChannel::destroy_canvas(int surface_id)
 
     canvas = surfaces_mngr.get_canvas(surface_id);
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     if (canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
         ((GCanvas *)(canvas))->touch_context();
     }
@@ -1158,12 +1158,12 @@ void DisplayChannel::destroy_canvas(int surface_id)
 void DisplayChannel::create_canvas(int surface_id, const std::vector<int>& canvas_types, int width,
                                    int height, uint32_t format)
 {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     bool recreate = true;
 #endif
     unsigned int i;
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     if (screen()->need_recreate_context_gl()) {
         recreate = false;
     }
@@ -1176,7 +1176,7 @@ void DisplayChannel::create_canvas(int surface_id, const std::vector<int>& canva
         if (canvas_types[i] == CANVAS_OPTION_SW && create_sw_canvas(surface_id, width, height, format)) {
             break;
         }
-#ifdef USE_OGL
+#ifdef USE_OPENGL
         if (canvas_types[i] == CANVAS_OPTION_OGL_FBO && create_ogl_canvas(surface_id, width, height, format,
                                                                           recreate,
                                                                           RENDER_TYPE_FBO)) {
@@ -1408,7 +1408,7 @@ void DisplayChannel::handle_stream_destroy_all(RedPeer::InMessage* message)
 
 void DisplayChannel::create_primary_surface(int width, int height, uint32_t format)
 {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
    Canvas *canvas;
 #endif
    _mark = false;
@@ -1427,7 +1427,7 @@ void DisplayChannel::create_primary_surface(int width, int height, uint32_t form
     _y_res = height;
     _format = format;
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     canvas = surfaces_mngr.get_canvas(0);
 
     if (canvas->get_pixmap_type() == CANVAS_TYPE_GL) {
@@ -1448,7 +1448,7 @@ void DisplayChannel::create_surface(int surface_id, int width, int height, uint3
         THROW("Create surface failed");
     }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     Canvas *canvas;
 
     canvas = surfaces_mngr.get_canvas(surface_id);
@@ -1462,7 +1462,7 @@ void DisplayChannel::create_surface(int surface_id, int width, int height, uint3
 void DisplayChannel::destroy_primary_surface()
 {
     if (screen()) {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
         if (surfaces_mngr.is_present_canvas(0)) {
             Canvas *canvas;
 
diff --git a/client/display_channel.h b/client/display_channel.h
index e6cd227..647fb66 100644
--- a/client/display_channel.h
+++ b/client/display_channel.h
@@ -26,7 +26,7 @@
 #include "cache.hpp"
 #include "screen_layer.h"
 #include "process_loop.h"
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "red_pixmap_gl.h"
 #endif
 #include "glz_decoder_window.h"
@@ -48,7 +48,7 @@ private:
     DisplayChannel& _channel;
 };
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 class GLInterruptRecreate: public EventSources::Trigger {
 public:
     GLInterruptRecreate(DisplayChannel& channel);
@@ -103,7 +103,7 @@ public:
 
     virtual void copy_pixels(const QRegion& dest_region, RedDrawable& dest_dc);
     virtual void copy_pixels(const QRegion& dest_region, const PixmapHeader &dest);
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     virtual void recreate_ogl_context();
     virtual void recreate_ogl_context_interrupt();
     virtual void pre_migrate();
@@ -134,7 +134,7 @@ private:
     void set_draw_handlers();
     void clear_draw_handlers();
     bool create_sw_canvas(int surface_id, int width, int height, uint32_t format);
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     bool create_ogl_canvas(int surface_id, int width, int height, uint32_t format, bool recreate,
                            RenderType rendertype);
 #endif
@@ -200,7 +200,7 @@ private:
     int _x_res;
     int _y_res;
     uint32_t _format;
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     RenderType _rendertype;
 #endif
 
@@ -226,7 +226,7 @@ private:
     std::vector<VideoStream*> _streams;
     VideoStream* _active_streams;
     StreamsTrigger _streams_trigger;
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     GLInterruptRecreate _gl_interrupt_recreate;
 #endif
     InterruptUpdate _interrupt_update;
diff --git a/client/red_client.cpp b/client/red_client.cpp
index 7fd2b5e..56a3e22 100644
--- a/client/red_client.cpp
+++ b/client/red_client.cpp
@@ -811,7 +811,7 @@ void RedClient::calc_pixmap_cach_and_glz_window_size(uint32_t display_channels_h
 
 void RedClient::on_display_mode_change()
 {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     Lock lock(_channels_lock);
     Channels::iterator iter = _channels.begin();
     for (; iter != _channels.end(); ++iter) {
diff --git a/client/red_window.h b/client/red_window.h
index 632564d..dc5bad7 100644
--- a/client/red_window.h
+++ b/client/red_window.h
@@ -72,7 +72,7 @@ public:
     void stop_key_interception();
     void set_menu(Menu* menu);
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     void untouch_context();
     RedGlContext create_context_gl();
     RedPbuffer create_pbuff(int width, int height);
diff --git a/client/screen.cpp b/client/screen.cpp
index d8b6dde..f17a0ba 100644
--- a/client/screen.cpp
+++ b/client/screen.cpp
@@ -892,7 +892,7 @@ int RedScreen::get_screen_id()
     return _monitor ? _monitor->get_screen_id() : 0;
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 void RedScreen::untouch_context()
 {
     _window.untouch_context();
@@ -923,7 +923,7 @@ void RedScreen::interrupt_update()
     _update_interrupt_trigger->trigger();
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 void RedScreen::set_type_gl()
 {
     _window.set_type_gl();
@@ -933,5 +933,5 @@ void RedScreen::unset_type_gl()
 {
     _window.unset_type_gl();
 }
-#endif // USE_OGL
+#endif // USE_OPENGL
 
diff --git a/client/screen.h b/client/screen.h
index 2b40d77..1d40e6c 100644
--- a/client/screen.h
+++ b/client/screen.h
@@ -21,9 +21,9 @@
 #include "common.h"
 #include "region.h"
 #include "red_key.h"
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "GL/gl.h"
-#endif // USE_OGL
+#endif // USE_OPENGL
 
 #include "red_window.h"
 #include "platform.h"
@@ -95,7 +95,7 @@ public:
     int get_id() { return _id;}
     int get_screen_id();
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     void untouch_context();
     bool need_recreate_context_gl();
     void set_type_gl();
diff --git a/client/windows/red_pixmap_sw.cpp b/client/windows/red_pixmap_sw.cpp
index a72d870..991b673 100644
--- a/client/windows/red_pixmap_sw.cpp
+++ b/client/windows/red_pixmap_sw.cpp
@@ -52,7 +52,7 @@ RedPixmapSw::RedPixmapSw(int width, int height, RedDrawable::Format format,
     bitmap_info.inf.bmiHeader.biWidth = _width;
     bitmap_info.inf.bmiHeader.biHeight = top_bottom ? -_height : _height;
 
-/*#ifdef USE_OGL
+/*#ifdef USE_OPENGL
     // -----------------------------------------------------------------------------
     // ensure valid access to additional stride.
     // apparently glReadPixels validate ((ptr of last line) + GL_PACK_ROW_LENGTH + 1).
@@ -98,7 +98,7 @@ RedPixmapSw::RedPixmapSw(int width, int height, RedDrawable::Format format,
     if (!bitmap.valid()) {
         THROW("create compatible bitmap failed");
     }
-/*#ifdef USE_OGL
+/*#ifdef USE_OPENGL
     SetWindowOrgEx(dc.get(), 0, -1, NULL); // compensate for one pad line
 #endif*/
     ((RedPixmap_p*)get_opaque())->prev_bitmap = (HBITMAP)SelectObject(dc.get(), bitmap.release());
diff --git a/client/windows/red_window.cpp b/client/windows/red_window.cpp
index 92ece9b..dcd35fa 100644
--- a/client/windows/red_window.cpp
+++ b/client/windows/red_window.cpp
@@ -814,7 +814,7 @@ void RedWindow::cleanup()
     UnhookWindowsHookEx(low_keyboard_hook);
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 
 void RedWindow::touch_context_draw()
 {
diff --git a/client/x11/pixels_source_p.h b/client/x11/pixels_source_p.h
index b1b5261..8892c58 100644
--- a/client/x11/pixels_source_p.h
+++ b/client/x11/pixels_source_p.h
@@ -19,26 +19,26 @@
 #define _H_PIXELE_SOURSR_P
 
 #include <X11/X.h>
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include <GL/glu.h>
-#endif // USE_OGL
+#endif // USE_OPENGL
 #include <X11/Xdefs.h>
 #include <X11/Xutil.h> // required by Xshm.h, but not included by it
 #include <X11/extensions/XShm.h>
 #include "red_window.h"
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "red_pixmap_gl.h"
-#endif // USE_OGL
+#endif // USE_OPENGL
 #include "pixman_utils.h"
 
 enum {
     PIXELS_SOURCE_TYPE_INVALID,
     PIXELS_SOURCE_TYPE_X_DRAWABLE,
     PIXELS_SOURCE_TYPE_PIXMAP,
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     PIXELS_SOURCE_TYPE_GL_TEXTURE,
     PIXELS_SOURCE_TYPE_GL_DRAWABLE,
-#endif // USE_OGL
+#endif // USE_OPENGL
 };
 
 struct PixelsSource_p {
@@ -56,17 +56,17 @@ struct PixelsSource_p {
             int screen;
             GC gc;
             int width, height;
-#ifdef USE_OGL
+#ifdef USE_OPENGL
             RenderType rendertype;
             union {
                 GLXPbuffer pbuff;
                 GLuint fbo;
             };
             RedGlContext context;
-#endif // USE_OGL
+#endif // USE_OPENGL
         } x_drawable;
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
         struct {
             RenderType rendertype;
             Win win;
@@ -80,7 +80,7 @@ struct PixelsSource_p {
             };
             RedGlContext context;
         } gl;
-#endif // USE_OGL
+#endif // USE_OPENGL
     };
 };
 
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp
index 37df809..7c31058 100644
--- a/client/x11/platform.cpp
+++ b/client/x11/platform.cpp
@@ -78,9 +78,9 @@ static Display* x_display = NULL;
 static bool x_shm_avail = false;
 static XVisualInfo **vinfo = NULL;
 static RedDrawable::Format *screen_format = NULL;
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 static GLXFBConfig **fb_config = NULL;
-#endif // USE_OGL
+#endif // USE_OPENGL
 static XIM x_input_method = NULL;
 static XIC x_input_context = NULL;
 
@@ -510,12 +510,12 @@ RedDrawable::Format XPlatform::get_screen_format(int screen)
     return screen_format[screen];
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 GLXFBConfig** XPlatform::get_fbconfig()
 {
     return fb_config;
 }
-#endif // USE_OGL
+#endif // USE_OPENGL
 
 XIC XPlatform::get_input_context()
 {
@@ -2884,7 +2884,7 @@ static void cleanup(void)
         delete vinfo;
         vinfo = NULL;
     }
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     if (fb_config) {
         for (i = 0; i < ScreenCount(x_display); ++i) {
             if (fb_config[i]) {
@@ -2894,7 +2894,7 @@ static void cleanup(void)
         delete fb_config;
         fb_config = NULL;
     }
-#endif // USE_OGL
+#endif // USE_OPENGL
 }
 
 static void quit_handler(int sig)
@@ -3057,10 +3057,10 @@ static XVisualInfo* get_x_vis_info(int screen)
 
 void Platform::init()
 {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     int err, ev;
     int threads_enable;
-#endif // USE_OGL
+#endif // USE_OPENGL
     int major, minor;
     Bool pixmaps;
 
@@ -3068,7 +3068,7 @@ void Platform::init()
 
     setlocale(LC_ALL, "");
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     threads_enable = XInitThreads();
 #else
     XInitThreads();
@@ -3087,7 +3087,7 @@ void Platform::init()
     memset(vinfo, 0, sizeof(XVisualInfo *) * ScreenCount(x_display));
     screen_format = new RedDrawable::Format[ScreenCount(x_display)];
     memset(screen_format, 0, sizeof(RedDrawable::Format) * ScreenCount(x_display));
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     fb_config = new GLXFBConfig *[ScreenCount(x_display)];
     memset(fb_config, 0, sizeof(GLXFBConfig *) * ScreenCount(x_display));
 
@@ -3122,13 +3122,13 @@ void Platform::init()
             }
         }
     } else
-#else // !USE_OGL
+#else // !USE_OPENGL
     {
         for (int i = 0; i < ScreenCount(x_display); ++i) {
             vinfo[i] = get_x_vis_info(i);
         }
     }
-#endif // USE_OGL
+#endif // USE_OPENGL
 
     for (int i = 0; i < ScreenCount(x_display); ++i) {
         if (vinfo[i] == NULL) {
diff --git a/client/x11/red_drawable.cpp b/client/x11/red_drawable.cpp
index 3712dfd..d6cce92 100644
--- a/client/x11/red_drawable.cpp
+++ b/client/x11/red_drawable.cpp
@@ -25,7 +25,7 @@
 #include "x_platform.h"
 #include "utils.h"
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "gl_utils.h"
 #include <GL/gl.h>
 #include <GL/glu.h>
@@ -136,7 +136,7 @@ static inline void copy_to_gldrawable_from_pixmap(const RedDrawable_p* dest,
         glXMakeCurrent(XPlatform::get_display(), pbuffer, context);
     }
 }
-#endif // USE_OGL
+#endif // USE_OPENGL
 
 static inline void copy_to_drawable_from_drawable(const RedDrawable_p* dest,
                                                   const SpiceRect& area,
@@ -274,7 +274,7 @@ static inline void copy_to_x_drawable(const RedDrawable_p* dest,
     }
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 static inline void copy_to_gl_drawable(const RedDrawable_p* dest,
                                        const SpiceRect& area,
                                        const SpicePoint& offset,
@@ -292,7 +292,7 @@ static inline void copy_to_gl_drawable(const RedDrawable_p* dest,
         THROW("invalid source type %d", source->type);
     }
 }
-#endif // USE_OGL
+#endif // USE_OPENGL
 
 static inline void copy_to_pixmap_from_drawable(const RedDrawable_p* dest,
                                                 const SpiceRect& area,
@@ -323,7 +323,7 @@ static inline void copy_to_pixmap_from_pixmap(const RedDrawable_p* dest,
                              area.bottom - area.top);
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 static inline void copy_to_pixmap_from_gltexture(const RedDrawable_p* dest,
                                                  const SpiceRect& area,
                                                  const SpicePoint& offset,
@@ -367,7 +367,7 @@ static inline void copy_to_pixmap_from_gltexture(const RedDrawable_p* dest,
         glXMakeCurrent(XPlatform::get_display(), win, context);
     }
 }
-#endif // USE_OGL
+#endif // USE_OPENGL
 
 static inline void copy_to_pixmap(const RedDrawable_p* dest,
                                   const SpiceRect& area,
@@ -376,11 +376,11 @@ static inline void copy_to_pixmap(const RedDrawable_p* dest,
                                   int src_x, int src_y)
 {
     switch (source->type) {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     case PIXELS_SOURCE_TYPE_GL_TEXTURE:
         copy_to_pixmap_from_gltexture(dest, area, offset, source, src_x, src_y);
         break;
-#endif // USE_OGL
+#endif // USE_OPENGL
     case PIXELS_SOURCE_TYPE_X_DRAWABLE:
         copy_to_pixmap_from_drawable(dest, area, offset, source, src_x, src_y);
         break;
@@ -397,12 +397,12 @@ void RedDrawable::copy_pixels(const PixelsSource& src, int src_x, int src_y, con
     PixelsSource_p* source = (PixelsSource_p*)src.get_opaque();
     RedDrawable_p* dest = (RedDrawable_p*)get_opaque();
     switch (dest->source.type) {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     case PIXELS_SOURCE_TYPE_GL_DRAWABLE:
         copy_to_gl_drawable(dest, area, _origin, source, src_x + src._origin.x,
                             src_y + src._origin.y);
         break;
-#endif // USE_OGL
+#endif // USE_OPENGL
     case PIXELS_SOURCE_TYPE_X_DRAWABLE:
         copy_to_x_drawable(dest, area, _origin, source, src_x + src._origin.x,
                            src_y + src._origin.y);
@@ -654,7 +654,7 @@ static inline void fill_drawable(RedDrawable_p* dest, const SpiceRect& area, rgb
                    area.right - area.left, area.bottom - area.top);
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 static inline void fill_gl_drawable(RedDrawable_p* dest, const SpiceRect& area, rgb32_t color,
                                     const SpicePoint& offset)
 {
@@ -688,7 +688,7 @@ static inline void fill_gl_drawable(RedDrawable_p* dest, const SpiceRect& area,
 
     glColor3f(1, 1, 1);
 }
-#endif // USE_OGL
+#endif // USE_OPENGL
 
 static inline void fill_pixmap(RedDrawable_p* dest, const SpiceRect& area, rgb32_t color,
                                const SpicePoint& offset)
@@ -706,11 +706,11 @@ void RedDrawable::fill_rect(const SpiceRect& area, rgb32_t color)
 {
     RedDrawable_p* dest = (RedDrawable_p*)get_opaque();
     switch (dest->source.type) {
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     case PIXELS_SOURCE_TYPE_GL_DRAWABLE:
         fill_gl_drawable(dest, area, color, _origin);
         break;
-#endif // USE_OGL
+#endif // USE_OPENGL
     case PIXELS_SOURCE_TYPE_X_DRAWABLE:
         fill_drawable(dest, area, color, _origin);
         break;
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index 8af2226..9f4da60 100644
--- a/client/x11/red_window.cpp
+++ b/client/x11/red_window.cpp
@@ -25,12 +25,12 @@
 #include <X11/Xatom.h>
 #include <X11/XKBlib.h>
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include <GL/gl.h>
 #include <GL/glu.h>
 #include <GL/glx.h>
 #include <GL/glext.h>
-#endif // USE_OGL
+#endif // USE_OPENGL
 #include <stdio.h>
 
 #include "red_window.h"
@@ -41,10 +41,10 @@
 #include "pixels_source_p.h"
 #include <spice/protocol.h>
 #include "region.h"
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "gl_utils.h"
 #include "red_pixmap_gl.h"
-#endif // USE_OGL
+#endif // USE_OPENGL
 #include "x_icon.h"
 
 
@@ -1066,7 +1066,7 @@ void RedWindow_p::wait_for_unmap()
     }
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 void RedWindow_p::set_glx(int width, int height)
 {
     if (_glcont_copy) {
@@ -1086,7 +1086,7 @@ void RedWindow_p::set_glx(int width, int height)
         GLC_ERROR_TEST_FINISH;
     }
 }
-#endif // USE_OGL
+#endif // USE_OPENGL
 
 void RedWindow_p::set_minmax(PixelsSource_p& pix_source)
 {
@@ -1127,9 +1127,9 @@ Cursor RedWindow_p::create_invisible_cursor(Window window)
 RedWindow_p::RedWindow_p()
     : _win (None)
     , _show_pos_valid (false)
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     , _glcont_copy (NULL)
-#endif // USE_OGL
+#endif // USE_OPENGL
     , _icon (NULL)
     , _focused (false)
     , _ignore_foucs (false)
@@ -1167,12 +1167,12 @@ void RedWindow_p::destroy(RedWindow& red_window, PixelsSource_p& pix_source)
     XFreeCursor(x_display, _invisible_cursor);
     _invisible_cursor = None;
     XDeleteContext(x_display, window, user_data_context);
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     if (_glcont_copy) {
         glXDestroyContext(x_display, _glcont_copy);
         _glcont_copy = NULL;
     }
-#endif // USE_OGL
+#endif // USE_OPENGL
     XDestroyWindow(x_display, window);
     XFreeColormap(x_display, _colormap);
     XFreeGC(x_display, pix_source.x_drawable.gc);
@@ -2075,7 +2075,7 @@ bool RedWindow::get_mouse_anchor_point(SpicePoint& pt)
     return true;
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 RedGlContext RedWindow::create_context_gl()
 {
     if (XPlatform::get_fbconfig()[_screen]) {
@@ -2148,7 +2148,7 @@ void RedWindow::set_render_fbo(GLuint fbo)
     pix_source->x_drawable.rendertype = RENDER_TYPE_FBO;
     pix_source->x_drawable.fbo = fbo;
 }
-#endif // USE_OGL
+#endif // USE_OPENGL
 
 int RedWindow::get_screen_num()
 {
diff --git a/client/x11/red_window_p.h b/client/x11/red_window_p.h
index 6f05a90..6f94d26 100644
--- a/client/x11/red_window_p.h
+++ b/client/x11/red_window_p.h
@@ -18,17 +18,17 @@
 #ifndef _H_RED_WINDOW_P
 #define _H_RED_WINDOW_P
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include <GL/glx.h>
-#endif // USE_OGL
+#endif // USE_OPENGL
 #include <X11/Xdefs.h>
 #include <X11/Xlib.h>
 
 typedef Window Win;
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 typedef GLXContext RedGlContext;
 typedef GLXPbuffer RedPbuffer;
-#endif // USE_OGL
+#endif // USE_OPENGL
 
 class RedWindow;
 class Icon;
@@ -54,9 +54,9 @@ public:
     static void win_proc(XEvent& event);
     static Cursor create_invisible_cursor(Window window);
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     void set_glx(int width, int height);
-#endif // USE_OGL
+#endif // USE_OPENGL
     static void handle_key_press_event(RedWindow& red_window, XKeyEvent* event);
 
 protected:
@@ -67,9 +67,9 @@ protected:
     bool _expect_parent;
     SpicePoint _show_pos;
     bool _show_pos_valid;
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     GLXContext _glcont_copy;
-#endif // USE_OGL
+#endif // USE_OPENGL
     Icon* _icon;
     bool _focused;
     bool _ignore_foucs;
diff --git a/client/x11/x_platform.h b/client/x11/x_platform.h
index c535652..93debdc 100644
--- a/client/x11/x_platform.h
+++ b/client/x11/x_platform.h
@@ -29,9 +29,9 @@ public:
     static XVisualInfo** get_vinfo();
     static RedDrawable::Format get_screen_format(int screen);
     static XIC get_input_context();
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     static GLXFBConfig** get_fbconfig();
-#endif // USE_OGL
+#endif // USE_OPENGL
 
     typedef void (*win_proc_t)(XEvent& event);
     static void set_win_proc(Window win, win_proc_t proc);
diff --git a/configure.ac b/configure.ac
index 23c814f..ac1d5e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -232,7 +232,7 @@ SPICE_REQUIRES+=" openssl"
 if test "x$enable_opengl" = "xyes"; then
    AC_CHECK_LIB(GL, glBlendFunc, GL_LIBS="$GL_LIBS -lGL", enable_opengl=no)
    AC_CHECK_LIB(GLU, gluSphere, GL_LIBS="$GL_LIBS -lGLU", enable_opengl=no)
-   AC_DEFINE([USE_OGL], [1], [Define to build with OpenGL support])
+   AC_DEFINE([USE_OPENGL], [1], [Define to build with OpenGL support])
    AC_DEFINE([GL_GLEXT_PROTOTYPES], [], [Enable GLExt prototypes])
 
    if test "x$enable_opengl" = "xno"; then
diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
index 8b3d0ff..19d6e8d 100644
--- a/server/red_dispatcher.c
+++ b/server/red_dispatcher.c
@@ -32,9 +32,9 @@
 #include "red_worker.h"
 #include "quic.h"
 #include "reds_sw_canvas.h"
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "reds_gl_canvas.h"
-#endif // USE_OGL
+#endif // USE_OPENGL
 #include "reds.h"
 #include "red_dispatcher.h"
 #include "red_parse_qxl.h"
@@ -140,7 +140,7 @@ typedef struct RendererInfo {
 
 static RendererInfo renderers_info[] = {
     {RED_RENDERER_SW, "sw"},
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     {RED_RENDERER_OGL_PBUF, "oglpbuf"},
     {RED_RENDERER_OGL_PIXMAP, "oglpixmap"},
 #endif
@@ -496,9 +496,9 @@ RedDispatcher *red_dispatcher_init(QXLInstance *qxl)
 
     quic_init();
     sw_canvas_init();
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     gl_canvas_init();
-#endif // USE_OGL
+#endif // USE_OPENGL
 
     if (socketpair(AF_LOCAL, SOCK_STREAM, 0, channels) == -1) {
         red_error("socketpair failed %s", strerror(errno));
diff --git a/server/red_worker.c b/server/red_worker.c
index 856b66a..a9452fb 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -40,10 +40,10 @@
 #include <spice/protocol.h>
 #include "red_worker.h"
 #include "reds_sw_canvas.h"
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 #include "reds_gl_canvas.h"
 #include "ogl_ctx.h"
-#endif /* USE_OGL */
+#endif /* USE_OPENGL */
 #include "quic.h"
 #include "lz.h"
 #include "glz_encoder_dictionary.h"
@@ -8305,7 +8305,7 @@ static void red_migrate_display(RedWorker *worker)
     }
 }
 
-#ifdef USE_OGL
+#ifdef USE_OPENGL
 static SpiceCanvas *create_ogl_context_common(RedWorker *worker, OGLCtx *ctx, uint32_t width,
                                               uint32_t height, int32_t stride, uint8_t depth)
 {
@@ -8375,7 +8375,7 @@ static inline void *create_canvas_for_surface(RedWorker *worker, RedSurface *sur
         surface->context.top_down = TRUE;
         surface->context.canvas_draws_on_surface = TRUE;
         return canvas;
-#ifdef USE_OGL
+#ifdef USE_OPENGL
     case RED_RENDERER_OGL_PBUF:
         canvas = create_ogl_pbuf_context(worker, width, height, stride,
                                          SPICE_SURFACE_FMT_DEPTH(format));
-- 
1.7.4.4



More information about the Spice-devel mailing list