Bug 1337681 - Part1. Support border radius for BorderLayer. r=mattwoodrow

This commit is contained in:
Ethan Lin 2017-02-09 17:22:17 +08:00
parent ab55eb3915
commit a1f4b8b3cd
2 changed files with 5 additions and 1 deletions

View File

@ -4439,6 +4439,9 @@ nsDisplayBorder::GetLayerState(nsDisplayListBuilder* aBuilder,
mWidths[i] = 0;
}
}
NS_FOR_CSS_FULL_CORNERS(corner) {
mCorners[corner] = LayerSize(br->mBorderRadii[corner].width, br->mBorderRadii[corner].height);
}
mRect = ViewAs<LayerPixel>(br->mOuterRect);
return LAYER_ACTIVE;
@ -4457,7 +4460,7 @@ nsDisplayBorder::BuildLayer(nsDisplayListBuilder* aBuilder,
return nullptr;
}
layer->SetRect(mRect);
layer->SetCornerRadii({ LayerSize(), LayerSize(), LayerSize(), LayerSize() });
layer->SetCornerRadii(mCorners);
layer->SetColors(mColors);
layer->SetWidths(mWidths);
layer->SetStyles(mBorderStyles);

View File

@ -2846,6 +2846,7 @@ protected:
mozilla::Array<mozilla::gfx::Color, 4> mColors;
mozilla::Array<mozilla::LayerCoord, 4> mWidths;
mozilla::Array<mozilla::LayerSize, 4> mCorners;
mozilla::Array<uint8_t, 4> mBorderStyles;
mozilla::LayerRect mRect;