2.2.7.32 MILCMD_VISUAL_SETCONTEXTUALIZEDOPACITY

The MILCMD_VISUAL_SETCONTEXTUALIZEDOPACITY packet instructs the composition engine how to treat opacity modifiying rendering parameters.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

messageSize

controlCode

targetResource

ContextualizedOpacity

messageSize (4 bytes): A 32-bit unsigned integer. The size of this message in bytes. The value of this field MUST be set to 0x00000010.

controlCode (4 bytes): A 32-bit unsigned integer containing the control code for this message. The value of this field MUST be equal to 0x00000028.

targetResource (4 bytes): A 32-bit unsigned integer. The value of this field MUST be set to a valid resource handle referencing a resource of type TYPE_VISUAL or TYPE_WINDOWNODE. This handle identifies the resource that is the target for this message.

ContextualizedOpacity (4 bytes): A 32-bit integer Boolean value. If true, the composition engine will establish an opacity modification context based upon the type of the render target being used and the extra modification supplied with the request to update the content of the render target (see the IncludeCursors field in MILCMD_METABITMAPRENDERTARGET_CAPTUREBITS).

When the ContextualizedOpacity field is set to TRUE, the server MUST determine the opacity of the visual using the following algorithm.

  • If the render target requires cursors--that is, if the meta bitmap render target has IncludeCursors set to 0x1 using the MILCMD_METABITMAPRENDERTARGET_CAPTUREBITS message:

    • If the visual has been activated in a capture render pass using MILCMD_VISUAL_SETRENDERFORCAPTURE, the ContextualizedOpacityMultiplier rendering parameter for the specified visual will be used to derive the effective opacity of the visual.

    • If the visual has not been activated in a capture render pass, its opacity will be determined by the original opacity of the node (set using the MILCMD_VISUAL_SETALPHA message) as follows:

      • If the opacity was originally set to zero, the opacity MUST be set to 1.0. (The visual MUST be made fully opaque.)

      • If the opacity was originally set to a nonzero value, the original opacity value will be preserved.

  • If the render target does not require cursors (this is the default case), the ContextualizedOpacityMultiplier rendering parameter of the specified visual MUST be used to derive the effective opacity of the node.