From 4ba419045a746bb3effc3012d124f9e0fc61d75c Mon Sep 17 00:00:00 2001 From: Martin Dias Date: Wed, 4 Dec 2024 16:50:21 -0300 Subject: [PATCH] Small clean up in host renderer and host renderer surface --- src/Bloc/BlHostRenderer.class.st | 35 ++++++++++++++++++++----- src/Bloc/BlHostRendererSurface.class.st | 1 + 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/Bloc/BlHostRenderer.class.st b/src/Bloc/BlHostRenderer.class.st index 25d3e8d59..817360a56 100644 --- a/src/Bloc/BlHostRenderer.class.st +++ b/src/Bloc/BlHostRenderer.class.st @@ -137,15 +137,13 @@ BlHostRenderer >> render: aHostSpace [ Note: if there are no dirty areas nothing will happen, including window or canvas update." - | aSpace shouldUpdateEveryFrame isRenderNeeded | + | aSpace isRenderNeeded | + self isValid ifFalse: [ ^ self ]. + aSpace := aHostSpace space. - shouldUpdateEveryFrame := surface shouldUpdateEveryFrame. isRenderNeeded := aSpace hasDirtyElements. - (shouldUpdateEveryFrame or: [ isRenderNeeded ]) - ifFalse: [ ^ self ]. - - self isValid + (surface shouldUpdateEveryFrame or: [ isRenderNeeded ]) ifFalse: [ ^ self ]. [ | theDamagedRectangles | @@ -158,5 +156,30 @@ BlHostRenderer >> render: aHostSpace [ surface performUpdates. surfaceRenderer renderSurface: surface damaged: theDamagedRectangles ] + ensure: [ self finishedRender: aSpace ] ] + +{ #category : #accessing } +BlHostRenderer >> spaceRenderer [ + + ^ spaceRenderer +] + +{ #category : #accessing } +BlHostRenderer >> surface [ + + ^ surface +] + +{ #category : #accessing } +BlHostRenderer >> surfaceRenderer [ + + ^ surfaceRenderer +] + +{ #category : #accessing } +BlHostRenderer >> textMeasurer [ + + ^ textMeasurer +] diff --git a/src/Bloc/BlHostRendererSurface.class.st b/src/Bloc/BlHostRendererSurface.class.st index 55f1378d6..ba197d0e3 100644 --- a/src/Bloc/BlHostRendererSurface.class.st +++ b/src/Bloc/BlHostRendererSurface.class.st @@ -135,5 +135,6 @@ BlHostRendererSurface >> shouldUpdateEveryFrame [ { #category : #'api - updates' } BlHostRendererSurface >> updateEveryFrame [ + shouldUpdateEveryFrame := true ]