[Camera] black boxes appear in camera app

RESOLVED INVALID

Status

()

Core
Graphics: Layers
RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: djf, Assigned: justindarc)

Tracking

Trunk
x86
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(blocking-b2g:2.1+)

Details

Attachments

(3 attachments)

(Reporter)

Description

3 years ago
Created attachment 8469505 [details]
black boxes in the camera app

If I apply the patch from bug 1049198 (https://github.com/mozilla-b2g/gaia/pull/22594) to the camera app on the master branch, I can get the camera to display black boxes (see the attached screenshot) with these STR:

1) switch to video mode by tapping in lower right
2) record a short video
3) switch back to camera mode by tapping in lower right
4) tap in the lower left to preview the video. Don't play the video, just see the poster image
5) tap upper left to return to the camera viewfinder
6) See the black boxes.


Note that the camera app is using a video preview stream from the camera hardware with mozSrcElement instead of a normal video file with the src attribute.

This does not seem to happen on the 2.0 branch.

I suspect that the relevant line from the gaia patch is the one that adds a background color on the .viewfinder class.  I'm guessing that if we changed that color we'd see different color boxes.
(Reporter)

Comment 1

3 years ago
Milan: this is the camera graphics bug that Hema told you about.
(Reporter)

Updated

3 years ago
Blocks: 1049198
Just to add some details.
This is only on 2.1, so even though bug 1049198 is 2.0+, this one would be 2.1+ if we can't land the solution on the trunk.  So, I'm going to presumptively set that.
Camera app doesn't have the simplests of CSS, so a reduced test case would be very useful.
If Gecko bug, it's probably invalidation (?), but paint flashing would probably confirm that.
blocking-b2g: --- → 2.1+
OS: Mac OS X → Gonk (Firefox OS)
Benoit, if you have a chance to take a look and maybe answer some of my (or different relevant) questions before David gets to it, let us know.  I don't have a handy build.
Flags: needinfo?(bgirard)
I have some findings about this issue.

First, I removed will-change in css but didn't help.
Second, I tried to change background color of viewfinder but the box color is still black.

Finally, the gaia patch which was provided by bug 1049198 would let camera app become tiling. And this issue seems cause by tiling. After applying that patch and disabled tile in settings then issue not happened.

I would attach some screenshots from LayerScope to show what problem in tiling.
Created attachment 8471373 [details]
camera_good.png

This is camera app with good status. All tiles with transparent background.
Created attachment 8471379 [details]
camera_bad.png

This is in bad status. Some tiles with corrupt background? I also found the content of corrupt background is same as the preview which is mentioned by STR step 4. Maybe we didn't clear tiling buffers when we get it from recycle bin?

Comment 7

3 years ago
(In reply to Morris Tseng [:mtseng] from comment #4)
> I have some findings about this issue.
> 
> First, I removed will-change in css but didn't help.
> Second, I tried to change background color of viewfinder but the box color
> is still black.
> 
> Finally, the gaia patch which was provided by bug 1049198 would let camera
> app become tiling. 
David, are we going to use tile for camera?
>And this issue seems cause by tiling. After applying that
> patch and disabled tile in settings then issue not happened.
> 
> I would attach some screenshots from LayerScope to show what problem in
> tiling.
Flags: needinfo?(dflanagan)
(Reporter)

Comment 8

3 years ago
(In reply to peter chang[:pchang][:peter] from comment #7)
> (In reply to Morris Tseng [:mtseng] from comment #4)
> > I have some findings about this issue.
> > 
> > First, I removed will-change in css but didn't help.
> > Second, I tried to change background color of viewfinder but the box color
> > is still black.
> > 
> > Finally, the gaia patch which was provided by bug 1049198 would let camera
> > app become tiling. 
> David, are we going to use tile for camera?

Our goal is to simplify the layer tree enough that the camera can be rendered by HWC. I don't know anything about tiling, whether it is faster or slower. The patch for 1049198 was just trying to minimize the number or size of the layers. There was no intentional goal to allow tiling.
Flags: needinfo?(dflanagan)
I found that removal of "overflow:hidden" in app.css will cause camera become tiling.
Hi David, Do you have any idea about this "overflow:hidden". Could we add it back?
Flags: needinfo?(dflanagan)
We get tiling when we have content that is scrollable. overflow:hidden can make content that is too large and would otherwise be scrollable not scroll. Instead of adding overflow:hidden the camera app should size it's children to match the parent exactly when no scrolling is needed.
Flags: needinfo?(bgirard)
(Reporter)

Comment 12

3 years ago
(In reply to Morris Tseng [:mtseng] from comment #10)
> Hi David, Do you have any idea about this "overflow:hidden". Could we add it
> back?

Justin removed that as part of the layer tree optimization for bug 1049198. I'm not sure whether it has proven to be necessary or not.  Justin: could you respond to comments 10 and 11?
Flags: needinfo?(dflanagan) → needinfo?(jdarcangelo)
(Assignee)

Comment 13

3 years ago
(In reply to David Flanagan [:djf] from comment #12)
> (In reply to Morris Tseng [:mtseng] from comment #10)
> > Hi David, Do you have any idea about this "overflow:hidden". Could we add it
> > back?
> 
> Justin removed that as part of the layer tree optimization for bug 1049198.
> I'm not sure whether it has proven to be necessary or not.  Justin: could
> you respond to comments 10 and 11?

David, I need to update the patch for Bug 1049198 for the master branch. While you were out this week, I was able to fix the power utilization issue in Bug 1049198 in the patch for v2.0. In that patch, the "overflow: hidden;" is back in place so this bug may no longer be relevant. I'll check it again once I get the patch made for master.
Flags: needinfo?(jdarcangelo)
(Assignee)

Updated

3 years ago
Assignee: nobody → jdarcangelo
(Assignee)

Comment 14

3 years ago
This is no longer relevant because the patch this was reported on was changed to not exhibit this issue before it was landed.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
This bug might be related to Bug 1063046.
(Assignee)

Comment 16

3 years ago
(In reply to Sotaro Ikeda [:sotaro] from comment #15)
> This bug might be related to Bug 1063046.

It certainly looks like it. However, we were able to avoid this from happening in Camera by keeping an `overflow: hidden;` declaration on the document, so this bug is no longer relevant for Camera.
You need to log in before you can comment on or make changes to this bug.