Closed Bug 821477 Opened 12 years ago Closed 12 years ago

Don't build nsDisplay{Canvas}BackgroundImage items if the image is empty

Categories

(Core :: Layout, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

Details

Attachments

(1 file)

This should reduce a bit of work, and make the display lists easier to comprehend. Getting the nsDisplayBackgroundColor equivalent fixed and landed would be good too.
Attachment #692000 - Flags: review?(roc)
Comment on attachment 692000 [details] [diff] [review]
Skip unnecessary background items

Review of attachment 692000 [details] [diff] [review]:
-----------------------------------------------------------------

Can you remove the IsEmpty() check you added for background-attachment:fixed items?

::: layout/base/nsDisplayList.cpp
@@ +1578,5 @@
>    if (!isThemed &&
>        nsCSSRendering::FindBackground(presContext, aFrame, &bgSC)) {
>      bg = bgSC->GetStyleBackground();
>    }
> +  printf("Build BG\n");

Remove

@@ +1596,5 @@
>        new (aBuilder) nsDisplayBackgroundColor(aBuilder, aFrame, bg,
>                                                drawBackgroundColor ? color : NS_RGBA(0, 0, 0, 0)));
> +
> +  if (isThemed) {
> +    printf("Themed bg item for %p\n", aFrame);

remove

@@ +1618,5 @@
>    NS_FOR_VISIBLE_BACKGROUND_LAYERS_BACK_TO_FRONT(i, bg) {
> +    if (bg->mLayers[i].mImage.IsEmpty()) {
> +      continue;
> +    }
> +    printf("Adding display item for %p\n", aFrame);

remove
Attachment #692000 - Flags: review?(roc) → review+
https://hg.mozilla.org/mozilla-central/rev/777fd91b7fda
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Depends on: 822865
Assignee: nobody → matt.woodrow
Depends on: 863700
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: