Make slideshow objects' debugging semi-transparency and shift conditional
It was introduced in commitcfd7bf7f6e
(INTEGRATION: CWS presfixes12 (1.1.2); FILE ADDED, 2007-07-17); and back then, it was guarded by VERBOSE define. The VERBOSE condition was replaced by OSL_DEBUG_LEVEL >= 2 condition later in commit912e36e911
(Remove VERBOSE part 3, 2012-04-10); and then, it was completely dropped in commite5ec630414
(stop inclduing canvas/verbosetraces.hxx and canvas/debug.hxx, 2015-08-11). But this code is definitely harmful by default, when an unaware developer (like myself) tries to debug an animation problem, and suddenly sees a very different problem in the debug build (the shift and transparency of objects), which obviously is a new regression in master, but it can't be bisected using bibisect repos, which makes you to question your sanity, until you realize that it must be some debug-only feature. Thorsten wrote on IRC: > the semi-transparency & shifting is needed for actually noticing > what's behind (shapes get moved to sprites, then erased from the > static canvas, then moved around) > so I believe it's useful debugging tools, but of course should not > randomly enable for normal dev builds So use environment variable to control this behavior-changing code. Change-Id: I493cdde26c95fdde4a5d542a0bdad8e329fdfda8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173965 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <eventqueue.hxx>
|
||||
#include <eventmultiplexer.hxx>
|
||||
#include <slideview.hxx>
|
||||
#include <tools.hxx>
|
||||
#include <delayevent.hxx>
|
||||
#include <unoview.hxx>
|
||||
|
||||
@@ -591,18 +592,17 @@ private:
|
||||
mpSprite->setPriority(
|
||||
maSpriteContainer.getLayerPriority().getMinimum() );
|
||||
|
||||
basegfx::B2DPoint pos(maLayerBoundsPixel.getMinimum());
|
||||
double alpha = 1.0;
|
||||
#if defined(DBG_UTIL)
|
||||
mpSprite->movePixel(
|
||||
basegfx::B2DPoint(maLayerBoundsPixel.getMinimum()) +
|
||||
basegfx::B2DPoint(10,10) );
|
||||
|
||||
mpSprite->setAlpha(0.5);
|
||||
#else
|
||||
mpSprite->movePixel(
|
||||
basegfx::B2DPoint(maLayerBoundsPixel.getMinimum()) );
|
||||
|
||||
mpSprite->setAlpha(1.0);
|
||||
if (isShowingMoreDebugInfo())
|
||||
{
|
||||
pos += basegfx::B2DPoint(10, 10);
|
||||
alpha = 0.5;
|
||||
}
|
||||
#endif
|
||||
mpSprite->movePixel(pos);
|
||||
mpSprite->setAlpha(alpha);
|
||||
mpSprite->show();
|
||||
}
|
||||
|
||||
|
@@ -776,6 +776,14 @@ namespace slideshow::internal
|
||||
basegfx::fround( aTmpRect.getRange().getX() ) + 1,
|
||||
basegfx::fround( aTmpRect.getRange().getY() ) + 1 );
|
||||
}
|
||||
|
||||
#if defined(DBG_UTIL)
|
||||
bool isShowingMoreDebugInfo()
|
||||
{
|
||||
static const bool bMoreInfo = getenv("SLIDESHOW_MORE_DEBUG_INFO") != nullptr;
|
||||
return bMoreInfo;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@@ -77,6 +77,10 @@ namespace slideshow
|
||||
return hash_value(val);
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(DBG_UTIL)
|
||||
bool isShowingMoreDebugInfo();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user