Commit f8e6ca94 authored by Patrick Julien's avatar Patrick Julien

Compile fix for gcc 2.95.4 under FreeBSD

Fix tile manager single tile optimization.

svn path=/trunk/koffice/; revision=183119
parent de284358
......@@ -16,3 +16,13 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "kis_tool_memento.h"
KisToolMemento::KisToolMemento()
{
}
KisToolMemento::~KisToolMemento()
{
}
......@@ -22,6 +22,9 @@
#include "kis_types.h"
class KisToolMemento : public KShared {
public:
KisToolMemento();
virtual ~KisToolMemento();
};
#endif // KIS_TOOL_MEMENTO_H_
......
......@@ -348,14 +348,25 @@ KisPixelDataSP KisTileMgr::pixelData(Q_INT32 x1, Q_INT32 y1, Q_INT32 x2, Q_INT32
pd -> y2 = y2;
pd -> width = x2 - x1 + 1;
pd -> height = y2 - y1 + 1;
pd -> data = 0;
pd -> depth = depth();
pd -> tile = 0;
pd -> data = new QUANTUM[pd -> width * pd -> height * depth()];
pd -> stride = depth() * pd -> width;
pd -> owner = true;
if (mode & TILEMODE_READ)
readPixelData(pd);
if (tilenum1 == tilenum2 && (x1 % TILE_WIDTH) == 0 && (y1 % TILE_HEIGHT) == 0) {
KisTileSP t = tile(tilenum1, mode);
pd -> tile = t;
pd -> data = t -> data();
pd -> stride = t -> depth() * t -> width();
pd -> owner = false;
} else {
pd -> tile = 0;
pd -> data = new QUANTUM[pd -> width * pd -> height * depth()];
pd -> stride = depth() * pd -> width;
pd -> owner = true;
if (mode & TILEMODE_READ)
readPixelData(pd);
}
return pd;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment