mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1150774 (Part 1) - Add helpers to simplify using typed units in ConfigureLayer. r=botond
This commit is contained in:
parent
7e5ca15a1a
commit
5217e8f84f
@ -86,17 +86,28 @@ struct ContainerLayerParameters {
|
||||
, mDisableSubpixelAntialiasingInDescendants(aParent.mDisableSubpixelAntialiasingInDescendants)
|
||||
, mInLowPrecisionDisplayPort(aParent.mInLowPrecisionDisplayPort)
|
||||
{}
|
||||
|
||||
float mXScale, mYScale;
|
||||
|
||||
LayoutDeviceToLayerScale2D Scale() const {
|
||||
return LayoutDeviceToLayerScale2D(mXScale, mYScale);
|
||||
}
|
||||
|
||||
/**
|
||||
* If non-null, the rectangle in which BuildContainerLayerFor stores the
|
||||
* visible rect of the layer, in the coordinate system of the created layer.
|
||||
*/
|
||||
nsIntRect* mLayerContentsVisibleRect;
|
||||
|
||||
/**
|
||||
* An offset to apply to all child layers created.
|
||||
*/
|
||||
nsIntPoint mOffset;
|
||||
|
||||
LayerIntPoint Offset() const {
|
||||
return LayerIntPoint::FromUntyped(mOffset);
|
||||
}
|
||||
|
||||
nscolor mBackgroundColor;
|
||||
bool mInTransformedSubtree;
|
||||
bool mInActiveTransformedSubtree;
|
||||
|
@ -309,6 +309,10 @@ struct LayerPixel {
|
||||
return nsIntRect(aRect.x, aRect.y, aRect.width, aRect.height);
|
||||
}
|
||||
|
||||
static nsIntPoint ToUntyped(const LayerIntPoint& aPoint) {
|
||||
return nsIntPoint(aPoint.x, aPoint.y);
|
||||
}
|
||||
|
||||
static gfx::IntRect ToUnknown(const LayerIntRect& aRect) {
|
||||
return gfx::IntRect(aRect.x, aRect.y, aRect.width, aRect.height);
|
||||
}
|
||||
|
@ -833,8 +833,7 @@ nsDisplayScrollLayer::ComputeFrameMetrics(nsIFrame* aForFrame,
|
||||
// all the pres shells from here up to the root, as well as any css-driven
|
||||
// resolution. We don't need to compute it as it's already stored in the
|
||||
// container parameters.
|
||||
metrics.SetCumulativeResolution(LayoutDeviceToLayerScale2D(aContainerParameters.mXScale,
|
||||
aContainerParameters.mYScale));
|
||||
metrics.SetCumulativeResolution(aContainerParameters.Scale());
|
||||
|
||||
LayoutDeviceToScreenScale2D resolutionToScreen(
|
||||
presShell->GetCumulativeResolution()
|
||||
|
Loading…
Reference in New Issue
Block a user