From df9f31c3ab4f1183065cc9a50254a53faa68cc58 Mon Sep 17 00:00:00 2001 From: george82 Date: Sat, 16 Sep 2006 11:06:07 +0000 Subject: [PATCH] Small ScaledPixelBuffer class improvements. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2098 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rfb/ScaledPixelBuffer.cxx | 2 +- common/rfb/ScaledPixelBuffer.h | 2 +- win/rfb_win32/ScaledDIBSectionBuffer.cxx | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/common/rfb/ScaledPixelBuffer.cxx b/common/rfb/ScaledPixelBuffer.cxx index bc59fb5e..da624b21 100644 --- a/common/rfb/ScaledPixelBuffer.cxx +++ b/common/rfb/ScaledPixelBuffer.cxx @@ -84,7 +84,7 @@ void ScaledPixelBuffer::scaleRect(const Rect& r) { c1_sub_dy = 1 - dy; for (int x = changed_rect.tl.x; x < changed_rect.br.x; x++) { - ptr = &scaled_data[(x + y*scaled_width) * 4]; + ptr = &(*scaled_data)[(x + y*scaled_width) * 4]; i = (int)(dx = x / scale_ratio); dx -= i; diff --git a/common/rfb/ScaledPixelBuffer.h b/common/rfb/ScaledPixelBuffer.h index 710e5435..7e2b0f70 100644 --- a/common/rfb/ScaledPixelBuffer.h +++ b/common/rfb/ScaledPixelBuffer.h @@ -90,7 +90,7 @@ namespace rfb { PixelFormat pf; double scale_ratio; U8 **src_data; - U8 *scaled_data; + U8 **scaled_data; }; }; diff --git a/win/rfb_win32/ScaledDIBSectionBuffer.cxx b/win/rfb_win32/ScaledDIBSectionBuffer.cxx index 155de3de..0b7dffd8 100644 --- a/win/rfb_win32/ScaledDIBSectionBuffer.cxx +++ b/win/rfb_win32/ScaledDIBSectionBuffer.cxx @@ -30,7 +30,7 @@ using namespace win32; ScaledDIBSectionBuffer::ScaledDIBSectionBuffer(HWND window) : src_buffer(0), scaling(false), DIBSectionBuffer(window) { - scaled_data = data; + scaled_data = &data; } ScaledDIBSectionBuffer::~ScaledDIBSectionBuffer() { @@ -61,7 +61,6 @@ void ScaledDIBSectionBuffer::setPF(const PixelFormat &pf_) { } } DIBSectionBuffer::setPF(pf_); - scaled_data = data; } void ScaledDIBSectionBuffer::setSize(int src_width_, int src_height_) { @@ -76,7 +75,6 @@ void ScaledDIBSectionBuffer::setSize(int src_width_, int src_height_) { void ScaledDIBSectionBuffer::recreateScaledBuffer() { if (width_ && height_ && (format.depth != 0)) { DIBSectionBuffer::recreateBuffer(); - scaled_data = data; } } -- 2.39.5