Public Member Functions

nsDisplayOpacity Class Reference

The standard display item to paint a stacking context with translucency set by the stacking context root frame's 'opacity' style. More...

#include <nsDisplayList.h>

Inheritance diagram for nsDisplayOpacity:
Collaboration diagram for nsDisplayOpacity:

List of all members.

Public Member Functions

 nsDisplayOpacity (nsIFrame *aFrame, nsDisplayList *aList)
virtual Type GetType ()
 Some consecutive items should be rendered together as a unit, e.g., outlines for the same element.
virtual PRBool IsOpaque (nsDisplayListBuilder *aBuilder)
virtual void Paint (nsDisplayListBuilder *aBuilder, nsIRenderingContext *aCtx)
 Actually paint this item to some rendering context.
virtual PRBool ComputeVisibility (nsDisplayListBuilder *aBuilder, nsRegion *aVisibleRegion, nsRegion *aVisibleRegionBeforeMove)
 On entry, aVisibleRegion contains the region (relative to ReferenceFrame()) which may be visible.
virtual PRBool TryMerge (nsDisplayListBuilder *aBuilder, nsDisplayItem *aItem)
 Try to merge with the other item (which is below us in the display list).

Detailed Description

The standard display item to paint a stacking context with translucency set by the stacking context root frame's 'opacity' style.


Constructor & Destructor Documentation

nsDisplayOpacity::nsDisplayOpacity ( nsIFrame *  aFrame,
nsDisplayList aList 
)

Member Function Documentation

virtual PRBool nsDisplayOpacity::ComputeVisibility ( nsDisplayListBuilder aBuilder,
nsRegion aVisibleRegion,
nsRegion aVisibleRegionBeforeMove 
) [virtual]

On entry, aVisibleRegion contains the region (relative to ReferenceFrame()) which may be visible.

If the display item opaquely covers an area, it can remove that area from aVisibleRegion before returning. If we're doing scroll analysis with moving frames, then aVisibleRegionBeforeMove will be non-null and contains the region that would have been visible before the move. aVisibleRegion contains the region that is visible after the move. nsDisplayList::ComputeVisibility automatically subtracts the bounds of items that return true from IsOpaque(), and automatically removes items whose bounds do not intersect the visible area, so implementations of nsDisplayItem::ComputeVisibility do not need to do these things. nsDisplayList::ComputeVisibility will already have set mVisibleRect on this item to the intersection of *aVisibleRegion (unioned with *aVisibleRegionBeforeMove, if that's non-null) and this item's bounds.

Returns:
PR_TRUE if the item is visible, PR_FALSE if no part of the item is visible

Reimplemented from nsDisplayWrapList.

virtual Type nsDisplayOpacity::GetType (  )  [inline, virtual]

Some consecutive items should be rendered together as a unit, e.g., outlines for the same element.

For this, we need a way for items to identify their type.

Reimplemented from nsDisplayWrapList.

virtual PRBool nsDisplayOpacity::IsOpaque ( nsDisplayListBuilder aBuilder  )  [virtual]
Returns:
PR_TRUE if the item is definitely opaque --- i.e., paints every pixel within its bounds opaquely

Reimplemented from nsDisplayWrapList.

virtual void nsDisplayOpacity::Paint ( nsDisplayListBuilder aBuilder,
nsIRenderingContext *  aCtx 
) [virtual]

Actually paint this item to some rendering context.

Content outside mVisibleRect need not be painted.

Reimplemented from nsDisplayWrapList.

virtual PRBool nsDisplayOpacity::TryMerge ( nsDisplayListBuilder aBuilder,
nsDisplayItem aItem 
) [virtual]

Try to merge with the other item (which is below us in the display list).

This gets used by nsDisplayClip to coalesce clipping operations (optimization), by nsDisplayOpacity to merge rendering for the same content element into a single opacity group (correctness), and will be used by nsDisplayOutline to merge multiple outlines for the same element (also for correctness).

Returns:
PR_TRUE if the merge was successful and the other item should be deleted

Reimplemented from nsDisplayWrapList.


The documentation for this class was generated from the following file: