Closed Bug 685082 Opened 8 years ago Closed 8 years ago

Transparent plugins not cleared on Maemo

Categories

(Core :: Plug-ins, defect)

x86
Maemo
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: romaxa, Assigned: romaxa)

References

()

Details

(Keywords: regression)

Attachments

(2 files, 3 obsolete files)

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...
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...
Ok, did call MarkDirty() clearing surface start working correctly
Also found that BasicShadowableImageLayer::Paint does Image layer update using OPERATOR_OVER all the time which is incorrect
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #558761 - Flags: review?(karlt)
Attachment #558762 - Flags: review?(jones.chris.g)
Keywords: regression
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-
> >     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+
Remove aColor check, rest is the same
Attachment #558761 - Attachment is obsolete: true
Attachment #559041 - Flags: review?(karlt)
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-
oh ok, now I understood it.
Attachment #559048 - Attachment is obsolete: true
Attachment #559061 - Flags: review?(karlt)
Attachment #559061 - Flags: review?(karlt) → review+
Keywords: checkin-needed
In my queue of bits and pieces for try then inbound.
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.