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

RESOLVED FIXED in mozilla20

Status

()

Core
Layout
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

Tracking

unspecified
mozilla20
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 692000 [details] [diff] [review]
Skip unnecessary background items

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+

Comment 3

5 years ago
https://hg.mozilla.org/mozilla-central/rev/777fd91b7fda
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20

Updated

5 years ago
Depends on: 822865

Updated

5 years ago
Assignee: nobody → matt.woodrow
Depends on: 863700
You need to log in before you can comment on or make changes to this bug.