Commit 906c1341 authored by Boudewijn Rempt's avatar Boudewijn Rempt

* Removed links to color strategies from the tile manager. The data manager and

the data interpreter should stay strictly separated.
* Fixed a build issue. I hope.

svn path=/trunk/koffice/; revision=333490
parent 0a971196
......@@ -16,6 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "kdebug.h"
#include "kis_colorspace_factory.h"
#include "kis_paint_device.h"
......
......@@ -93,7 +93,7 @@ KisPaintDevice::KisPaintDevice(Q_INT32 width, Q_INT32 height, KisStrategyColorSp
m_offY = 0;
m_offW = 0;
m_offH = 0;
m_tiles = new KisTileMgr(colorStrategy, width, height);
m_tiles = new KisTileMgr(colorStrategy -> depth(), width, height);
m_visible = true;
m_owner = 0;
m_name = name;
......@@ -207,7 +207,7 @@ void KisPaintDevice::configure(KisImageSP image,
m_offY = 0;
m_offW = 0;
m_offH = 0;
m_tiles = new KisTileMgr(colorStrategy, width, height);
m_tiles = new KisTileMgr(colorStrategy -> depth(), width, height);
m_visible = true;
m_owner = image;
m_name = name;
......@@ -407,7 +407,7 @@ void KisPaintDevice::setData(KisTileMgrSP mgr)
void KisPaintDevice::resize(Q_INT32 w, Q_INT32 h)
{
KisTileMgrSP old = data();
KisTileMgrSP tm = new KisTileMgr(colorStrategy(), w, h);
KisTileMgrSP tm = new KisTileMgr(colorStrategy() -> depth(), w, h);
Q_INT32 oldW = width();
Q_INT32 oldH = height();
KisPainter gc;
......@@ -520,7 +520,7 @@ void KisPaintDevice::transform(const QWMatrix & matrix)
}
}
KisTileMgrSP tm = new KisTileMgr(colorStrategy(), targetW, targetH);
KisTileMgrSP tm = new KisTileMgr(colorStrategy() -> depth(), targetW, targetH);
tm -> writePixelData(0, 0, targetW - 1, targetH - 1, newData, targetW * depth());
setData(tm); // Also sets width and height correctly
......@@ -537,7 +537,7 @@ void KisPaintDevice::mirrorX()
QUANTUM *line1 = new QUANTUM[width() * depth() * sizeof(QUANTUM)];
QUANTUM *line2 = new QUANTUM[width() * depth() * sizeof(QUANTUM)];
KisTileMgrSP tm = new KisTileMgr(colorStrategy(), width(), height());
KisTileMgrSP tm = new KisTileMgr(colorStrategy() -> depth(), width(), height());
int cutoff = static_cast<int>(height()/2);
......@@ -565,7 +565,7 @@ void KisPaintDevice::mirrorY()
should too */
QUANTUM *pixel = new QUANTUM[depth() * sizeof(QUANTUM)]; // the right pixel
QUANTUM *line = new QUANTUM[width() * depth() * sizeof(QUANTUM)];
KisTileMgrSP tm = new KisTileMgr(colorStrategy(), width(), height());
KisTileMgrSP tm = new KisTileMgr(colorStrategy() -> depth(), width(), height());
int cutoff = static_cast<int>(width()/2);
for(int i = 0; i < height(); i++) {
......@@ -611,7 +611,7 @@ void KisPaintDevice::offsetBy(Q_INT32 x, Q_INT32 y)
y = 0;
KisTileMgrSP old = data();
KisTileMgrSP tm = new KisTileMgr(colorStrategy(), x + old -> width(), y + old -> height());
KisTileMgrSP tm = new KisTileMgr(colorStrategy() -> depth(), x + old -> width(), y + old -> height());
KisPixelDataSP dst;
KisPixelDataSP src;
......
......@@ -21,9 +21,10 @@
#include <qglobal.h>
#include <qmutex.h>
#include <qvaluevector.h>
#include <ksharedptr.h>
#include "kis_types.h"
#include <kdebug.h>
class KisTileCacheInterface;
class KisTileSwapInterface;
......
......@@ -26,20 +26,20 @@
#include "kistilemediator.h"
#include "kistilemgr.h"
KisTileMgr::KisTileMgr(KisStrategyColorSpaceSP colorStrategy, Q_UINT32 width, Q_UINT32 height) :
KisTileMgr::KisTileMgr(Q_UINT32 depth, Q_UINT32 width, Q_UINT32 height) :
m_depth ( depth ),
m_width ( width ),
m_height ( height ),
m_colorStrategy ( colorStrategy ),
m_ntileRows ( (height + TILE_HEIGHT - 1) / TILE_HEIGHT),
m_ntileCols ( (width + TILE_WIDTH - 1) / TILE_WIDTH ),
m_mediator ( new KisTileMediator )
{
}
KisTileMgr::KisTileMgr(KisTileMgr *tm, KisStrategyColorSpaceSP colorStrategy, Q_UINT32 width, Q_UINT32 height) :
KisTileMgr::KisTileMgr(KisTileMgr *tm, Q_UINT32 depth, Q_UINT32 width, Q_UINT32 height) :
m_depth ( depth ),
m_width ( width ),
m_height ( height ),
m_colorStrategy ( colorStrategy ),
m_ntileRows ( (height + TILE_HEIGHT - 1) / TILE_HEIGHT ),
m_ntileCols ( (width + TILE_WIDTH - 1) / TILE_WIDTH ),
m_mediator ( new KisTileMediator )
......@@ -53,7 +53,7 @@ KisTileMgr::KisTileMgr(const KisTileMgr& rhs) : KShared(rhs)
if (this != &rhs) {
m_width = rhs.m_width;
m_height = rhs.m_height;
m_colorStrategy = rhs.m_colorStrategy;
m_depth = rhs.m_depth;
m_ntileRows = rhs.m_ntileRows;
m_ntileCols = rhs.m_ntileCols;
m_mediator = new KisTileMediator;
......
......@@ -26,7 +26,6 @@
#include <ksharedptr.h>
#include "kistile.h"
#include "kis_types.h"
#include "kis_strategy_colorspace.h"
class QPoint;
struct KisPixelData;
......@@ -70,10 +69,10 @@ class KisTileMgr : public KShared {
public:
/**
Create a KisTileMgr of width and height with the specified
colour depth.
* Create a KisTileMgr of width and height with the specified
* colour depth.
*/
KisTileMgr(KisStrategyColorSpaceSP colorStrategy, Q_UINT32 width, Q_UINT32 height);
KisTileMgr(Q_UINT32 depth, Q_UINT32 width, Q_UINT32 height);
/**
Create a new KisTileMgr of width and height with the
......@@ -84,7 +83,7 @@ public:
than width and height, nor what happens when tm has a
different depth.
*/
KisTileMgr(KisTileMgr *tm, KisStrategyColorSpaceSP colorStrategy, Q_UINT32 width, Q_UINT32 height);
KisTileMgr(KisTileMgr *tm, Q_UINT32 depth, Q_UINT32 width, Q_UINT32 height);
/**
Creates a new KisTileMgr based on rhs, shares a reference
......@@ -173,20 +172,14 @@ public:
Q_UINT32 ncols() const;
/**
Color-depth of the KisRenderInterface implementation
managed by this KisTileMgr
* Depth in bytes (i.e., for now == channels) of a pixel
*/
Q_INT32 depth() const;
/** Return the color space that can interpret the data
*/
KisStrategyColorSpaceSP colorStrategy() const;
/**
Total size in memory the data managed by this KisTileMgr
*/
Q_UINT32 memSize();
/**
Puts the x/y coordinates of the top left (?) corner
......@@ -234,9 +227,9 @@ private:
KisTileSP invalidateTile(KisTileSP tile, Q_INT32 tilenum);
private:
Q_UINT32 m_depth;
Q_UINT32 m_width;
Q_UINT32 m_height;
KisStrategyColorSpaceSP m_colorStrategy;
Q_UINT32 m_ntileRows;
Q_UINT32 m_ntileCols;
vKisTileSP m_tiles;
......@@ -257,12 +250,7 @@ inline Q_INT32 KisTileMgr::height() const
inline Q_INT32 KisTileMgr::depth() const
{
return colorStrategy()->depth();
}
inline KisStrategyColorSpaceSP KisTileMgr::colorStrategy() const
{
return m_colorStrategy;
return m_depth;
}
inline Q_UINT32 KisTileMgr::nrows() const
......
KDE_OPTIONS = nofinal
INCLUDES = -I${srcdir}/dialogs -I$(srcdir)/../core -I$(srcdir)/../core/compositeop -I$(srcdir)/../core/color_strategy -I$(srcdir)/../core/tiles $(KOFFICE_INCLUDES) $(KOPAINTER_INCLUDES) $(all_includes)
INCLUDES = -I$(srcdir)/../core \
-I$(srcdir)/../core/compositeop \
-I$(srcdir)/../core/color_strategy \
-I$(srcdir)/../core/tiles \
-I$(builddir)/dialogs \
$(KOFFICE_INCLUDES) $(KOPAINTER_INCLUDES) $(all_includes)
noinst_LTLIBRARIES = libkisui.la
libkisui_la_LIBADD = ./labels/libkislabel.la ./dialogs/libkisdialogs.la ./widgets/libkiswidgets.la
......
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