Commit 68d59d5b authored by Boudewijn Rempt's avatar Boudewijn Rempt

Merged revisions 1108766,1108770,1108773 via svnmerge from

https://rempt@svn.kde.org/home/kde/trunk/koffice

........
  r1108766 | rempt | 2010-03-29 20:49:13 +0200 (Mon, 29 Mar 2010) | 1 line
  
  call endTransaction when beginTransaction is called
........
  r1108770 | berger | 2010-03-29 20:55:57 +0200 (Mon, 29 Mar 2010) | 7 lines
  
  Certainly not return rgb8, returning 0 act as a error code, returning
  an other color space would make a nightmare to debug, since the caller
  won't have the color space he wanted, keep going, and fails later at a
  place where it will not be suspected that the wrong color space is used
  
  CCMAIL: Boudewijn Rempt <boud@valdyas.org>
........
  r1108773 | rempt | 2010-03-29 21:04:20 +0200 (Mon, 29 Mar 2010) | 1 line
  
  Also delete the transactions
........

svn path=/branches/work/koffice-ko/; revision=1108775
parent 9420e5e2
......@@ -18,6 +18,7 @@
#include <qtest_kde.h>
#include <QUndoCommand>
#include "kis_benchmark_values.h"
#include "kis_paint_device.h"
......@@ -100,7 +101,7 @@ void KisFloodFillBenchmark::benchmarkFlood()
fillPainter.fillColor(1, 1, false);
dirty = fillPainter.dirtyRegion();
fillPainter.endTransaction();
delete fillPainter.endTransaction();
}
// uncomment this to see the output
......@@ -115,4 +116,4 @@ void KisFloodFillBenchmark::cleanupTestCase()
}
QTEST_KDEMAIN(KisFloodFillBenchmark, NoGUI)
#include "kis_floodfill_benchmark.moc"
\ No newline at end of file
#include "kis_floodfill_benchmark.moc"
......@@ -18,6 +18,7 @@
*/
#include <qtest_kde.h>
#include <QUndoCommand>
#include "kis_benchmark_values.h"
......@@ -77,7 +78,7 @@ void KisGradientBenchmark::benchmarkGradient()
fillPainter.paintGradient(QPointF(0,0), QPointF(3000,3000), KisGradientPainter::GradientShapeBiLinear, KisGradientPainter::GradientRepeatNone, true, false, 0, 0, GMP_IMAGE_WIDTH,GMP_IMAGE_HEIGHT);
dirty = fillPainter.dirtyRegion();
fillPainter.endTransaction();
delete fillPainter.endTransaction();
}
// uncomment this to see the output
......@@ -92,4 +93,4 @@ void KisGradientBenchmark::cleanupTestCase()
}
QTEST_KDEMAIN(KisGradientBenchmark, NoGUI)
#include "kis_gradient_benchmark.moc"
\ No newline at end of file
#include "kis_gradient_benchmark.moc"
......@@ -18,6 +18,8 @@
#include "kis_filter_selections_benchmark.h"
#include <QUndoCommand>
#include "kis_painter.h"
#include <qtest_kde.h>
......@@ -250,10 +252,11 @@ void KisFilterSelectionsBenchmark::testBitBltWOSelections(int num)
KisTransaction transac("", cacheDevice, 0);
m_filter->process(src, dst, filterRect.size(), m_configuration, 0);
KisPainter gc(projection);
gc.beginTransaction("");
gc.setCompositeOp(projection->colorSpace()->compositeOp(COMPOSITE_ALPHA_DARKEN));
gc.bitBlt(filterRect.topLeft(), cacheDevice, filterRect);
KisPainter painter(projection);
painter.beginTransaction("");
painter.setCompositeOp(projection->colorSpace()->compositeOp(COMPOSITE_ALPHA_DARKEN));
painter.bitBlt(filterRect.topLeft(), cacheDevice, filterRect);
delete painter.endTransaction();
}
avTime = double(timer.elapsed()) / num;
......
......@@ -18,6 +18,8 @@
#include "kis_simple_noise_reducer.h"
#include <QUndoCommand>
#include <KoColorSpace.h>
#include <KoCompositeOp.h>
#include <KoProgressUpdater.h>
......@@ -108,7 +110,8 @@ void KisSimpleNoiseReducer::process(KisConstProcessingInformation srcInfo,
KisConvolutionPainter painter(interm);
painter.beginTransaction("bouuh");
painter.applyMatrix(kernel, interm, srcTopLeft, dstTopLeft, size, BORDER_REPEAT);
delete painter.endTransaction();
if (progressUpdater && progressUpdater->interrupted()) {
return;
}
......
......@@ -21,6 +21,7 @@
#include "kis_unsharp_filter.h"
#include <QBitArray>
#include <QUndoCommand>
#include <kcombobox.h>
#include <knuminput.h>
......@@ -108,7 +109,8 @@ void KisUnsharpFilter::process(KisConstProcessingInformation src,
painter.setChannelFlags(channelFlags);
painter.beginTransaction("convolution step");
painter.applyMatrix(kernel, interm, src.topLeft(), dst.topLeft(), areaSize, BORDER_REPEAT);
delete painter.endTransaction();
if (progressUpdater && progressUpdater->interrupted()) {
return;
}
......
......@@ -28,6 +28,7 @@
#include <QApplication>
#include <QClipboard>
#include <QDesktopWidget>
#include <QUndoCommand>
#include <kcolorcombo.h>
#include <kis_debug.h>
......@@ -194,18 +195,17 @@ void KisCustomImageWidget::buttonClicked()
painter.begin(layer->paintDevice());
painter.beginTransaction("");
painter.fillRect(0, 0, width, height, bgColor, OPACITY_OPAQUE_U8);
painter.end();
delete painter.endTransaction();
}
if (chkFromClipboard->isChecked()) {
KisPaintDeviceSP clip = KisClipboard::instance()->clip(QPoint(0,0));
if (clip) {
QRect r = clip->exactBounds();
KisPainter gc;
gc.begin(layer->paintDevice());
gc.setCompositeOp(COMPOSITE_COPY);
gc.bitBlt(0, 0, clip, r.x(), r.y(), r.width(), r.height());
gc.end();
KisPainter painter;
painter.begin(layer->paintDevice());
painter.setCompositeOp(COMPOSITE_COPY);
painter.bitBlt(0, 0, clip, r.x(), r.y(), r.width(), r.height());
}
}
layer->setDirty(QRect(0, 0, width, height));
......
......@@ -324,7 +324,7 @@ const KoColorSpace * KoColorSpaceRegistry::colorSpace(const QString &csID, const
// We did our best, but still have no profile: and since csf->grabColorSpace
// needs the profile to find the colorspace, we have to give up.
if (!p) {
return 0; // XXX: maybe return rgb8?
return 0;
}
const KoColorSpace *cs = csf->grabColorSpace(p);
if (!cs) {
......
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