Bug 685082 - Transparent plugins not cleared on Maemo; r=karlt
authorOleg Romashin <romaxa@gmail.com>
Wed, 14 Sep 2011 08:51:24 +0100
changeset 76938 f794c079cf86d1ca1a7f78de8aa4c7fa7d5e257d
parent 76937 524cd2f17723b46fb1323a79c18412f1bbe9dc0c
child 76939 0159e317b73568c1fbb9c2d85f9ec6e10365f061
push id21156
push usermbrubeck@mozilla.com
push dateWed, 14 Sep 2011 13:45:18 +0000
treeherdermozilla-central@0a6d1368cd97 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs685082
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 685082 - Transparent plugins not cleared on Maemo; r=karlt
dom/plugins/ipc/PluginInstanceChild.cpp
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -2844,16 +2844,17 @@ PluginInstanceChild::PaintRectToPlatform
         exposeEvent.height = imgExp.height;
         exposeEvent.count = 0;
         // information not set:
         exposeEvent.serial = 0;
         exposeEvent.send_event = False;
         exposeEvent.major_code = 0;
         exposeEvent.minor_code = 0;
         mPluginIface->event(&mData, reinterpret_cast<void*>(&exposeEvent));
+        aSurface->MarkDirty(gfxRect(aRect.x, aRect.y, aRect.width, aRect.height));
     } else
 #endif
     {
         NS_ASSERTION(aSurface->GetType() == gfxASurface::SurfaceTypeXlib,
                      "Non supported platform surface type");
 
         NPEvent pluginEvent;
         XGraphicsExposeEvent& exposeEvent = pluginEvent.xgraphicsexpose;
@@ -2921,17 +2922,17 @@ PluginInstanceChild::PaintRectToSurface(
         // Don't use mHelperSurface if surface is image and mMaemoImageRendering is TRUE
         if (!mMaemoImageRendering ||
             renderSurface->GetType() != gfxASurface::SurfaceTypeImage)
 #endif
         renderSurface = mHelperSurface;
     }
 #endif
 
-    if (aColor.a > 0.0) {
+    if (mIsTransparent && !CanPaintOnBackground()) {
        // Clear surface content for transparent rendering
        nsRefPtr<gfxContext> ctx = new gfxContext(renderSurface);
        ctx->SetColor(aColor);
        ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
        ctx->Rectangle(GfxFromNsRect(plPaintRect));
        ctx->Fill();
     }