Bug 991640 - Get rid of nsIWidget::GetThebesSurface and a bunch of Thebes backed gfxContexts. r=mattwoodrow

This commit is contained in:
Jonathan Watt 2014-06-10 07:02:21 +01:00
Родитель 03cb023649
Коммит 1ac56ed5ef
13 изменённых файлов: 10 добавлений и 90 удалений

Просмотреть файл

@ -539,7 +539,6 @@ public:
virtual CompositorParent* NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight);
virtual void CreateCompositor();
virtual gfxASurface* GetThebesSurface();
virtual void PrepareWindowEffects() MOZ_OVERRIDE;
virtual void CleanupWindowEffects() MOZ_OVERRIDE;
virtual bool PreRender(LayerManagerComposite* aManager) MOZ_OVERRIDE;
@ -644,8 +643,6 @@ protected:
nsWeakPtr mAccessible;
#endif
nsRefPtr<gfxASurface> mTempThebesSurface;
// Protects the view from being teared down while a composition is in
// progress on the compositor thread.
mozilla::Mutex mViewTearDownLock;

Просмотреть файл

@ -2135,16 +2135,6 @@ nsChildView::NewCompositorParent(int aSurfaceWidth, int aSurfaceHeight)
return compositor;
}
gfxASurface*
nsChildView::GetThebesSurface()
{
if (!mTempThebesSurface) {
mTempThebesSurface = new gfxQuartzSurface(gfxSize(1, 1), gfxImageFormat::ARGB32);
}
return mTempThebesSurface;
}
void
nsChildView::NotifyDirtyRegion(const nsIntRegion& aDirtyRegion)
{

Просмотреть файл

@ -315,8 +315,6 @@ public:
void DispatchSizeModeEvent();
virtual gfxASurface* GetThebesSurface();
// be notified that a some form of drag event needs to go into Gecko
virtual bool DragEvent(unsigned int aMessage, Point aMouseGlobal, UInt16 aKeyModifiers);

Просмотреть файл

@ -2057,13 +2057,6 @@ NS_IMETHODIMP nsCocoaWindow::SynthesizeNativeMouseEvent(nsIntPoint aPoint,
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
}
gfxASurface* nsCocoaWindow::GetThebesSurface()
{
if (mPopupContentView)
return mPopupContentView->GetThebesSurface();
return nullptr;
}
void nsCocoaWindow::SetPopupWindowLevel()
{
if (!mWindow)

Просмотреть файл

@ -595,18 +595,6 @@ nsWindow::GetLayerManager(PLayerTransactionChild* aShadowManager,
return mLayerManager;
}
gfxASurface *
nsWindow::GetThebesSurface()
{
/* This is really a dummy surface; this is only used when doing reflow, because
* we need a RenderingContext to measure text against.
*/
// XXX this really wants to return already_AddRefed, but this only really gets used
// on direct assignment to a gfxASurface
return new gfxImageSurface(gfxIntSize(5,5), gfxImageFormat::RGB24);
}
void
nsWindow::BringToTop()
{

Просмотреть файл

@ -101,7 +101,6 @@ public:
LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
bool* aAllowRetaining = nullptr);
gfxASurface* GetThebesSurface();
NS_IMETHOD_(void) SetInputContext(const InputContext& aContext,
const InputContextAction& aAction);

Просмотреть файл

@ -30,7 +30,6 @@ class nsDeviceContext;
struct nsFont;
class nsIRollupListener;
class imgIContainer;
class gfxASurface;
class nsIContent;
class ViewWrapper;
class nsIWidgetListener;
@ -100,8 +99,8 @@ typedef void* nsNativeWidget;
#endif
#define NS_IWIDGET_IID \
{ 0x5b27abd6, 0x9e53, 0x4a0a, \
{ 0x86, 0xf, 0x77, 0x5c, 0xc5, 0x69, 0x35, 0xf } };
{ 0x5b27abd6, 0x9e53, 0x4a0a, \
{ 0x86, 0xf, 0x77, 0x5c, 0xc5, 0x69, 0x35, 0xf } };
/*
* Window shadow styles
@ -1586,11 +1585,6 @@ class nsIWidget : public nsISupports {
*/
virtual bool ShowsResizeIndicator(nsIntRect* aResizerRect) = 0;
/**
* Get the Thebes surface associated with this widget.
*/
virtual gfxASurface *GetThebesSurface() = 0;
/**
* Return the popup that was last rolled up, or null if there isn't one.
*/

Просмотреть файл

@ -3387,26 +3387,6 @@ nsWindow::GetLayerManager(PLayerTransactionChild* aShadowManager,
return mLayerManager;
}
/**************************************************************
*
* SECTION: nsIWidget::GetThebesSurface
*
* Get the Thebes surface associated with this widget.
*
**************************************************************/
gfxASurface *nsWindow::GetThebesSurface()
{
if (mPaintDC)
return (new gfxWindowsSurface(mPaintDC));
uint32_t flags = gfxWindowsSurface::FLAG_TAKE_DC;
if (mTransparencyMode != eTransparencyOpaque) {
flags |= gfxWindowsSurface::FLAG_IS_TRANSPARENT;
}
return (new gfxWindowsSurface(mWnd, flags));
}
/**************************************************************
*
* SECTION: nsIWidget::OnDefaultButtonLoaded

Просмотреть файл

@ -152,7 +152,6 @@ public:
LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
bool* aAllowRetaining = nullptr);
gfxASurface *GetThebesSurface();
NS_IMETHOD OnDefaultButtonLoaded(const nsIntRect &aButtonRect);
NS_IMETHOD OverrideSystemMouseScrollSpeed(double aOriginalDeltaX,
double aOriginalDeltaY,

Просмотреть файл

@ -22,6 +22,7 @@
#include "PuppetWidget.h"
#include "nsIWidgetListener.h"
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::hal;
using namespace mozilla::gfx;
@ -108,9 +109,8 @@ PuppetWidget::Create(nsIWidget *aParent,
mEnabled = true;
mVisible = true;
mSurface = gfxPlatform::GetPlatform()
->CreateOffscreenSurface(IntSize(1, 1),
gfxASurface::ContentFromFormat(gfxImageFormat::ARGB32));
mDrawTarget = gfxPlatform::GetPlatform()->
CreateOffscreenContentDrawTarget(IntSize(1, 1), SurfaceFormat::B8G8R8A8);
mIMEComposing = false;
mNeedIMEStateInit = MightNeedIMEFocus(aInitData);
@ -390,12 +390,6 @@ PuppetWidget::GetLayerManager(PLayerTransactionChild* aShadowManager,
return mLayerManager;
}
gfxASurface*
PuppetWidget::GetThebesSurface()
{
return mSurface;
}
nsresult
PuppetWidget::IMEEndComposition(bool aCancel)
{
@ -694,7 +688,7 @@ PuppetWidget::Paint()
mTabChild->NotifyPainted();
}
} else {
nsRefPtr<gfxContext> ctx = new gfxContext(mSurface);
nsRefPtr<gfxContext> ctx = new gfxContext(mDrawTarget);
ctx->Rectangle(gfxRect(0,0,0,0));
ctx->Clip();
AutoLayerManagerSetup setupLayerManager(this, ctx,

Просмотреть файл

@ -15,6 +15,8 @@
#ifndef mozilla_widget_PuppetWidget_h__
#define mozilla_widget_PuppetWidget_h__
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "nsBaseScreen.h"
#include "nsBaseWidget.h"
#include "nsIScreenManager.h"
@ -38,6 +40,7 @@ class AutoCacheNativeKeyCommands;
class PuppetWidget : public nsBaseWidget, public nsSupportsWeakReference
{
typedef mozilla::dom::TabChild TabChild;
typedef mozilla::gfx::DrawTarget DrawTarget;
typedef nsBaseWidget Base;
// The width and height of the "widget" are clamped to this.
@ -158,7 +161,6 @@ public:
LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
bool* aAllowRetaining = nullptr);
virtual gfxASurface* GetThebesSurface();
NS_IMETHOD NotifyIME(const IMENotification& aIMENotification) MOZ_OVERRIDE;
NS_IMETHOD_(void) SetInputContext(const InputContext& aContext,
@ -225,7 +227,7 @@ private:
bool mVisible;
// XXX/cjones: keeping this around until we teach LayerManager to do
// retained-content-only transactions
nsRefPtr<gfxASurface> mSurface;
mozilla::RefPtr<DrawTarget> mDrawTarget;
// IME
nsIMEUpdatePreference mIMEPreferenceOfParent;
bool mIMEComposing;

Просмотреть файл

@ -1010,19 +1010,6 @@ nsDeviceContext* nsBaseWidget::GetDeviceContext()
return mContext;
}
//-------------------------------------------------------------------------
//
// Get the thebes surface
//
//-------------------------------------------------------------------------
gfxASurface *nsBaseWidget::GetThebesSurface()
{
// in theory we should get our parent's surface,
// clone it, and set a device offset before returning
return nullptr;
}
//-------------------------------------------------------------------------
//
// Destroy the window

Просмотреть файл

@ -144,7 +144,6 @@ public:
virtual void EndRemoteDrawing() { };
virtual void CleanupRemoteDrawing() { };
virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries) {}
virtual gfxASurface* GetThebesSurface();
NS_IMETHOD SetModal(bool aModal);
virtual uint32_t GetMaxTouchPoints() const;
NS_IMETHOD SetWindowClass(const nsAString& xulWinType);