Closed Bug 843618 Opened 7 years ago Closed 7 years ago

Change CSS pixels values from preferences breaks screenshoots


(Firefox OS Graveyard :: Hardware, defect)

Not set


(firefox21 wontfix, firefox22 fixed, b2g18+ fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)

B2G C4 (2jan on)
Tracking Status
firefox21 --- wontfix
firefox22 --- fixed
b2g18 + fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix


(Reporter: basiclines, Assigned: roc)



(4 files)

Attached image devPixelsPerPx = 1
Install on the device latest Gaia code with custom-prefs.js and this values: 
pref("layout.css.devPixelsPerPx", "1.6875");

When you perform a screenshot the content is splited off but the file dimensions seems to be OK.
Attached image devPixelsPerPx = 1.5
Attached image devPixelsPerPx = 1.6875
Assignee: nobody → ncameron
Seems that it could be related with
It is probably not related to bug 828531.

Ismael, what did you do to generate those attachments?
Assignee: ncameron → nobody
Just run the Peak device with pref("layout.css.devPixelsPerPx", "1.6875"); and perform an screenshoot
Assignee: nobody → roc
I added pref("layout.css.devPixelsPerPx", "1.6875") to custom-prefs.js, installed it on Unagi, and indeed the layout was zoomed (and somewhat broken, unsurprisingly). Starting apps and then long-pressing the Home key brought up the card view and the screenshots in that view looked fine. Also, the screenshots we show while an app starts up seemed to look fine.

Am I testing this wrong?
Oh, you meant the home-power screenshot feature. I see the bug now.
The bug is in BasicShadowLayerManager::EndTransaction, where we ask the remoteRenderer to give us a copy of its buffer which we then copy to the destination context (in this case, the drawWindow destination). We set the size of the snapshot buffer to the size of the destination context's underlying surface, which is wrong in this case because the destination context is scaling by 0.6, so we want a larger snapshot which we will scale down to fill the destination context.
Attached patch fixSplinter Review
I'm not sure who should review this, feel free to pass it on.
Attachment #721991 - Flags: review?(jmuizelaar)
Comment on attachment 721991 [details] [diff] [review]

Review of attachment 721991 [details] [diff] [review]:

This seems sane to me. You should also check if we'll need something similar on gfx branch.
Attachment #721991 - Flags: review?(jmuizelaar) → review+
Closed: 7 years ago
Resolution: --- → FIXED
Do we need this on the b2g18 branch?
Well i think so Robert!
Comment on attachment 721991 [details] [diff] [review]

NOTE: Please see to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): none
User impact if declined: screenshots in high-DPI FirefoxOS configurations are generally broken
Testing completed: been on mozilla-central for a while
Risk to taking this patch (and alternatives if risky): pretty low risk. Only affects screenshotting.
String or UUID changes made by this patch: none
Attachment #721991 - Flags: approval-mozilla-b2g18?
Attachment #721991 - Flags: approval-mozilla-b2g18? → approval-mozilla-b2g18+
You need to log in before you can comment on or make changes to this bug.