After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754766 - "actor: Clean up transform_stage_point()" broke HiDPI mutter
"actor: Clean up transform_stage_point()" broke HiDPI mutter
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterActor
unspecified
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-09-09 10:01 UTC by Jonas Ådahl
Modified: 2015-09-11 02:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
actor: Fix transforming stage point when scale is less than 1 (2.21 KB, patch)
2015-09-10 09:05 UTC, Jonas Ådahl
committed Details | Review

Description Jonas Ådahl 2015-09-09 10:01:50 UTC
Regression testing shows that the commit "actor: Clean up transform_stage_point()" broke HiDPI in mutter. The problem being that clutter_actor_transform_stage_point() always returns the coordinates (0, 0) no matter the input when the actor scale is 0.5 (for example when a wl_surface with scale 2 is on a scale 1 output).

Reverting the mentioned patch fixes the issue.
Comment 1 Jonas Ådahl 2015-09-10 09:05:15 UTC
Created attachment 311043 [details] [review]
actor: Fix transforming stage point when scale is less than 1

The commit 6cd24faaa54de3246ca45d1c7426d8b7a74f71db (actor: Clean up
transform_stage_point()) changed the validation of the transformation
matrix to ignore the fraction part of the determinant. This caused
clutter_actor_transform_stage_point() to fail and return FALSE for
actors which scale was less than 1.

Previously the validation was ('det' being a float):
	det = (RQ[0][0] * ST[0][0])
	    + (RQ[0][1] * ST[0][1])
	    + (RQ[0][2] * ST[0][2]);
	if (!det)
		return FALSE;

Semantically, the if statement expression '!det' is equivalent to
'det == 0', i.e. 'det == 0.0f'. Post cleanup patches, 'det' was turned
into a double, and the if statement was changed to:

	if (CLUTTER_NEARBYINT (det) == 0)
		return FALSE;

which, different from before, rounds the determinant to the nearest
integer value, meaning anything determinant in the range (-0.5, 0.5)
would be considered invalid.

This patch reverts this part to the old behavior, while, because of the
inexact nature of floating point arithmetics, allowing a bit more liberal
meaning of "equals to 0" than '== 0.0'.
Comment 2 Emmanuele Bassi (:ebassi) 2015-09-10 10:10:52 UTC
Review of attachment 311043 [details] [review]:

Sounds good, thanks for hunting this down.
Comment 3 Jonas Ådahl 2015-09-11 02:38:51 UTC
Pushed with a fixed commit message typo (s/anything determinant/determinant/).

Attachment 311043 [details] pushed as 5d83260 - actor: Fix transforming stage point when scale is less than 1