avoid non-pixel-aligned clips for mobile's DrawWindow usage

RESOLVED FIXED

Status

()

Core
Graphics
RESOLVED FIXED
10 years ago
7 years ago

People

(Reporter: vlad, Assigned: vlad)

Tracking

(Blocks: 1 bug)

Trunk
x86
All
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 342340 [details] [diff] [review]
snap to pixels more aggressively

Non-pixel-aligned clips hurt a lot, so avoid them as much as possible.  Mobile currently sets a native cairo scale before calling DrawWindow, so even though gecko code tries to keep everything pixel-aligned, it fails in this case due to a CTM with scale.  This patch adds a few tweaks in #ifdef MOZ_GFX_MOBILE_OPTIMIZE and explicitly tells Rectangle() to snap coordinates and ignore scale (by default it only snaps if there's just a translation and not a scale).  Some of these may be good in general, but for now keep them behind that #ifdef until we can figure out what weird interactions there might be with this.

(As a bonus, we can avoid a temporary surface inside DrawWindow here in a common case.)
Attachment #342340 - Flags: review?(pavlov)

Comment 1

10 years ago
Created attachment 342359 [details] [diff] [review]
add your thing to configure
Attachment #342359 - Flags: review?(vladimir)

Updated

10 years ago
Attachment #342340 - Flags: review?(pavlov) → review+

Updated

10 years ago
Blocks: 441364
Comment on attachment 342359 [details] [diff] [review]
add your thing to configure

That's fine, I'll roll it in to my patch when I check in.
Attachment #342359 - Flags: review?(vladimir) → review+
Checked this in; it's causing some rounding problems with drawWindow, noticable as slight shifts when the display is repainted, but it's not horrible.  I think this is the rect rounding that's happening directly in the drawWindow call.  We can probably resolve this in fennec directly by being smarter about picking coordinates to start the draw on...
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.