componentAlpha unnecessarily used when scrolling text over constant background color

RESOLVED FIXED in mozilla20

Status

()

Core
Layout
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: karlt, Assigned: karlt)

Tracking

17 Branch
mozilla20
x86_64
Linux
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

6 years ago
Created attachment 655812 [details]
testcase

STR:
1) Run debug browser with NSPR_LOG_MODULES=Layers:5 in environment
2) load testcase
3) click in content area
4) use up/down keys to scroll

Actual results: Output includes "[componentAlpha]"

Expected: no "[componentAlpha]"
(Assignee)

Comment 1

6 years ago
Need to debug from FindOpaqueBackgroundColorFor().
(Assignee)

Comment 2

6 years ago
Need layers.acceleration.force-enabled to demonstrate this way, probably since http://hg.mozilla.org/integration/mozilla-inbound/rev/7a98f847bb8e
(Assignee)

Comment 3

6 years ago
It seems the uniform color area is 2/15 pixel short of the top of the scrolled region (and extends 2/15 pixel below).

I wonder whether the the display item hasn't been snapped to pixels appropriately.  It looks like it is drawn snapped to pixels.

In FindOpaqueColorCovering, at http://hg.mozilla.org/mozilla-central/file/1489b6c2d1d2/layout/base/FrameLayerBuilder.cpp#l2559

(gdb) p aRect
$33 = (
    const nsRect &) @0x7fff100bc6a0: {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 480, y = 5700, width = 16800, 
    height = 12000}, <No data fields>}

(gdb) p visible
$45 = (
    const nsRect &) @0x1ba6678: {<mozilla::gfx::BaseRect<int, nsRect, nsPoint, nsSize, nsMargin>> = {x = 480, y = 5708, width = 17100, 
    height = 12000}, <No data fields>}
(gdb) p item
$46 = (nsDisplayBackgroundColor *) 0x1ba6650

(gdb) p i
$48 = 1

(gdb) p /x item->mColor
$50 = 0xff808080
(Assignee)

Comment 4

6 years ago
Even the nsDisplayCanvasBackground is 2/15 pixel out of alignment.
(Assignee)

Comment 5

6 years ago
The off-pixel alignment comes from the TextBox for the menubar being 15 + 2/15 pixels high.

MenuBar(menubar)(0)@0x248c6f8 {0,0,20880,1268} [state=0000160080c40000] [content=0x1ab6b60] [sc=0x26022b0]<
  Menu(menu)(0)@0x24ae4b8 next=0x24aec20 {0,0,2040,1268} [state=0000164090540010] [content=0x1ab72b0] [sc=0x25c48a8]<
    TextBox(label)(-1)[value=File]@0x24aea68 {420,180,1200,908} [state=0000064000000010] [content=0x248f940] [sc=0x2602028]
  >
  PopupList<
[...]

That's perhaps not ideal, but not the real bug here.
(In reply to Karl Tomlinson (:karlt) from comment #3)
> It seems the uniform color area is 2/15 pixel short of the top of the
> scrolled region (and extends 2/15 pixel below).
> 
> I wonder whether the the display item hasn't been snapped to pixels
> appropriately.  It looks like it is drawn snapped to pixels.

Yes, it sounds like something needs to be snapped. The display item's GetBounds should return true for aSnap in GetBounds, and then the FrameLayerBuilder should be using that snapped rect after IsUniform returns true.
(Assignee)

Comment 7

6 years ago
Created attachment 688556 [details] [diff] [review]
consider display item snap
Assignee: nobody → karlt
Status: NEW → ASSIGNED
Attachment #688556 - Flags: review?(roc)
(Assignee)

Updated

6 years ago
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/3399897304da
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.