Created
April 11, 2019 14:35
-
-
Save Gankra/41eed3144c01fb3c1a15117f4723aac8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void DisplayListBuilder::PushShadow(const wr::LayoutRect& aRect, | |
const wr::LayoutRect& aClip, | |
bool aIsBackfaceVisible, | |
const wr::Shadow& aShadow) { | |
// Local clip_rects are translated inside of shadows, as they are assumed to | |
// be part of the element drawing itself, and not a parent frame clipping it. | |
// As such, it is not sound to apply the MergeClipLeaf optimization inside of | |
// shadows. So we disable the optimization when we encounter a shadow. | |
// Shadows don't span frames, so we don't have to worry about MergeClipLeaf | |
// being re-enabled mid-shadow. The optimization is restored in PopAllShadows. | |
SuspendClipLeafMerging(); | |
wr_dp_push_shadow(mWrState, aRect, aClip, aIsBackfaceVisible, | |
&mCurrentSpaceAndClipChain, aShadow); | |
} | |
void DisplayListBuilder::PopAllShadows() { | |
wr_dp_pop_all_shadows(mWrState); | |
ResumeClipLeafMerging(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment