diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-04-29 13:34:44 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-04-29 13:34:44 +0200 |
commit | fcbd3208fc18fb71bc32282fc9962f069deb1dfc (patch) | |
tree | f481e73c98938089adfc12a8dd1c7e11e427cc15 /client/windows/red_window.cpp | |
parent | 1e4ec1f513ed7dec51cac42e7cb974ad6c36eb3f (diff) | |
download | spice-fcbd3208fc18fb71bc32282fc9962f069deb1dfc.tar.gz spice-fcbd3208fc18fb71bc32282fc9962f069deb1dfc.tar.xz spice-fcbd3208fc18fb71bc32282fc9962f069deb1dfc.zip |
client: Report window format right for win32
Diffstat (limited to 'client/windows/red_window.cpp')
-rw-r--r-- | client/windows/red_window.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/client/windows/red_window.cpp b/client/windows/red_window.cpp index 80a282a0..1be94ffe 100644 --- a/client/windows/red_window.cpp +++ b/client/windows/red_window.cpp @@ -348,6 +348,17 @@ void RedWindow_p::create(RedWindow& red_window, PixelsSource_p& pixels_source) } _win = window; pixels_source.dc = dc; + + int depth = GetDeviceCaps(dc, BITSPIXEL); + switch (depth) { + case 16: + _format = RedDrawable::RGB16_555; + break; + case 32: + default: + _format = RedDrawable::RGB32; + break; + } SetWindowLong(window, GWL_USERDATA, (LONG)&red_window); SetWindowLong(window, GWL_WNDPROC, (LONG)WindowProc); } @@ -366,10 +377,7 @@ void RedWindow_p::destroy(PixelsSource_p& pixels_source) RedDrawable::Format RedWindow::get_format() { - /* TODO: Windows will convert types when - blitting, so this works (and is what we did before). - but it would be better to return the right format here */ - return RedDrawable::RGB32; + return _format; } |