aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-01-28 13:47:18 +0100
committerPierre Ossman <ossman@cendio.se>2014-07-07 14:50:28 +0200
commit1b350ed9127e43863157a7a4453405fdf0cbb617 (patch)
tree7c767c3f530dc34b13792e9c816f290e13dff201 /common/rfb
parent8b56a87e6c33e933103898631eb7991e20845255 (diff)
downloadtigervnc-1b350ed9127e43863157a7a4453405fdf0cbb617.tar.gz
tigervnc-1b350ed9127e43863157a7a4453405fdf0cbb617.zip
Avoid having virtual methods where not needed
Diffstat (limited to 'common/rfb')
-rw-r--r--common/rfb/PixelBuffer.cxx4
-rw-r--r--common/rfb/PixelBuffer.h23
2 files changed, 10 insertions, 17 deletions
diff --git a/common/rfb/PixelBuffer.cxx b/common/rfb/PixelBuffer.cxx
index 3ed3a924..7f4c3440 100644
--- a/common/rfb/PixelBuffer.cxx
+++ b/common/rfb/PixelBuffer.cxx
@@ -40,10 +40,6 @@ PixelBuffer::PixelBuffer() : width_(0), height_(0) {}
PixelBuffer::~PixelBuffer() {}
-void PixelBuffer::setPF(const PixelFormat &pf) {format = pf;}
-const PixelFormat& PixelBuffer::getPF() const {return format;}
-
-
void
PixelBuffer::getImage(void* imageBuf, const Rect& r, int outStride) {
int inStride;
diff --git a/common/rfb/PixelBuffer.h b/common/rfb/PixelBuffer.h
index 0b8ab040..ad30cf22 100644
--- a/common/rfb/PixelBuffer.h
+++ b/common/rfb/PixelBuffer.h
@@ -41,12 +41,9 @@ namespace rfb {
// Format / Layout
//
- // Set/get pixel format & colourmap
- protected:
- // Only for subclasses that support changing parameters
- virtual void setPF(const PixelFormat &pf);
public:
- virtual const PixelFormat &getPF() const;
+ // Get pixel format
+ const PixelFormat &getPF() const { return format; }
// Get width, height and number of pixels
int width() const { return width_; }
@@ -86,6 +83,8 @@ namespace rfb {
virtual void grabRegion(const Region& region) {}
protected:
+ // Only for subclasses that support changing parameters
+ void setPF(const PixelFormat &pf) { format = pf; }
PixelBuffer();
PixelFormat format;
int width_, height_;
@@ -99,9 +98,6 @@ namespace rfb {
rdr::U8* data_);
virtual ~FullFramePixelBuffer();
- protected:
- virtual void setPF(const PixelFormat &pf);
-
public:
// - Get the number of pixels per row in the actual pixel buffer data area
// This may in some cases NOT be the same as width().
@@ -118,28 +114,29 @@ namespace rfb {
// These operations DO NOT clip to the pixelbuffer area, or trap overruns.
// Fill a rectangle
- virtual void fillRect(const Rect &dest, Pixel pix);
+ void fillRect(const Rect &dest, Pixel pix);
// Copy pixel data to the buffer
- virtual void imageRect(const Rect &dest, const void* pixels, int stride=0);
+ void imageRect(const Rect &dest, const void* pixels, int stride=0);
// Copy pixel data from one PixelBuffer location to another
- virtual void copyRect(const Rect &dest, const Point &move_by_delta);
+ void copyRect(const Rect &dest, const Point& move_by_delta);
// Copy pixel data to the buffer through a mask
// pixels is a pointer to the pixel to be copied to r.tl.
// maskPos specifies the pixel offset in the mask to start from.
// mask_ is a pointer to the mask bits at (0,0).
// pStride and mStride are the strides of the pixel and mask buffers.
- virtual void maskRect(const Rect& r, const void* pixels, const void* mask_);
+ void maskRect(const Rect& r, const void* pixels, const void* mask_);
// pixel is the Pixel value to be used where mask_ is set
- virtual void maskRect(const Rect& r, Pixel pixel, const void* mask_);
+ void maskRect(const Rect& r, Pixel pixel, const void* mask_);
// *** Should this be visible?
rdr::U8* data;
protected:
+ void setPF(const PixelFormat &pf);
FullFramePixelBuffer();
void (*fillRectFn)(rdr::U8 *, int, const Rect&, Pixel);
};