本文整理汇总了C++中ContainerLayer::GetTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerLayer::GetTransform方法的具体用法?C++ ContainerLayer::GetTransform怎么用?C++ ContainerLayer::GetTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerLayer
的用法示例。
在下文中一共展示了ContainerLayer::GetTransform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTransform
gfxRect
ThebesLayerComposite::GetDisplayPort()
{
// We use GetTransform instead of GetEffectiveTransform in this function
// as we want the transform of the shadowable layers and not that of the
// shadow layers, which may have been modified due to async scrolling/
// zooming.
gfx3DMatrix transform = GetTransform();
// Find out the area of the nearest display-port to invalidate retained
// tiles.
gfxRect displayPort;
gfxSize parentResolution = GetEffectiveResolution();
for (ContainerLayer* parent = GetParent(); parent; parent = parent->GetParent()) {
const FrameMetrics& metrics = parent->GetFrameMetrics();
if (displayPort.IsEmpty()) {
if (!metrics.mDisplayPort.IsEmpty()) {
// We use the bounds to cut down on complication/computation time.
// This will be incorrect when the transform involves rotation, but
// it'd be quite hard to retain invalid tiles correctly in this
// situation anyway.
displayPort = gfxRect(metrics.mDisplayPort.x,
metrics.mDisplayPort.y,
metrics.mDisplayPort.width,
metrics.mDisplayPort.height);
displayPort.ScaleRoundOut(parentResolution.width, parentResolution.height);
}
parentResolution.width /= metrics.mResolution.scale;
parentResolution.height /= metrics.mResolution.scale;
}
if (parent->UseIntermediateSurface()) {
transform.PreMultiply(parent->GetTransform());
}
}
// If no display port was found, use the widget size from the layer manager.
if (displayPort.IsEmpty()) {
LayerManagerComposite* manager = static_cast<LayerManagerComposite*>(Manager());
const nsIntSize& widgetSize = manager->GetWidgetSize();
displayPort.width = widgetSize.width;
displayPort.height = widgetSize.height;
}
// Transform the display port into layer space.
displayPort = transform.Inverse().TransformBounds(displayPort);
return displayPort;
}