Closed
Bug 1210514
Opened 9 years ago
Closed 9 years ago
Fix color inversion when BasicCompositor is used on gonk
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: sotaro, Assigned: sotaro)
References
Details
Attachments
(1 file, 1 obsolete file)
6.42 KB,
patch
|
sotaro
:
review+
|
Details | Diff | Splinter Review |
When BasicCompositor is enabled on gonk, display shows color inverted rendering.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → sotaro.ikeda.g
Assignee | ||
Comment 1•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro PTO 5/Oct - 14/Oct] from comment #0)
> When BasicCompositor is enabled on gonk, display shows color inverted
> rendering.
See Bug 1206583 Comment 15.
Assignee | ||
Comment 2•9 years ago
|
||
The problem happens by the following.
- gecko renders content by BGR color.
- DrawTargetCairo supports only BGR color.
When RGB is requested, BGR render target is allocated.
And even if we could allocate BGR render target, performance might not be good without GPU.
Assignee | ||
Comment 3•9 years ago
|
||
On gonk, hwc could expose RB swap capability. Flame-kk's hwc says that hwc supports RB swap, but it seems not work for DisplaySurface's RBSwap. I tried it, but it did not work.
Assignee | ||
Comment 4•9 years ago
|
||
Confirmed on master flame-KK with the following preference.
- layers.acceleration.disabled -> true
- gfx.canvas.azure.accelerated -> false
- layers.gralloc.disable -> true
Assignee | ||
Updated•9 years ago
|
Attachment #8668667 -
Flags: review?(nical.bugzilla)
Assignee | ||
Comment 5•9 years ago
|
||
hwc seems not support rbswap of DisplaySurface's layer even when hwc suports rbswap. It seems that DisplaySurface's layer is always set as last hwc layer of hwc layers. From it, the layer seems to be automatically handled as HWC_FRAMEBUFFER_TARGET. It seems to affect to it.
Assignee | ||
Comment 6•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro PTO 5/Oct - 14/Oct] from comment #5)
> hwc seems not support rbswap of DisplaySurface's layer even when hwc suports
> rbswap. It seems that DisplaySurface's layer is always set as last hwc layer
> of hwc layers. From it, the layer seems to be automatically handled as
> HWC_FRAMEBUFFER_TARGET. It seems to affect to it.
normal hwc need one HWC_FRAMEBUFFER_TARGET for composition.
Comment 7•9 years ago
|
||
Looks like with your path we perform the manual rb swap on the framebuffer after each composition. Wouldn't it be much cheaper to do it on layers after they are painted so that we don't have to do a lot of processing during scrolling?
Assignee | ||
Comment 8•9 years ago
|
||
nical: can you explain more about it? I do not know well to moz 2d api. DrawTargetCairo seems to support only BGR.
Flags: needinfo?(nical.bugzilla)
Assignee | ||
Comment 9•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro PTO 5/Oct - 14/Oct] from comment #8)
> nical: can you explain more about it? I do not know well to moz 2d api.
> DrawTargetCairo seems to support only BGR.
Seems to support B8G8R8A8 and B8G8R8X8. But not support R8G8B8A8.
Comment 10•9 years ago
|
||
Comment on attachment 8668667 [details] [diff] [review]
patch - Convert BGR to RGB in nsWindow::EndRemoteDrawing()
Review of attachment 8668667 [details] [diff] [review]:
-----------------------------------------------------------------
R+ since this is a temporary solution. Please add big red-flags comments and performance warnings that this has very slow code paths that should not be used in production.
Attachment #8668667 -
Flags: review?(nical.bugzilla) → review+
Comment 11•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro PTO 5/Oct - 14/Oct intermittent during PTO] from comment #9)
> (In reply to Sotaro Ikeda [:sotaro PTO 5/Oct - 14/Oct] from comment #8)
> > nical: can you explain more about it? I do not know well to moz 2d api.
> > DrawTargetCairo seems to support only BGR.
>
> Seems to support B8G8R8A8 and B8G8R8X8. But not support R8G8B8A8.
This is a problem if we do things that are not plain composite operations, but if all we do is blit semi-transparent pixels, we are better off rb-swapping content that we receive and composite it (even if means an extra copy and lying to moz2d about the format), as long as the alpha channel is in the same place. This way we only do extra work when things are painted rather than every time we present.
Better even, rb-swap on the content side after painting, to avoid the extra copy on the compositor side.
I know what I am suggesting can look worryingly hacky, but rb-swapping the entire screen every time we present is far too expensive to do on the cpu, especially on a platform that is supposedly very cheap because we don't have a gpu to do the composition.
Flags: needinfo?(nical.bugzilla)
Assignee | ||
Comment 12•9 years ago
|
||
Apply the comment.
Attachment #8668667 -
Attachment is obsolete: true
Attachment #8674088 -
Flags: review+
Comment 13•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•