shithub: cstory

Download patch

ref: b821d86c911e230575d3d3d9e45f1690de5636a1
parent: d1a4203e8983629646e1a85949429be10483dced
author: Jacob Moody <moody@posixcafe.org>
date: Thu Dec 21 17:32:32 EST 2023

get Rect() out of the hot path

It was showing up on tprof.

--- a/src/Backends/Rendering/9front.cpp
+++ b/src/Backends/Rendering/9front.cpp
@@ -234,8 +234,11 @@
 {
 	Rectangle r, r2;
 
-	r = Rect(rect->left*scale, rect->top*scale, rect->right*scale, rect->bottom*scale);
-	r2 = Rect(x*scale, y*scale, (x*scale+Dx(r)), (y*scale+Dy(r)));
+	r.min = (Point){rect->left*scale, rect->top*scale};
+	r.max = (Point){rect->right*scale, rect->bottom*scale};
+
+	r2.min = (Point){x*scale, y*scale};
+	r2.max = (Point){x*scale+Dx(r), y*scale+Dy(r)};
 
 	if(colour_key && source_surface->dirty)
 		RenderBackend_CalcMask(source_surface);