Optimize OpOver for RGBAF32
ClosedPublic

Authored by zachmann on Aug 27 2015, 2:40 PM.

Details

Reviewers
dkazakov
rempt
Group Reviewers
Calligra: 3.0
Summary

This optimizes OpOver for RGBAF32 by using vc

New tests and benchmarks for the code have been added.

Here is the result of the benchmark

QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() Testing Composite Op: "normal" ( "RGBF32 Legacy" )
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned Mask SrcRand DstRand" RESULT: 142 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "DstUnalig Mask SrcRand DstRand" RESULT: 142 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "SrcUnalig Mask SrcRand DstRand" RESULT: 143 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Unaligned Mask SrcRand DstRand" RESULT: 142 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned NoMask SrcRand DstRand" RESULT: 58 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned NoMask SrcZero DstRand" RESULT: 10 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned NoMask SrcUnit DstRand" RESULT: 22 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned NoMask SrcRand DstZero" RESULT: 48 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned NoMask SrcZero DstZero" RESULT: 9 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned NoMask SrcUnit DstZero" RESULT: 18 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned NoMask SrcRand DstUnit" RESULT: 22 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned NoMask SrcZero DstUnit" RESULT: 9 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverLegacy() "Aligned NoMask SrcUnit DstUnit" RESULT: 16 msec
PASS : KisCompositionBenchmark::testRgbF32CompositeOverLegacy()
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() Testing Composite Op: "normal" ( "RGBF32 Optimized" )
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned Mask SrcRand DstRand" RESULT: 16 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "DstUnalig Mask SrcRand DstRand" RESULT: 17 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "SrcUnalig Mask SrcRand DstRand" RESULT: 27 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Unaligned Mask SrcRand DstRand" RESULT: 27 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned NoMask SrcRand DstRand" RESULT: 17 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned NoMask SrcZero DstRand" RESULT: 4 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned NoMask SrcUnit DstRand" RESULT: 13 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned NoMask SrcRand DstZero" RESULT: 16 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned NoMask SrcZero DstZero" RESULT: 4 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned NoMask SrcUnit DstZero" RESULT: 12 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned NoMask SrcRand DstUnit" RESULT: 13 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned NoMask SrcZero DstUnit" RESULT: 4 msec
QDEBUG : KisCompositionBenchmark::testRgbF32CompositeOverOptimized() "Aligned NoMask SrcUnit DstUnit" RESULT: 12 msec
PASS : KisCompositionBenchmark::testRgbF32CompositeOverOptimized()

Diff Detail

Repository
R8 Calligra
Lint
Lint Skipped
Unit
Unit Tests Skipped
zachmann updated this revision to Diff 621.Aug 27 2015, 2:40 PM
zachmann retitled this revision from to Optimize OpOver for RGBAF32.
zachmann updated this object.
zachmann edited the test plan for this revision. (Show Details)
zachmann added reviewers: Calligra: 3.0, rempt, dkazakov.
zachmann set the repository for this revision to R8 Calligra.
zachmann added a project: Calligra: 3.0.
dkazakov requested changes to this revision.Aug 28 2015, 11:15 AM
dkazakov edited edge metadata.

Hi, Thorsten!

There is some bug with alignment or chunk sizes, which causes Krita to crash while painting. Here is the output of valgrind:

