From aad3b189d32d131207118713b5d6a3bc1f8fa85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 20 Jun 2024 01:16:27 -0300 Subject: [PATCH] Small micro optimizations. --- src/eepp/scene/node.cpp | 2 +- src/eepp/scene/scenenode.cpp | 2 +- src/eepp/ui/doc/documentview.cpp | 2 +- src/eepp/ui/doc/syntaxhighlighter.cpp | 4 +++- src/eepp/ui/uinode.cpp | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/eepp/scene/node.cpp b/src/eepp/scene/node.cpp index 78f2a10f0..174151bcd 100644 --- a/src/eepp/scene/node.cpp +++ b/src/eepp/scene/node.cpp @@ -558,7 +558,7 @@ void Node::nodeDraw() { matrixSet(); - bool needsClipPlanes = isMeOrParentTreeScaledOrRotatedOrFrameBuffer(); + bool needsClipPlanes = isClipped() && isMeOrParentTreeScaledOrRotatedOrFrameBuffer(); clipStart( needsClipPlanes ); diff --git a/src/eepp/scene/scenenode.cpp b/src/eepp/scene/scenenode.cpp index 054e8d753..945854d8a 100644 --- a/src/eepp/scene/scenenode.cpp +++ b/src/eepp/scene/scenenode.cpp @@ -105,7 +105,7 @@ void SceneNode::draw() { matrixSet(); if ( NULL == mFrameBuffer || !usesInvalidation() || invalidated() ) { - bool needsClipPlanes = isMeOrParentTreeScaledOrRotatedOrFrameBuffer(); + bool needsClipPlanes = isClipped() && isMeOrParentTreeScaledOrRotatedOrFrameBuffer(); clipStart( needsClipPlanes ); diff --git a/src/eepp/ui/doc/documentview.cpp b/src/eepp/ui/doc/documentview.cpp index 0612ce338..be80fb66d 100644 --- a/src/eepp/ui/doc/documentview.cpp +++ b/src/eepp/ui/doc/documentview.cpp @@ -4,7 +4,7 @@ #include #include -#ifdef EE_DEBUG +#if 0 #define EE_VERIFY_STRUCTURAL_CONSISTENCY #endif diff --git a/src/eepp/ui/doc/syntaxhighlighter.cpp b/src/eepp/ui/doc/syntaxhighlighter.cpp index 27062e610..d4c9442f4 100644 --- a/src/eepp/ui/doc/syntaxhighlighter.cpp +++ b/src/eepp/ui/doc/syntaxhighlighter.cpp @@ -204,7 +204,9 @@ bool SyntaxHighlighter::updateDirty( int visibleLinesCount ) { mMaxWantedLine = 0; } else { bool changed = false; - Int64 max = eemax( 0LL, eemin( mFirstInvalidLine + visibleLinesCount, mMaxWantedLine ) ); + Int64 max = + eemax( 0LL, eemin( eemin( mFirstInvalidLine + visibleLinesCount, mMaxWantedLine ), + static_cast( mDoc->linesCount() - 1 ) ) ); for ( Int64 index = mFirstInvalidLine; index <= max; index++ ) { SyntaxState state; diff --git a/src/eepp/ui/uinode.cpp b/src/eepp/ui/uinode.cpp index 4bdb4187c..968bd339d 100644 --- a/src/eepp/ui/uinode.cpp +++ b/src/eepp/ui/uinode.cpp @@ -1063,7 +1063,8 @@ void UINode::nodeDraw() { matrixSet(); - bool needsClipPlanes = isMeOrParentTreeScaledOrRotatedOrFrameBuffer(); + bool needsClipPlanes = + mClip.getClipType() != ClipType::None && isMeOrParentTreeScaledOrRotatedOrFrameBuffer(); smartClipStart( ClipType::BorderBox, needsClipPlanes );