summaryrefslogtreecommitdiffstats
path: root/client/red_pixmap.h
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-04-21 12:03:06 +0200
committerAlexander Larsson <alexl@redhat.com>2010-04-23 16:36:35 +0200
commit2d6fbde89b08b7dd4a2050c71fe6663ea8e9c2d9 (patch)
tree7a21036fa2fe975dac3462a075ee968eb3ec267f /client/red_pixmap.h
parent98d91203c5d2f6f7249f38941466857b6a566f5d (diff)
downloadspice-2d6fbde89b08b7dd4a2050c71fe6663ea8e9c2d9.tar.gz
spice-2d6fbde89b08b7dd4a2050c71fe6663ea8e9c2d9.tar.xz
spice-2d6fbde89b08b7dd4a2050c71fe6663ea8e9c2d9.zip
Move RedPixmap::Format to RedDrawable::Format
We need to know the format for other drawables too (like for instance the native format of a window), so we're pushing this down. This changes a bunch of references to be RedDrawable::, but not all. The the old RedPixmap:: references still work, but will be phased out.
Diffstat (limited to 'client/red_pixmap.h')
-rw-r--r--client/red_pixmap.h51
1 files changed, 0 insertions, 51 deletions
diff --git a/client/red_pixmap.h b/client/red_pixmap.h
index c81c2f77..a07c59cf 100644
--- a/client/red_pixmap.h
+++ b/client/red_pixmap.h
@@ -21,60 +21,9 @@
#include "red_drawable.h"
#include "utils.h"
-#include <pixman_utils.h>
class RedPixmap: public RedDrawable {
public:
- enum Format {
- ARGB32,
- RGB32,
- RGB16_555,
- RGB16_565,
- A1,
- };
-
- static int format_to_bpp(Format format) {
- if (format == RedPixmap::A1) {
- return 1;
- } else if (format == RGB16_555 || format == RGB16_565) {
- return 16;
- } else {
- return 32;
- }
- }
-
- static pixman_format_code_t format_to_pixman(Format format) {
- switch (format) {
- case RedPixmap::ARGB32:
- return PIXMAN_a8r8g8b8;
- case RedPixmap::RGB32:
- return PIXMAN_x8r8g8b8;
- case RedPixmap::RGB16_555:
- return PIXMAN_x1r5g5b5;
- case RedPixmap::RGB16_565:
- return PIXMAN_r5g6b5;
- case RedPixmap::A1:
- return PIXMAN_a1;
- default:
- THROW("unsupported format %d", format);
- }
- }
-
- static Format format_from_surface(uint32_t format) {
- switch (format) {
- case SPICE_SURFACE_FMT_16_555:
- return RedPixmap::RGB16_555;
- case SPICE_SURFACE_FMT_16_565:
- return RedPixmap::RGB16_565;
- case SPICE_SURFACE_FMT_32_xRGB:
- return RedPixmap::RGB32;
- case SPICE_SURFACE_FMT_32_ARGB:
- return RedPixmap::ARGB32;
- default:
- THROW("Unsupported RedPixman format");
- }
- }
-
RedPixmap(int width, int height, Format format, bool top_bottom);
virtual ~RedPixmap();