From e8bd2a53a8ea64e50000f8a2740ad1896ee1d158 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Tue, 24 Jun 2014 10:02:10 +0100 Subject: [PATCH] Bug 1029211 - Get rid of a couple more Thebes backed gfxContexts by using gfxUtils::ClearThebesSurface instead. r=mattwoodrow --HG-- extra : rebase_source : cc75965e0ba908b84a592e337af0429ddb9cc846 --- dom/plugins/base/nsPluginInstanceOwner.cpp | 6 +++--- gfx/thebes/gfxQtNativeRenderer.cpp | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 22828c44e302..d6a081c135ec 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -14,6 +14,8 @@ using mozilla::DefaultXDisplay; #endif #include "nsPluginInstanceOwner.h" + +#include "gfxUtils.h" #include "nsIRunnable.h" #include "nsContentUtils.h" #include "nsRect.h" @@ -2437,9 +2439,7 @@ void nsPluginInstanceOwner::Paint(gfxContext* aContext, } // Clears buffer. I think this is needed. - nsRefPtr ctx = new gfxContext(pluginSurface); - ctx->SetOperator(gfxContext::OPERATOR_CLEAR); - ctx->Paint(); + gfxUtils::ClearThebesSurface(pluginSurface); ANPEvent event; event.inSize = sizeof(ANPEvent); diff --git a/gfx/thebes/gfxQtNativeRenderer.cpp b/gfx/thebes/gfxQtNativeRenderer.cpp index 55f68f1971a0..3b1da78ff49b 100644 --- a/gfx/thebes/gfxQtNativeRenderer.cpp +++ b/gfx/thebes/gfxQtNativeRenderer.cpp @@ -5,6 +5,7 @@ #include "gfxQtNativeRenderer.h" #include "gfxContext.h" +#include "gfxUtils.h" #include "gfxXlibSurface.h" nsresult @@ -32,9 +33,7 @@ gfxQtNativeRenderer::Draw(gfxContext* ctx, nsIntSize size, gfxIntSize(size.width, size.height)); if (!isOpaque) { - nsRefPtr tempCtx = new gfxContext(xsurf); - tempCtx->SetOperator(gfxContext::OPERATOR_CLEAR); - tempCtx->Paint(); + gfxUtils::ClearThebesSurface(xsurf); } nsresult rv = DrawWithXlib(xsurf->CairoSurface(), nsIntPoint(0, 0), nullptr, 0);