diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2006-05-26 05:24:24 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2006-05-26 05:24:24 +0000 |
commit | 1ae2eb0b58a028349d3857eb079cad389e67aa53 (patch) | |
tree | c78b2afa651d1d049651d3cdef46c588e113202e /win/rfb_win32/ScaledDIBSectionBuffer.cxx | |
parent | 3cb96488621541bc39562823e3f17dcf560f00b0 (diff) | |
download | tigervnc-1ae2eb0b58a028349d3857eb079cad389e67aa53.tar.gz tigervnc-1ae2eb0b58a028349d3857eb079cad389e67aa53.zip |
Merged the changes from revision range 582:588 into reorganized sources. These changes accidentally were not included in files copied during directory structure reorganization.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@594 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'win/rfb_win32/ScaledDIBSectionBuffer.cxx')
-rw-r--r-- | win/rfb_win32/ScaledDIBSectionBuffer.cxx | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/win/rfb_win32/ScaledDIBSectionBuffer.cxx b/win/rfb_win32/ScaledDIBSectionBuffer.cxx index e6c15b8e..bd6b4d37 100644 --- a/win/rfb_win32/ScaledDIBSectionBuffer.cxx +++ b/win/rfb_win32/ScaledDIBSectionBuffer.cxx @@ -40,23 +40,28 @@ ScaledDIBSectionBuffer::~ScaledDIBSectionBuffer() { void ScaledDIBSectionBuffer::setScale(int scale_) { if (scale_ == getScale()) return; - if (src_buffer) { - delete src_buffer; - src_buffer = 0; - } if (scale_ != 100) { scaling = true; - src_buffer = new ManagedPixelBuffer(format, src_width, src_height); - src_data = &(src_buffer->data); + if (!src_buffer) { + src_buffer = new ManagedPixelBuffer(format, src_width, src_height); + src_data = &(src_buffer->data); + } } else { scaling = false; + if (src_buffer) delete src_buffer; + src_buffer = 0; + src_data = 0; } ScaledPixelBuffer::setScale(scale_); + recreateScaledBuffer(); } -void ScaledDIBSectionBuffer::setPF(const PixelFormat &pf) { - if (scaling) src_buffer->setPF(pf); - DIBSectionBuffer::setPF(pf); +void ScaledDIBSectionBuffer::setPF(const PixelFormat &pf_) { + if (scaling) { + ScaledPixelBuffer::setPF(pf_); + src_buffer->setPF(pf_); + } + DIBSectionBuffer::setPF(pf_); scaled_data = data; } |