Closed Bug 602322 Opened 12 years ago Closed 12 years ago

Implement GetDPI on Android

Categories

(Core Graveyard :: Widget: Android, defect)

All
Android
defect
Not set
normal

Tracking

(fennec2.0b2+)

RESOLVED FIXED
mozilla2.0b7
Tracking Status
fennec 2.0b2+ ---

People

(Reporter: mbrubeck, Assigned: mbrubeck)

References

Details

(Whiteboard: [not-fennec-11])

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
Bug 537890 introduced a new nsIWidget::GetDPI method, which is useful for implementing device-independent UI with physical units like mozmm.

Android is currently using the default implementation from nsBaseWidget, which always returns 96.0.  Here's a patch to retrieve the correct value from the OS instead.
Attachment #481335 - Flags: review?(mwu)
Attachment #481335 - Flags: review?(mwu) → review+
We will need this to properly support different Android screens (bug 590777).

Note for future reference:  android.util.displayMetrics.density might be useful too; it closely matches the use case for our "zoom.dpiScale" pref.
Blocks: 590777
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0b2+
Note: This patch works in chrome, but in the content process it always returns the default value of 96.
Assignee: nobody → mbrubeck
Status: NEW → ASSIGNED
After testing this more and learning more about the new DPI system, I am ready to check this in.  This will only affect physical units like mozmm (which we are not currently using in Fennec chrome).  Standard CSS units like mm and px are not affected.
Attachment #481335 - Attachment is obsolete: true
Attachment #481544 - Flags: review+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/677dd7cfc2d9
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Blocks: 605024
Target Milestone: mozilla2.0b8 → mozilla2.0b7
Whiteboard: [not-fennec-11]
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.