==27861== Thread 9 Thread (pooled):
==27861== Invalid read of size 4
==27861==    at 0xB9D028D: void KoStreamedMath<(Vc::Implementation)6>::genericComposite<false, false, OverCompositor128<float, unsigned int, false, true>, 16>(KoCompositeOp::ParameterInfo const&) (KoOptimizedCompositeOpOver128.h:159)
==27861==    by 0xB9D09DC: KoOptimizedCompositeOpOver128<(Vc::Implementation)6>::composite(KoCompositeOp::ParameterInfo const&) const (KoStreamedMath.h:385)
==27861==    by 0xB8E369D: KoColorSpace::bitBlt(KoColorSpace const*, KoCompositeOp::ParameterInfo const&, KoCompositeOp const*, KoColorConversionTransformation::Intent, QFlags<KoColorConversionTransformation::ConversionFlag>) const (KoColorSpace.cpp:299)
==27861==    by 0x89C1588: void KisPainter::bitBltImpl<false>(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:701)
==27861==    by 0x89B8C64: KisPainter::bitBlt(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:723)
==27861==    by 0x89BC18E: KisPainter::bitBlt(QPoint const&, KisSharedPtr<KisPaintDevice>, QRect const&) (kis_painter.cc:729)
==27861==    by 0x8B8CE8F: KisPaintLayer::copyOriginalToProjection(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&) const (kis_paint_layer.cc:123)
==27861==    by 0x8B2B792: KisLayer::applyMasks(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&, KisSharedPtr<KisNode>, KisSharedPtr<KisNode>) const (kis_layer.cc:567)
==27861==    by 0x8B2C20E: KisLayer::updateProjection(QRect const&, KisSharedPtr<KisNode>) (kis_layer.cc:657)
==27861==    by 0x8B32B60: KisLayerProjectionPlane::recalculate(QRect const&, KisSharedPtr<KisNode>) (kis_layer_projection_plane.cpp:47)
==27861==    by 0x8ADDB7B: KisAsyncMerger::startMerge(KisBaseRectsWalker&, bool) (kis_async_merger.cpp:248)
==27861==    by 0x897CCF4: KisUpdateJobItem::run() (kis_update_job_item.h:77)
==27861==  Address 0x3da6f94c is 12 bytes after a block of size 65,536 alloc'd
==27861==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27861==    by 0x89803D2: KisTileData::KisTileData(KisTileData const&, bool) (kis_tile_data.cc:77)
==27861==    by 0x89829A5: KisTileDataStore::duplicateTileData(KisTileData*) (kis_tile_data_store.cc:166)
==27861==    by 0x897E79C: KisTile::lockForWrite() (kis_tile_data.h:88)
==27861==    by 0x898A249: KisTiledDataManager::writeBytesBody(unsigned char const*, int, int, int, int, int) (kis_tile_data_wrapper.h:62)
==27861==    by 0x898A68B: KisTiledDataManager::writeBytes(unsigned char const*, int, int, int, int, int) (kis_tiled_data_manager.cc:717)
==27861==    by 0x8B7BD6F: KisPaintDevice::Private::KisPaintDeviceStrategy::writeBytesImpl(unsigned char const*, QRect const&, int) (kis_datamanager.h:277)
==27861==    by 0x8B769B4: KisPaintDevice::writeBytes(unsigned char const*, int, int, int, int) (kis_paint_device.cc:1102)
==27861==    by 0x89B1FB2: KisPainter::bltFixed(int, int, KisSharedPtr<KisFixedPaintDevice>, int, int, int, int) (kis_painter.cc:906)
==27861==    by 0x89B715E: KisPainter::bltFixed(QPoint const&, KisSharedPtr<KisFixedPaintDevice>, QRect const&) (kis_painter.cc:916)
==27861==    by 0x286DE10E: KisBrushOp::paintAt(KisPaintInformation const&) (kis_brushop.cpp:154)
==27861==    by 0x89C6CAB: void KisPaintOpUtils::paintLine<KisPaintOp>(KisPaintOp&, KisPaintInformation const&, KisPaintInformation const&, KisDistanceInformation*, bool, double) (kis_paint_information.h:110)
==27861== 
==27861== Invalid read of size 4
==27861==    at 0xB9D029A: void KoStreamedMath<(Vc::Implementation)6>::genericComposite<false, false, OverCompositor128<float, unsigned int, false, true>, 16>(KoCompositeOp::ParameterInfo const&) (KoOptimizedCompositeOpOver128.h:175)
==27861==    by 0xB9D09DC: KoOptimizedCompositeOpOver128<(Vc::Implementation)6>::composite(KoCompositeOp::ParameterInfo const&) const (KoStreamedMath.h:385)
==27861==    by 0xB8E369D: KoColorSpace::bitBlt(KoColorSpace const*, KoCompositeOp::ParameterInfo const&, KoCompositeOp const*, KoColorConversionTransformation::Intent, QFlags<KoColorConversionTransformation::ConversionFlag>) const (KoColorSpace.cpp:299)
==27861==    by 0x89C1588: void KisPainter::bitBltImpl<false>(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:701)
==27861==    by 0x89B8C64: KisPainter::bitBlt(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:723)
==27861==    by 0x89BC18E: KisPainter::bitBlt(QPoint const&, KisSharedPtr<KisPaintDevice>, QRect const&) (kis_painter.cc:729)
==27861==    by 0x8B8CE8F: KisPaintLayer::copyOriginalToProjection(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&) const (kis_paint_layer.cc:123)
==27861==    by 0x8B2B792: KisLayer::applyMasks(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&, KisSharedPtr<KisNode>, KisSharedPtr<KisNode>) const (kis_layer.cc:567)
==27861==    by 0x8B2C20E: KisLayer::updateProjection(QRect const&, KisSharedPtr<KisNode>) (kis_layer.cc:657)
==27861==    by 0x8B32B60: KisLayerProjectionPlane::recalculate(QRect const&, KisSharedPtr<KisNode>) (kis_layer_projection_plane.cpp:47)
==27861==    by 0x8ADDB7B: KisAsyncMerger::startMerge(KisBaseRectsWalker&, bool) (kis_async_merger.cpp:248)
==27861==    by 0x897CCF4: KisUpdateJobItem::run() (kis_update_job_item.h:77)
==27861==  Address 0x40f7c13c is not stack'd, malloc'd or (recently) free'd
==27861== 
==27861== Invalid read of size 8
==27861==    at 0xB9D0262: void KoStreamedMath<(Vc::Implementation)6>::genericComposite<false, false, OverCompositor128<float, unsigned int, false, true>, 16>(KoCompositeOp::ParameterInfo const&) (KoStreamedMath.h:432)
==27861==    by 0xB9D09DC: KoOptimizedCompositeOpOver128<(Vc::Implementation)6>::composite(KoCompositeOp::ParameterInfo const&) const (KoStreamedMath.h:385)
==27861==    by 0xB8E369D: KoColorSpace::bitBlt(KoColorSpace const*, KoCompositeOp::ParameterInfo const&, KoCompositeOp const*, KoColorConversionTransformation::Intent, QFlags<KoColorConversionTransformation::ConversionFlag>) const (KoColorSpace.cpp:299)
==27861==    by 0x89C1588: void KisPainter::bitBltImpl<false>(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:701)
==27861==    by 0x89B8C64: KisPainter::bitBlt(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:723)
==27861==    by 0x89BC18E: KisPainter::bitBlt(QPoint const&, KisSharedPtr<KisPaintDevice>, QRect const&) (kis_painter.cc:729)
==27861==    by 0x8B8CE8F: KisPaintLayer::copyOriginalToProjection(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&) const (kis_paint_layer.cc:123)
==27861==    by 0x8B2B792: KisLayer::applyMasks(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&, KisSharedPtr<KisNode>, KisSharedPtr<KisNode>) const (kis_layer.cc:567)
==27861==    by 0x8B2C20E: KisLayer::updateProjection(QRect const&, KisSharedPtr<KisNode>) (kis_layer.cc:657)
==27861==    by 0x8B32B60: KisLayerProjectionPlane::recalculate(QRect const&, KisSharedPtr<KisNode>) (kis_layer_projection_plane.cpp:47)
==27861==    by 0x8ADDB7B: KisAsyncMerger::startMerge(KisBaseRectsWalker&, bool) (kis_async_merger.cpp:248)
==27861==    by 0x897CCF4: KisUpdateJobItem::run() (kis_update_job_item.h:77)
==27861==  Address 0x410cf5f0 is not stack'd, malloc'd or (recently) free'd
==27861== 
==27861== Invalid write of size 8
==27861==    at 0xB9D0265: void KoStreamedMath<(Vc::Implementation)6>::genericComposite<false, false, OverCompositor128<float, unsigned int, false, true>, 16>(KoCompositeOp::ParameterInfo const&) (KoStreamedMath.h:432)
==27861==    by 0xB9D09DC: KoOptimizedCompositeOpOver128<(Vc::Implementation)6>::composite(KoCompositeOp::ParameterInfo const&) const (KoStreamedMath.h:385)
==27861==    by 0xB8E369D: KoColorSpace::bitBlt(KoColorSpace const*, KoCompositeOp::ParameterInfo const&, KoCompositeOp const*, KoColorConversionTransformation::Intent, QFlags<KoColorConversionTransformation::ConversionFlag>) const (KoColorSpace.cpp:299)
==27861==    by 0x89C1588: void KisPainter::bitBltImpl<false>(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:701)
==27861==    by 0x89B8C64: KisPainter::bitBlt(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:723)
==27861==    by 0x89BC18E: KisPainter::bitBlt(QPoint const&, KisSharedPtr<KisPaintDevice>, QRect const&) (kis_painter.cc:729)
==27861==    by 0x8B8CE8F: KisPaintLayer::copyOriginalToProjection(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&) const (kis_paint_layer.cc:123)
==27861==    by 0x8B2B792: KisLayer::applyMasks(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&, KisSharedPtr<KisNode>, KisSharedPtr<KisNode>) const (kis_layer.cc:567)
==27861==    by 0x8B2C20E: KisLayer::updateProjection(QRect const&, KisSharedPtr<KisNode>) (kis_layer.cc:657)
==27861==    by 0x8B32B60: KisLayerProjectionPlane::recalculate(QRect const&, KisSharedPtr<KisNode>) (kis_layer_projection_plane.cpp:47)
==27861==    by 0x8ADDB7B: KisAsyncMerger::startMerge(KisBaseRectsWalker&, bool) (kis_async_merger.cpp:248)
==27861==    by 0x897CCF4: KisUpdateJobItem::run() (kis_update_job_item.h:77)
==27861==  Address 0x40f7c130 is not stack'd, malloc'd or (recently) free'd
==27861== 
==27861== Invalid read of size 8
==27861==    at 0xB9D0268: void KoStreamedMath<(Vc::Implementation)6>::genericComposite<false, false, OverCompositor128<float, unsigned int, false, true>, 16>(KoCompositeOp::ParameterInfo const&) (KoStreamedMath.h:433)
==27861==    by 0xB9D09DC: KoOptimizedCompositeOpOver128<(Vc::Implementation)6>::composite(KoCompositeOp::ParameterInfo const&) const (KoStreamedMath.h:385)
==27861==    by 0xB8E369D: KoColorSpace::bitBlt(KoColorSpace const*, KoCompositeOp::ParameterInfo const&, KoCompositeOp const*, KoColorConversionTransformation::Intent, QFlags<KoColorConversionTransformation::ConversionFlag>) const (KoColorSpace.cpp:299)
==27861==    by 0x89C1588: void KisPainter::bitBltImpl<false>(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:701)
==27861==    by 0x89B8C64: KisPainter::bitBlt(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:723)
==27861==    by 0x89BC18E: KisPainter::bitBlt(QPoint const&, KisSharedPtr<KisPaintDevice>, QRect const&) (kis_painter.cc:729)
==27861==    by 0x8B8CE8F: KisPaintLayer::copyOriginalToProjection(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&) const (kis_paint_layer.cc:123)
==27861==    by 0x8B2B792: KisLayer::applyMasks(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&, KisSharedPtr<KisNode>, KisSharedPtr<KisNode>) const (kis_layer.cc:567)
==27861==    by 0x8B2C20E: KisLayer::updateProjection(QRect const&, KisSharedPtr<KisNode>) (kis_layer.cc:657)
==27861==    by 0x8B32B60: KisLayerProjectionPlane::recalculate(QRect const&, KisSharedPtr<KisNode>) (kis_layer_projection_plane.cpp:47)
==27861==    by 0x8ADDB7B: KisAsyncMerger::startMerge(KisBaseRectsWalker&, bool) (kis_async_merger.cpp:248)
==27861==    by 0x897CCF4: KisUpdateJobItem::run() (kis_update_job_item.h:77)
==27861==  Address 0x410cf5f8 is not stack'd, malloc'd or (recently) free'd
==27861== 
==27861== Invalid write of size 8
==27861==    at 0xB9D026C: void KoStreamedMath<(Vc::Implementation)6>::genericComposite<false, false, OverCompositor128<float, unsigned int, false, true>, 16>(KoCompositeOp::ParameterInfo const&) (KoStreamedMath.h:433)
==27861==    by 0xB9D09DC: KoOptimizedCompositeOpOver128<(Vc::Implementation)6>::composite(KoCompositeOp::ParameterInfo const&) const (KoStreamedMath.h:385)
==27861==    by 0xB8E369D: KoColorSpace::bitBlt(KoColorSpace const*, KoCompositeOp::ParameterInfo const&, KoCompositeOp const*, KoColorConversionTransformation::Intent, QFlags<KoColorConversionTransformation::ConversionFlag>) const (KoColorSpace.cpp:299)
==27861==    by 0x89C1588: void KisPainter::bitBltImpl<false>(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:701)
==27861==    by 0x89B8C64: KisPainter::bitBlt(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:723)
==27861==    by 0x89BC18E: KisPainter::bitBlt(QPoint const&, KisSharedPtr<KisPaintDevice>, QRect const&) (kis_painter.cc:729)
==27861==    by 0x8B8CE8F: KisPaintLayer::copyOriginalToProjection(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&) const (kis_paint_layer.cc:123)
==27861==    by 0x8B2B792: KisLayer::applyMasks(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&, KisSharedPtr<KisNode>, KisSharedPtr<KisNode>) const (kis_layer.cc:567)
==27861==    by 0x8B2C20E: KisLayer::updateProjection(QRect const&, KisSharedPtr<KisNode>) (kis_layer.cc:657)
==27861==    by 0x8B32B60: KisLayerProjectionPlane::recalculate(QRect const&, KisSharedPtr<KisNode>) (kis_layer_projection_plane.cpp:47)
==27861==    by 0x8ADDB7B: KisAsyncMerger::startMerge(KisBaseRectsWalker&, bool) (kis_async_merger.cpp:248)
==27861==    by 0x897CCF4: KisUpdateJobItem::run() (kis_update_job_item.h:77)
==27861==  Address 0x40f7c138 is not stack'd, malloc'd or (recently) free'd
==27861== 
==27861== Invalid write of size 4
==27861==    at 0xB9D0270: void KoStreamedMath<(Vc::Implementation)6>::genericComposite<false, false, OverCompositor128<float, unsigned int, false, true>, 16>(KoCompositeOp::ParameterInfo const&) (KoOptimizedCompositeOpOver128.h:231)
==27861==    by 0xB9D09DC: KoOptimizedCompositeOpOver128<(Vc::Implementation)6>::composite(KoCompositeOp::ParameterInfo const&) const (KoStreamedMath.h:385)
==27861==    by 0xB8E369D: KoColorSpace::bitBlt(KoColorSpace const*, KoCompositeOp::ParameterInfo const&, KoCompositeOp const*, KoColorConversionTransformation::Intent, QFlags<KoColorConversionTransformation::ConversionFlag>) const (KoColorSpace.cpp:299)
==27861==    by 0x89C1588: void KisPainter::bitBltImpl<false>(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:701)
==27861==    by 0x89B8C64: KisPainter::bitBlt(int, int, KisSharedPtr<KisPaintDevice>, int, int, int, int) (kis_painter.cc:723)
==27861==    by 0x89BC18E: KisPainter::bitBlt(QPoint const&, KisSharedPtr<KisPaintDevice>, QRect const&) (kis_painter.cc:729)
==27861==    by 0x8B8CE8F: KisPaintLayer::copyOriginalToProjection(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&) const (kis_paint_layer.cc:123)
==27861==    by 0x8B2B792: KisLayer::applyMasks(KisSharedPtr<KisPaintDevice>, KisSharedPtr<KisPaintDevice>, QRect const&, KisSharedPtr<KisNode>, KisSharedPtr<KisNode>) const (kis_layer.cc:567)
==27861==    by 0x8B2C20E: KisLayer::updateProjection(QRect const&, KisSharedPtr<KisNode>) (kis_layer.cc:657)
==27861==    by 0x8B32B60: KisLayerProjectionPlane::recalculate(QRect const&, KisSharedPtr<KisNode>) (kis_layer_projection_plane.cpp:47)
==27861==    by 0x8ADDB7B: KisAsyncMerger::startMerge(KisBaseRectsWalker&, bool) (kis_async_merger.cpp:248)
==27861==    by 0x897CCF4: KisUpdateJobItem::run() (kis_update_job_item.h:77)
==27861==  Address 0x40f7c13c is not stack'd, malloc'd or (recently) free'd
==27861==
This revision now requires changes to proceed.Aug 28 2015, 11:15 AM
zachmann updated this revision to Diff 637.Aug 29 2015, 4:28 AM
zachmann edited edge metadata.

Fixed the bug Dmitry has found. After updating to lastest 2.9 I also got the chrash and could fix the problem. The calculation of the different blocks was wrong in genericComposite if the blockAlign was bigger then the cols available. So this is checked now and correctly handled.

rempt edited edge metadata.Aug 31 2015, 9:26 AM

I don't get any crashes anymore.

dkazakov accepted this revision.Aug 31 2015, 11:39 AM
dkazakov edited edge metadata.

With the following patch applied the patch is ok to be pushed to 2.9:

http://nonaynever.ru/pub/krita_f32_fixes.diff

libs/pigment/compositeops/KoOptimizedCompositeOpOver128.h
86

The mask is still quint8, so it should be actually:

const float uint8Rec1 = 1.0 / 255.0;

Right now it breaks painting when any selection is active.

153

Same here:

const float uint8Rec1 = 1.0 / 255.0;

159

And here :) Opacity is 0...1.0

This revision is now accepted and ready to land.Aug 31 2015, 11:39 AM
rempt accepted this revision.Sep 4 2015, 6:52 PM
rempt edited edge metadata.
zachmann closed this revision.Feb 17 2016, 5:09 AM