# HG changeset patch # User sl # Date 1401650133 -7200 # Node ID 1f607fa8542ff0a499bd1b4c1f8b280966e342f7 # Parent ca9e48af31e626328de470dd5b6d2c3d9cbba42b Adding an option to disable frame differencing. diff -r ca9e48af31e6 -r 1f607fa8542f MiniDisplay/FutabaVfd.cpp --- a/MiniDisplay/FutabaVfd.cpp Fri May 30 15:02:15 2014 +0200 +++ b/MiniDisplay/FutabaVfd.cpp Sun Jun 01 21:15:33 2014 +0200 @@ -74,7 +74,7 @@ GP1212A01A::GP1212A01A(): iDisplayPositionX(0),iDisplayPositionY(0), iOffScreenMode(true), - iUseFrameDiffAlgo(true), + iUseFrameDifferencing(true), iFrameNext(NULL), iFrameCurrent(NULL), iFramePrevious(NULL), @@ -376,7 +376,7 @@ if (OffScreenMode()) { //Send host back buffer to device back buffer - if (!iUseFrameDiffAlgo || iNeedFullFrameUpdatePtr()); @@ -406,20 +406,20 @@ } +//Define the edge of our pixel block +//Pixel blocks of 32x32 seems to run almost as fast as full screen update in worse case scenarii. +//Though I wonder if in some situations 16 could be better. Make this an attribute at some point if need be. +const int KPixelBlockEdge = 32; +const int KPixelBlockSizeInBits = KPixelBlockEdge*KPixelBlockEdge; +const int KPixelBlockSizeInBytes = KPixelBlockSizeInBits/8; + + /** * @brief GP1212A01A::SendModifiedPixelBlocks * Compare our back and front buffer and send to the device only the modified pixels. */ void GP1212A01A::SendModifiedPixelBlocks() { - //The largest pixel block we can sanely send with one report is 16*16 - //const int KBlocksPerRow = WidthInPixels()/16; //16 - //const int KBlocksPerColumn = HeightInPixels()/16; //4 - - const int KPixelBlockEdge = 16; - const int KPixelBlockSizeInBits = KPixelBlockEdge*KPixelBlockEdge; - const int KPixelBlockSizeInBytes = KPixelBlockSizeInBits/8; - int w=WidthInPixels(); int h=HeightInPixels(); diff -r ca9e48af31e6 -r 1f607fa8542f MiniDisplay/FutabaVfd.h --- a/MiniDisplay/FutabaVfd.h Fri May 30 15:02:15 2014 +0200 +++ b/MiniDisplay/FutabaVfd.h Sun Jun 01 21:15:33 2014 +0200 @@ -159,8 +159,9 @@ void ToggleOffScreenMode(); void SetOffScreenMode(bool aOn); bool OffScreenMode() const {return iOffScreenMode;} - void SetFrameDiffAlgo(bool aOn); - bool FrameDiffAlgo() const {return iUseFrameDiffAlgo;} + // + void SetFrameDifferencing(bool aOn){iUseFrameDifferencing=aOn;} + bool FrameDifferencing() const {return iUseFrameDifferencing;} // bool RequestPending(){return iRequest!=ERequestNone;} Request CurrentRequest(){return iRequest;} @@ -190,7 +191,7 @@ ///Though turning it off can be useful for debugging bool iOffScreenMode; ///Frame differences algo is used to reduce USB bus traffic and improve frame rate in typical use case - bool iUseFrameDiffAlgo; + bool iUseFrameDifferencing; /// //FutabaVfdReport iReport; /// diff -r ca9e48af31e6 -r 1f607fa8542f MiniDisplay/minidisplay.cpp --- a/MiniDisplay/minidisplay.cpp Fri May 30 15:02:15 2014 +0200 +++ b/MiniDisplay/minidisplay.cpp Sun Jun 01 21:15:33 2014 +0200 @@ -334,6 +334,25 @@ iDisplay.SetBrightness(aBrightness); } +/** +@brief MiniDisplay::frameDifferencing +@return +*/ +bool MiniDisplay::frameDifferencing() const +{ + return iDisplay.FrameDifferencing(); +} + +/** +@brief MiniDisplay::setFrameDifferencing +@param aOn +*/ +void MiniDisplay::setFrameDifferencing(bool aOn) +{ + iDisplay.SetFrameDifferencing(aOn); +} + + QPoint MiniDisplay::framePosition() const { return QPoint(iDisplay.DisplayPositionX(),iDisplay.DisplayPositionX()); diff -r ca9e48af31e6 -r 1f607fa8542f MiniDisplay/minidisplay.h --- a/MiniDisplay/minidisplay.h Fri May 30 15:02:15 2014 +0200 +++ b/MiniDisplay/minidisplay.h Sun Jun 01 21:15:33 2014 +0200 @@ -19,6 +19,8 @@ Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) Q_PROPERTY(int maxBrightness READ maxBrightness NOTIFY opened) Q_PROPERTY(int minBrightness READ minBrightness NOTIFY opened) + Q_PROPERTY(bool frameDifferencing READ frameDifferencing WRITE setFrameDifferencing NOTIFY frameDifferencingChanged) + //Debug only Q_PROPERTY(QPoint framePosition READ framePosition WRITE setFramePosition NOTIFY closed) public: @@ -61,6 +63,9 @@ int brightness() const; void setBrightness(int aBrightness); // + bool frameDifferencing() const; + void setFrameDifferencing(bool aOn); + //Debug only QPoint framePosition() const; void setFramePosition(const QPoint& aPoint); @@ -73,6 +78,7 @@ void fontChanged(); void brightnessChanged(); void offScreenModeChanged(); + void frameDifferencingChanged(); // void powerStatus(bool powerOn); void deviceId(QString deviceId); diff -r ca9e48af31e6 -r 1f607fa8542f TestsTab.qml --- a/TestsTab.qml Fri May 30 15:02:15 2014 +0200 +++ b/TestsTab.qml Sun Jun 01 21:15:33 2014 +0200 @@ -131,7 +131,7 @@ if (checkBoxRenderToDisplay.checked) { - if (checkBoxFillOnly.checked) + if (checkBoxFillAndClearOnly.checked) { //Trying to make it a worse case scenario for our frame diff algo if (doFill) @@ -218,7 +218,7 @@ } CheckBox { - id: checkBoxFillOnly + id: checkBoxFillAndClearOnly text: qsTr("Only fill and clear") checked: false } @@ -236,10 +236,16 @@ } CheckBox { - //id: checkBoxOnePixelOnly text: qsTr("Off-Screen") checked: true onCheckedChanged: {display.offScreenMode = checked;} } + + CheckBox { + text: qsTr("Frame differencing") + checked: true + onCheckedChanged: {display.frameDifferencing = checked;} + } + } }