Bug 1824480 - Remove ScrollMetadata::mBackgroundColor which is no longer used. r=dlrobertson

This field appears to be unused since bug 1349418.

Differential Revision: https://phabricator.services.mozilla.com/D173598
This commit is contained in:
Botond Ballo 2023-04-04 18:00:38 +00:00
Родитель f14b77c4f9
Коммит 2740392b19
4 изменённых файлов: 1 добавлений и 32 удалений

Просмотреть файл

@ -323,8 +323,7 @@ std::ostream& operator<<(std::ostream& aStream,
std::ostream& operator<<(std::ostream& aStream,
const ScrollMetadata& aMetadata) {
aStream << "{ [description=" << aMetadata.GetContentDescription()
<< "] [metrics=" << aMetadata.GetMetrics()
<< "] [color=" << aMetadata.GetBackgroundColor();
<< "] [metrics=" << aMetadata.GetMetrics();
if (aMetadata.GetScrollParentId() != ScrollableLayerGuid::NULL_SCROLL_ID) {
aStream << "] [scrollParent=" << aMetadata.GetScrollParentId();
}
@ -337,11 +336,6 @@ std::ostream& operator<<(std::ostream& aStream,
return aStream;
}
void ScrollMetadata::SetBackgroundColor(
const gfx::sRGBColor& aBackgroundColor) {
mBackgroundColor = gfx::ToDeviceColor(aBackgroundColor);
}
StaticAutoPtr<const ScrollMetadata> ScrollMetadata::sNullMetadata;
} // namespace layers

Просмотреть файл

@ -849,7 +849,6 @@ struct ScrollMetadata {
: mMetrics(),
mSnapInfo(),
mScrollParentId(ScrollableLayerGuid::NULL_SCROLL_ID),
mBackgroundColor(),
mContentDescription(),
mLineScrollAmount(0, 0),
mPageScrollAmount(0, 0),
@ -868,7 +867,6 @@ struct ScrollMetadata {
bool operator==(const ScrollMetadata& aOther) const {
return mMetrics == aOther.mMetrics && mSnapInfo == aOther.mSnapInfo &&
mScrollParentId == aOther.mScrollParentId &&
mBackgroundColor == aOther.mBackgroundColor &&
// don't compare mContentDescription
mLineScrollAmount == aOther.mLineScrollAmount &&
mPageScrollAmount == aOther.mPageScrollAmount &&
@ -910,10 +908,6 @@ struct ScrollMetadata {
ViewID GetScrollParentId() const { return mScrollParentId; }
void SetScrollParentId(ViewID aParentId) { mScrollParentId = aParentId; }
const gfx::DeviceColor& GetBackgroundColor() const {
return mBackgroundColor;
}
void SetBackgroundColor(const gfx::sRGBColor& aBackgroundColor);
const nsCString& GetContentDescription() const { return mContentDescription; }
void SetContentDescription(const nsCString& aContentDescription) {
mContentDescription = aContentDescription;
@ -1022,9 +1016,6 @@ struct ScrollMetadata {
// off.
ViewID mScrollParentId;
// The background color to use when overscrolling.
gfx::DeviceColor mBackgroundColor;
// A description of the content element corresponding to this frame.
// This is empty unless this is a scrollable layer and the
// apz.printtree pref is turned on.

Просмотреть файл

@ -558,7 +558,6 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
WriteParam(aWriter, aParam.mMetrics);
WriteParam(aWriter, aParam.mSnapInfo);
WriteParam(aWriter, aParam.mScrollParentId);
WriteParam(aWriter, aParam.mBackgroundColor);
WriteParam(aWriter, aParam.GetContentDescription());
WriteParam(aWriter, aParam.mLineScrollAmount);
WriteParam(aWriter, aParam.mPageScrollAmount);
@ -591,7 +590,6 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
return (ReadParam(aReader, &aResult->mMetrics) &&
ReadParam(aReader, &aResult->mSnapInfo) &&
ReadParam(aReader, &aResult->mScrollParentId) &&
ReadParam(aReader, &aResult->mBackgroundColor) &&
ReadContentDescription(aReader, aResult) &&
ReadParam(aReader, &aResult->mLineScrollAmount) &&
ReadParam(aReader, &aResult->mPageScrollAmount) &&

Просмотреть файл

@ -8982,20 +8982,6 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
metadata.SetHasScrollgrab(true);
}
// Also compute and set the background color.
// This is needed for APZ overscrolling support.
if (aScrollFrame) {
if (isRootScrollFrame) {
metadata.SetBackgroundColor(
sRGBColor::FromABGR(presShell->GetCanvasBackground()));
} else if (const auto* backgroundStyle =
nsCSSRendering::FindBackground(aScrollFrame)) {
nscolor backgroundColor =
backgroundStyle->StyleBackground()->BackgroundColor(backgroundStyle);
metadata.SetBackgroundColor(sRGBColor::FromABGR(backgroundColor));
}
}
if (ShouldDisableApzForElement(aContent)) {
metadata.SetForceDisableApz(true);
}