summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-04-21 12:31:23 +0200
committerAlexander Larsson <alexl@redhat.com>2010-04-23 16:36:35 +0200
commit5c2d9a3e321eca7f93f69a5cfc8ff240c8992e13 (patch)
tree8fba57c3f98f6301da4e558582467030a60d8f4c /client
parentcfa250caa24593b24e13290bf7c6216b871b8c7a (diff)
downloadspice-5c2d9a3e321eca7f93f69a5cfc8ff240c8992e13.tar.gz
spice-5c2d9a3e321eca7f93f69a5cfc8ff240c8992e13.tar.xz
spice-5c2d9a3e321eca7f93f69a5cfc8ff240c8992e13.zip
Add RedDrawable::Format get_format()
This is useful because we can e.g. create pixmaps in the same format as a window.
Diffstat (limited to 'client')
-rw-r--r--client/red_drawable.h1
-rw-r--r--client/red_pixmap.h1
-rw-r--r--client/red_window.h1
-rw-r--r--client/x11/red_window.cpp5
4 files changed, 8 insertions, 0 deletions
diff --git a/client/red_drawable.h b/client/red_drawable.h
index 5cea85e8..64929e8c 100644
--- a/client/red_drawable.h
+++ b/client/red_drawable.h
@@ -105,6 +105,7 @@ public:
OP_XOR,
};
+ virtual RedDrawable::Format get_format() = 0;
void copy_pixels(const PixelsSource& src, int src_x, int src_y, const SpiceRect& dest);
void blend_pixels(const PixelsSource& src, int src_x, int src_y, const SpiceRect& dest);
void combine_pixels(const PixelsSource& src, int src_x, int src_y, const SpiceRect& dest,
diff --git a/client/red_pixmap.h b/client/red_pixmap.h
index a07c59cf..46e3657b 100644
--- a/client/red_pixmap.h
+++ b/client/red_pixmap.h
@@ -34,6 +34,7 @@ public:
int get_stride() { return _stride;}
uint8_t* get_data() { return _data;}
bool is_big_endian_bits();
+ virtual RedDrawable::Format get_format() { return _format; }
protected:
Format _format;
diff --git a/client/red_window.h b/client/red_window.h
index 7da7e4ce..a5eeb535 100644
--- a/client/red_window.h
+++ b/client/red_window.h
@@ -50,6 +50,7 @@ public:
void activate();
void set_title(std::wstring& title);
void set_icon(Icon *icon);
+ virtual RedDrawable::Format get_format();
enum Type {
TYPE_INVALID,
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index 6de86bf2..21567275 100644
--- a/client/x11/red_window.cpp
+++ b/client/x11/red_window.cpp
@@ -1930,6 +1930,11 @@ int RedWindow::get_screen_num()
return _screen;
}
+RedDrawable::Format RedWindow::get_format()
+{
+ return XPlatform::get_screen_format(_screen);
+}
+
void RedWindow::set_type_gl()
{
PixelsSource_p *pix_source = (PixelsSource_p*)get_opaque();