Skip to content

Commit

Permalink
Small clean up in host renderer and host renderer surface
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchodias committed Dec 4, 2024
1 parent 71bfb6e commit 4ba4190
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
35 changes: 29 additions & 6 deletions src/Bloc/BlHostRenderer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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
]
1 change: 1 addition & 0 deletions src/Bloc/BlHostRendererSurface.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,6 @@ BlHostRendererSurface >> shouldUpdateEveryFrame [

{ #category : #'api - updates' }
BlHostRendererSurface >> updateEveryFrame [

shouldUpdateEveryFrame := true
]

0 comments on commit 4ba4190

Please sign in to comment.