Small micro optimizations.

This commit is contained in:
Martín Lucas Golini
2024-06-20 01:16:27 -03:00
parent b4917bf604
commit aad3b189d3
5 changed files with 8 additions and 5 deletions

View File

@@ -558,7 +558,7 @@ void Node::nodeDraw() {
matrixSet();
bool needsClipPlanes = isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
bool needsClipPlanes = isClipped() && isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
clipStart( needsClipPlanes );

View File

@@ -105,7 +105,7 @@ void SceneNode::draw() {
matrixSet();
if ( NULL == mFrameBuffer || !usesInvalidation() || invalidated() ) {
bool needsClipPlanes = isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
bool needsClipPlanes = isClipped() && isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
clipStart( needsClipPlanes );

View File

@@ -4,7 +4,7 @@
#include <eepp/system/scopedop.hpp>
#include <eepp/ui/doc/documentview.hpp>
#ifdef EE_DEBUG
#if 0
#define EE_VERIFY_STRUCTURAL_CONSISTENCY
#endif

View File

@@ -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<Int64>( mDoc->linesCount() - 1 ) ) );
for ( Int64 index = mFirstInvalidLine; index <= max; index++ ) {
SyntaxState state;

View File

@@ -1063,7 +1063,8 @@ void UINode::nodeDraw() {
matrixSet();
bool needsClipPlanes = isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
bool needsClipPlanes =
mClip.getClipType() != ClipType::None && isMeOrParentTreeScaledOrRotatedOrFrameBuffer();
smartClipStart( ClipType::BorderBox, needsClipPlanes );