You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
setColorProfile() silently discards mGamma and mDitherMode: the warning checks two of the four fields it clears #4331
So a caller who set options.mGamma = 2.2f, or options.mDitherMode = BINARY_DITHER, and left correction and temperature alone, has those silently discarded.
That is the failure mode the comment directly above the guard exists to prevent:
Warn only once validation has passed. Warning earlier consumed mWarnedLegacyCleared on a profile that was then rejected, and clearColorProfile() leaves mCorrection/mTemperature alone -- so the next valid profile cleared the caller's legacy settings silently.
The bug class is named in the comment; the condition just enumerates two of the four fields. The message is incomplete for the same reason — it says "correction/temperature" while clearing gamma and dither too.
Contract
#4034 C8.4 requires a one-time warning on transition, and #4156 R9 asked specifically for this:
Include existing ChannelOptions::mGamma in the managed-mode compatibility policy, alongside correction/temperature/dither, so a legacy default cannot add unintended shaping.
The policy exists. Two of the four fields are outside it.
The reverse direction has the same shape
setLegacyCorrection() and setLegacyTemperature() both call warnProfileCleared(); clearColorProfile();. There is no equivalent for gamma or dither because they are bare public fields — options.mGamma = 2.2f after a profile binds re-establishes legacy shaping with no warning and no profile clearing, where the same assignment to mCorrection via its setter would clear the profile.
That half is an API question (whether those fields grow setters) rather than a defect in an existing guard, so it is worth separating from the fix above.
Fix
Extend the condition to the fields actually cleared, and say so in the message. No behaviour change beyond a warning that should already have fired.
Activity
fix(channels): warn when a profile clears the caller's gamma (#4331)
fix(channels): warn when a profile clears the caller's gamma (#4331) (#…