The default bug view has changed. See this FAQ.

Transparent plugins not cleared on Maemo

RESOLVED FIXED in mozilla9

Status

()

Core
Plug-ins
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: romaxa, Assigned: romaxa)

Tracking

({regression})

Trunk
mozilla9
x86
Maemo
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 3 obsolete attachments)

(Assignee)

Description

6 years ago
For Maemo transparent plugins we don't have anymore plugin surface clearing code called:
we call PaintRectToSurface to surface from here:
http://hg.mozilla.org/releases/mozilla-2.1/diff/a96c75dbc151/dom/plugins/PluginInstanceChild.cpp#l1.412

And this check never works when mIsTransparent = TRUE:
http://hg.mozilla.org/releases/mozilla-2.1/diff/a96c75dbc151/dom/plugins/PluginInstanceChild.cpp#l1.314

https://bugzilla.mozilla.org/show_bug.cgi?id=626602#c98

Problem is reproducible on Maemo5 with enabled plugins...
(Assignee)

Comment 1

6 years ago
Also facing another problem, that even if that clearing with transparent color enabled fill does not seems to happen...
SetColor(alpha 0), SetOperator(gfxContext::OPERATOR_SOURCE), Rectangle(), Fill(); - does not clear surface, same with operator clear + paint()
if I replace that code with Qpainter code, then surface cleared correctly... also we do have surface->Flush() - which was missing before and causing some problems
don't understand what is going on yet...
(Assignee)

Comment 2

6 years ago
Ok, did call MarkDirty() clearing surface start working correctly
(Assignee)

Comment 3

6 years ago
Also found that BasicShadowableImageLayer::Paint does Image layer update using OPERATOR_OVER all the time which is incorrect
(Assignee)

Comment 4

6 years ago
Created attachment 558761 [details] [diff] [review]
Transparent rendering Plugins part
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #558761 - Flags: review?(karlt)
(Assignee)

Comment 5

6 years ago
Created attachment 558762 [details] [diff] [review]
Shadowable Image layer buffer update part
Attachment #558762 - Flags: review?(jones.chris.g)
(Assignee)

Updated

6 years ago
Keywords: regression
(Assignee)

Updated

6 years ago
(Assignee)

Updated

6 years ago
Attachment #558761 - Flags: review?(jones.chris.g)
Comment on attachment 558761 [details] [diff] [review]
Transparent rendering Plugins part

>-    if (aColor.a > 0.0) {
>+    if (aColor.a > 0.0 || (mIsTransparent && !CanPaintOnBackground())) {

Looks like this was my fault (Bug 626602 comment 98).
Please drop the aColor.a > 0.0 test, as the rest is sufficient.

>     if (mMaemoImageRendering &&
>         aSurface->GetType() == gfxASurface::SurfaceTypeImage) {
>+        aSurface->MarkDirty(gfxRect(aRect.x, aRect.y, aRect.width, aRect.height));
>         aSurface->Flush();

The MarkDirty() should be done after the plugin has drawn.
Attachment #558761 - Flags: review?(karlt)
Attachment #558761 - Flags: review?(jones.chris.g)
Attachment #558761 - Flags: review-
(Assignee)

Comment 7

6 years ago
> >     if (mMaemoImageRendering &&
> >         aSurface->GetType() == gfxASurface::SurfaceTypeImage) {
> >+        aSurface->MarkDirty(gfxRect(aRect.x, aRect.y, aRect.width, aRect.height));
> >         aSurface->Flush();
> 
> The MarkDirty() should be done after the plugin has drawn.
Err... MarkDirty and flush need to be here in order to flush operations which has been done before (such like surface clear), plugin will render data into that surface, because plugin is not using aSurface cairoContext....

After plugin paint flush in not needed because plugin not using that context.
Flush after plugin paint done on UI process (RecvShow)
Attachment #558762 - Flags: review?(jones.chris.g) → review+
(Assignee)

Comment 8

6 years ago
Created attachment 559041 [details] [diff] [review]
Transparent rendering Plugins part

Remove aColor check, rest is the same
Attachment #558761 - Attachment is obsolete: true
Attachment #559041 - Flags: review?(karlt)
(Assignee)

Comment 9

6 years ago
Created attachment 559048 [details] [diff] [review]
Transparent rendering Plugins part

Mark dirty before readback
Attachment #559041 - Attachment is obsolete: true
Attachment #559041 - Flags: review?(karlt)
Attachment #559048 - Flags: review?(karlt)
Comment on attachment 559048 [details] [diff] [review]
Transparent rendering Plugins part

I think you'd have to mark the back surface dirty here to achieve the goal because the surfaces have been swapped here.

But on further thought, I'd prefer the MarkDirty in PaintRectToPlatformSurface() after the mPluginIface->event() call.

It doesn't make much difference with mMaemoImageRendering, but there are other paths using multiple surfaces.  For them it is hard to track which surface needs to be MarkDirty()ed but this is often enough not the right surface to mark dirty and I'm not certain about what impact an unnecessary MarkDirty might have on performance there.
Attachment #559048 - Flags: review?(karlt) → review-
(Assignee)

Comment 11

6 years ago
Created attachment 559061 [details] [diff] [review]
Transparent rendering Plugins part

oh ok, now I understood it.
Attachment #559048 - Attachment is obsolete: true
Attachment #559061 - Flags: review?(karlt)
Attachment #559061 - Flags: review?(karlt) → review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
In my queue of bits and pieces for try then inbound.
Keywords: checkin-needed
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=5a17479d7da9
https://hg.mozilla.org/integration/mozilla-inbound/rev/f794c079cf86
https://hg.mozilla.org/integration/mozilla-inbound/rev/524cd2f17723
Target Milestone: --- → mozilla9
https://hg.mozilla.org/mozilla-central/rev/f794c079cf86
https://hg.mozilla.org/mozilla-central/rev/524cd2f17723
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.