Closed Bug 786100 Opened 9 years ago Closed 8 years ago

componentAlpha unnecessarily used when scrolling text over constant background color

Categories

(Core :: Layout, defect)

17 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: karlt, Assigned: karlt)

Details

Attachments

(2 files)

Attached file 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]"
Need to debug from FindOpaqueBackgroundColorFor().
Need layers.acceleration.force-enabled to demonstrate this way, probably since http://hg.mozilla.org/integration/mozilla-inbound/rev/7a98f847bb8e
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
Even the nsDisplayCanvasBackground is 2/15 pixel out of alignment.
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: nobody → karlt
Status: NEW → ASSIGNED
Attachment #688556 - Flags: review?(roc)
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/3399897304da
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.