Closed Bug 482689 Opened 11 years ago Closed 11 years ago

Optimize nsDisplayBackground::IsOpaque to include solid background images

Categories

(Core :: Layout, defect)

x86
Linux
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: pavlov, Assigned: pavlov)

References

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

Attached patch v0.5 (obsolete) — Splinter Review
I think this patch is right, and it seems to help, although it would be nice if it could include repeat_x/repeat_y stuff that filled the whole area.  Any other optimizations to this would be helpful as well.
Attachment #366783 - Flags: review?(roc)
Comment on attachment 366783 [details] [diff] [review]
v0.5

>+      // bottom layer's clip is used for the color
>+      bottomLayer.mClip == NS_STYLE_BG_CLIP_BORDER &&
>+      !nsLayoutUtils::HasNonZeroCorner(mFrame->GetStyleBorder()->mBorderRadius))

May as well invert the checks for these two conditions for a return false that happens before the two curent checks for them, so you don't have to check them twice.
This is OK other than what dbaron said.

We could improve this quite a bit by having nsDisplayBackground::GetBounds return the actual area covered by the background; then IsOpaque could return true whenever the image or color is opaque. That could easily be a followup patch though. (For simplicity you could fall back to assuming the border-box if there's more than one background.)
Attached patch v1.0Splinter Review
Assignee: nobody → pavlov
Attachment #366783 - Attachment is obsolete: true
Attachment #371716 - Flags: review?(roc)
Attachment #366783 - Flags: review?(roc)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Depends on: 487856
You need to log in before you can comment on or make changes to this bug.