author | David Anderson <danderson@mozilla.com> |
Fri, 01 Jul 2016 01:15:16 -0700 | |
changeset 343413 | 0cbb330c02c75657c3f4f9265d705217bb005c5b |
parent 343412 | 456f9b45d6d6529974864253973a2fcf1be41cdd |
child 343414 | 887adb3d9482c267c5928f5d900252361f35ac25 |
push id | 6389 |
push user | raliiev@mozilla.com |
push date | Mon, 19 Sep 2016 13:38:22 +0000 |
treeherder | mozilla-beta@01d67bfe6c81 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jimm |
bugs | 1281998 |
milestone | 50.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
|
--- a/gfx/ipc/CompositorSession.cpp +++ b/gfx/ipc/CompositorSession.cpp @@ -10,17 +10,17 @@ namespace mozilla { namespace layers { class InProcessCompositorSession final : public CompositorSession { public: InProcessCompositorSession( - widget::CompositorWidgetProxy* aWidgetProxy, + widget::CompositorWidget* aWidget, ClientLayerManager* aLayerManager, CSSToLayoutDeviceScale aScale, bool aUseAPZ, bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize); CompositorBridgeParent* GetInProcessBridge() const override; void SetContentController(GeckoContentController* aController) override; @@ -28,25 +28,25 @@ public: already_AddRefed<APZCTreeManager> GetAPZCTreeManager() const override; void Shutdown() override; private: RefPtr<CompositorBridgeParent> mCompositorBridgeParent; }; already_AddRefed<CompositorSession> -CompositorSession::CreateInProcess(widget::CompositorWidgetProxy* aWidgetProxy, +CompositorSession::CreateInProcess(widget::CompositorWidget* aWidget, ClientLayerManager* aLayerManager, CSSToLayoutDeviceScale aScale, bool aUseAPZ, bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize) { RefPtr<InProcessCompositorSession> session = new InProcessCompositorSession( - aWidgetProxy, + aWidget, aLayerManager, aScale, aUseAPZ, aUseExternalSurfaceSize, aSurfaceSize); return session.forget(); } @@ -59,25 +59,25 @@ CompositorSession::~CompositorSession() } CompositorBridgeChild* CompositorSession::GetCompositorBridgeChild() { return mCompositorBridgeChild; } -InProcessCompositorSession::InProcessCompositorSession(widget::CompositorWidgetProxy* aWidgetProxy, +InProcessCompositorSession::InProcessCompositorSession(widget::CompositorWidget* aWidget, ClientLayerManager* aLayerManager, CSSToLayoutDeviceScale aScale, bool aUseAPZ, bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize) { mCompositorBridgeParent = new CompositorBridgeParent( - aWidgetProxy, + aWidget, aScale, aUseAPZ, aUseExternalSurfaceSize, aSurfaceSize); mCompositorBridgeChild = new CompositorBridgeChild(aLayerManager); mCompositorBridgeChild->OpenSameProcess(mCompositorBridgeParent); mCompositorBridgeParent->SetOtherProcessId(base::GetCurrentProcId()); }
--- a/gfx/ipc/CompositorSession.h +++ b/gfx/ipc/CompositorSession.h @@ -8,17 +8,17 @@ #include "base/basictypes.h" #include "Units.h" #include "nsISupportsImpl.h" #include "mozilla/gfx/Point.h" namespace mozilla { namespace widget { -class CompositorWidgetProxy; +class CompositorWidget; } // namespace widget namespace gfx { class GPUProcessManager; } // namespace gfx namespace layers { class GeckoContentController; class APZCTreeManager; @@ -52,17 +52,17 @@ public: // Return the child end of the compositor IPC bridge. CompositorBridgeChild* GetCompositorBridgeChild(); protected: CompositorSession(); virtual ~CompositorSession(); static already_AddRefed<CompositorSession> CreateInProcess( - widget::CompositorWidgetProxy* aWidgetProxy, + widget::CompositorWidget* aWidget, ClientLayerManager* aLayerManager, CSSToLayoutDeviceScale aScale, bool aUseAPZ, bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize); protected: RefPtr<CompositorBridgeChild> mCompositorBridgeChild;
--- a/gfx/ipc/GPUProcessManager.cpp +++ b/gfx/ipc/GPUProcessManager.cpp @@ -145,25 +145,25 @@ GPUProcessManager::DestroyProcess() } mProcess->Shutdown(); mProcess = nullptr; mGPUChild = nullptr; } already_AddRefed<CompositorSession> -GPUProcessManager::CreateTopLevelCompositor(widget::CompositorWidgetProxy* aProxy, +GPUProcessManager::CreateTopLevelCompositor(widget::CompositorWidget* aWidget, ClientLayerManager* aLayerManager, CSSToLayoutDeviceScale aScale, bool aUseAPZ, bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize) { return CompositorSession::CreateInProcess( - aProxy, + aWidget, aLayerManager, aScale, aUseAPZ, aUseExternalSurfaceSize, aSurfaceSize); } PCompositorBridgeParent*
--- a/gfx/ipc/GPUProcessManager.h +++ b/gfx/ipc/GPUProcessManager.h @@ -19,17 +19,17 @@ namespace mozilla { namespace layers { class APZCTreeManager; class CompositorSession; class ClientLayerManager; class CompositorUpdateObserver; class PCompositorBridgeParent; } // namespace layers namespace widget { -class CompositorWidgetProxy; +class CompositorWidget; } // namespace widget namespace dom { class ContentParent; class TabParent; } // namespace dom namespace ipc { class GeckoChildProcessHost; } // namespace ipc @@ -56,17 +56,17 @@ public: void EnableGPUProcess(); // Ensure that GPU-bound methods can be used. If no GPU process is being // used, or one is launched and ready, this function returns immediately. // Otherwise it blocks until the GPU process has finished launching. void EnsureGPUReady(); already_AddRefed<layers::CompositorSession> CreateTopLevelCompositor( - widget::CompositorWidgetProxy* aProxy, + widget::CompositorWidget* aWidget, layers::ClientLayerManager* aLayerManager, CSSToLayoutDeviceScale aScale, bool aUseAPZ, bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize); layers::PCompositorBridgeParent* CreateTabCompositorBridge( ipc::Transport* aTransport,
--- a/gfx/layers/Compositor.cpp +++ b/gfx/layers/Compositor.cpp @@ -20,17 +20,17 @@ #include "nsWindow.h" #include "nsScreenManagerGonk.h" #endif namespace mozilla { namespace layers { -Compositor::Compositor(widget::CompositorWidgetProxy* aWidget, +Compositor::Compositor(widget::CompositorWidget* aWidget, CompositorBridgeParent* aParent) : mCompositorID(0) , mDiagnosticTypes(DiagnosticTypes::NO_DIAGNOSTIC) , mParent(aParent) , mPixelsPerFrame(0) , mPixelsFilled(0) , mScreenRotation(ROTATION_0) , mWidget(aWidget)
--- a/gfx/layers/Compositor.h +++ b/gfx/layers/Compositor.h @@ -12,21 +12,21 @@ #include "mozilla/gfx/2D.h" // for DrawTarget #include "mozilla/gfx/MatrixFwd.h" // for Matrix4x4 #include "mozilla/gfx/Point.h" // for IntSize, Point #include "mozilla/gfx/Rect.h" // for Rect, IntRect #include "mozilla/gfx/Types.h" // for Float #include "mozilla/layers/CompositorTypes.h" // for DiagnosticTypes, etc #include "mozilla/layers/FenceUtils.h" // for FenceHandle #include "mozilla/layers/LayersTypes.h" // for LayersBackend +#include "mozilla/widget/CompositorWidget.h" #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc #include "nsRegion.h" #include <vector> #include "mozilla/WidgetUtils.h" -#include "CompositorWidgetProxy.h" /** * Different elements of a web pages are rendered into separate "layers" before * they are flattened into the final image that is brought to the screen. * See Layers.h for more informations about layers and why we use retained * structures. * Most of the documentation for layers is directly in the source code in the * form of doc comments. An overview can also be found in the the wiki: @@ -187,17 +187,17 @@ enum SurfaceInitMode class Compositor { protected: virtual ~Compositor(); public: NS_INLINE_DECL_REFCOUNTING(Compositor) - explicit Compositor(widget::CompositorWidgetProxy* aWidget, + explicit Compositor(widget::CompositorWidget* aWidget, CompositorBridgeParent* aParent = nullptr); virtual already_AddRefed<DataTextureSource> CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) = 0; virtual already_AddRefed<DataTextureSource> CreateDataTextureSourceAround(gfx::DataSourceSurface* aSurface) { return nullptr; } virtual bool Initialize() = 0; @@ -469,17 +469,17 @@ public: /** * Call before rendering begins to ensure the compositor is ready to * composite. Returns false if rendering should be aborted. */ virtual bool Ready() { return true; } virtual void ForcePresent() { } - widget::CompositorWidgetProxy* GetWidget() const { return mWidget; } + widget::CompositorWidget* GetWidget() const { return mWidget; } virtual bool HasImageHostOverlays() { return false; } virtual void AddImageHostOverlay(ImageHostOverlay* aOverlay) {} virtual void RemoveImageHostOverlay(ImageHostOverlay* aOverlay) {} /** @@ -613,17 +613,17 @@ protected: size_t mPixelsPerFrame; size_t mPixelsFilled; ScreenRotation mScreenRotation; RefPtr<gfx::DrawTarget> mTarget; gfx::IntRect mTargetBounds; - widget::CompositorWidgetProxy* mWidget; + widget::CompositorWidget* mWidget; bool mIsDestroyed; #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17 FenceHandle mReleaseFenceHandle; #endif private:
--- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -75,17 +75,17 @@ public: SetUpdateSerial(0); } public: RefPtr<gfx::DataSourceSurface> mSurface; bool mWrappingExistingData; }; -BasicCompositor::BasicCompositor(CompositorBridgeParent* aParent, widget::CompositorWidgetProxy* aWidget) +BasicCompositor::BasicCompositor(CompositorBridgeParent* aParent, widget::CompositorWidget* aWidget) : Compositor(aWidget, aParent) , mDidExternalComposition(false) { MOZ_COUNT_CTOR(BasicCompositor); mMaxTextureSize = Factory::GetMaxSurfaceSize(gfxPlatform::GetPlatform()->GetContentBackendFor(LayersBackend::LAYERS_BASIC)); }
--- a/gfx/layers/basic/BasicCompositor.h +++ b/gfx/layers/basic/BasicCompositor.h @@ -36,17 +36,17 @@ public: RefPtr<gfx::DrawTarget> mDrawTarget; gfx::IntSize mSize; }; class BasicCompositor : public Compositor { public: - explicit BasicCompositor(CompositorBridgeParent* aParent, widget::CompositorWidgetProxy *aWidget); + explicit BasicCompositor(CompositorBridgeParent* aParent, widget::CompositorWidget* aWidget); protected: virtual ~BasicCompositor(); public: virtual BasicCompositor* AsBasicCompositor() override { return this; }
--- a/gfx/layers/basic/X11BasicCompositor.h +++ b/gfx/layers/basic/X11BasicCompositor.h @@ -41,17 +41,17 @@ public: private: // We are going to buffer layer content on this xlib draw target RefPtr<mozilla::gfx::DrawTarget> mBufferDrawTarget; }; class X11BasicCompositor : public BasicCompositor { public: - explicit X11BasicCompositor(CompositorBridgeParent* aParent, widget::CompositorWidgetProxy* aWidget) + explicit X11BasicCompositor(CompositorBridgeParent* aParent, widget::CompositorWidget* aWidget) : BasicCompositor(aParent, aWidget) {} virtual already_AddRefed<DataTextureSource> CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override; virtual already_AddRefed<DataTextureSource> CreateDataTextureSourceAround(gfx::DataSourceSurface* aSurface) override { return nullptr; }
--- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -17,17 +17,17 @@ #include "mozilla/layers/Effects.h" #include "nsWindowsHelpers.h" #include "gfxPrefs.h" #include "gfxConfig.h" #include "gfxCrashReporterUtils.h" #include "gfxVR.h" #include "mozilla/gfx/StackArray.h" #include "mozilla/Services.h" -#include "mozilla/widget/WinCompositorWidgetProxy.h" +#include "mozilla/widget/WinCompositorWidget.h" #include "mozilla/EnumeratedArray.h" #include "mozilla/Telemetry.h" #include "BlendShaderConstants.h" #include <dxgi1_2.h> namespace mozilla { @@ -155,17 +155,17 @@ private: return true; } // Only used during initialization. RefPtr<ID3D11Device> mDevice; bool mInitOkay; }; -CompositorD3D11::CompositorD3D11(CompositorBridgeParent* aParent, widget::CompositorWidgetProxy* aWidget) +CompositorD3D11::CompositorD3D11(CompositorBridgeParent* aParent, widget::CompositorWidget* aWidget) : Compositor(aWidget, aParent) , mAttachments(nullptr) , mHwnd(nullptr) , mDisableSequenceForNextFrame(false) , mVerifyBuffersFailed(false) { } @@ -211,17 +211,17 @@ CompositorD3D11::Initialize() if (!mContext) { gfxCriticalNote << "[D3D11] failed to get immediate context"; return false; } mFeatureLevel = mDevice->GetFeatureLevel(); - mHwnd = mWidget->AsWindowsProxy()->GetHwnd(); + mHwnd = mWidget->AsWindows()->GetHwnd(); memset(&mVSConstants, 0, sizeof(VertexShaderConstants)); int referenceCount = 0; UINT size = sizeof(referenceCount); // If this isn't there yet it'll fail, count will remain 0, which is correct. mDevice->GetPrivateData(sLayerManagerCount, &size, &referenceCount); referenceCount++;
--- a/gfx/layers/d3d11/CompositorD3D11.h +++ b/gfx/layers/d3d11/CompositorD3D11.h @@ -37,17 +37,17 @@ struct PixelShaderConstants int blendConfig[4]; }; struct DeviceAttachmentsD3D11; class CompositorD3D11 : public Compositor { public: - CompositorD3D11(CompositorBridgeParent* aParent, widget::CompositorWidgetProxy* aWidget); + CompositorD3D11(CompositorBridgeParent* aParent, widget::CompositorWidget* aWidget); ~CompositorD3D11(); virtual CompositorD3D11* AsCompositorD3D11() override { return this; } virtual bool Initialize() override; virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() override;
--- a/gfx/layers/d3d9/CompositorD3D9.cpp +++ b/gfx/layers/d3d9/CompositorD3D9.cpp @@ -12,24 +12,24 @@ #include "mozilla/layers/Effects.h" #include "nsWindowsHelpers.h" #include "Nv3DVUtils.h" #include "gfxFailure.h" #include "mozilla/layers/LayerManagerComposite.h" #include "gfxPrefs.h" #include "gfxCrashReporterUtils.h" #include "mozilla/layers/CompositorBridgeParent.h" -#include "mozilla/widget/WinCompositorWidgetProxy.h" +#include "mozilla/widget/WinCompositorWidget.h" namespace mozilla { namespace layers { using namespace mozilla::gfx; -CompositorD3D9::CompositorD3D9(CompositorBridgeParent* aParent, widget::CompositorWidgetProxy* aWidget) +CompositorD3D9::CompositorD3D9(CompositorBridgeParent* aParent, widget::CompositorWidget* aWidget) : Compositor(aWidget, aParent) , mDeviceResetCount(0) , mFailedResetAttempts(0) { } CompositorD3D9::~CompositorD3D9() { @@ -42,17 +42,17 @@ CompositorD3D9::Initialize() { ScopedGfxFeatureReporter reporter("D3D9 Layers"); mDeviceManager = gfxWindowsPlatform::GetPlatform()->GetD3D9DeviceManager(); if (!mDeviceManager) { return false; } - mSwapChain = mDeviceManager->CreateSwapChain(mWidget->AsWindowsProxy()->GetHwnd()); + mSwapChain = mDeviceManager->CreateSwapChain(mWidget->AsWindows()->GetHwnd()); if (!mSwapChain) { return false; } if (!mWidget->InitCompositor(this)) { return false; } @@ -585,17 +585,17 @@ CompositorD3D9::SetMask(const EffectChai */ bool CompositorD3D9::EnsureSwapChain() { MOZ_ASSERT(mDeviceManager, "Don't call EnsureSwapChain without a device manager"); if (!mSwapChain) { - mSwapChain = mDeviceManager->CreateSwapChain(mWidget->AsWindowsProxy()->GetHwnd()); + mSwapChain = mDeviceManager->CreateSwapChain(mWidget->AsWindows()->GetHwnd()); // We could not create a swap chain, return false if (!mSwapChain) { // Check the state of the device too DeviceManagerState state = mDeviceManager->VerifyReadyForRendering(); if (state == DeviceMustRecreate) { mDeviceManager = nullptr; } mParent->InvalidateRemoteLayers();
--- a/gfx/layers/d3d9/CompositorD3D9.h +++ b/gfx/layers/d3d9/CompositorD3D9.h @@ -16,17 +16,17 @@ class nsWidget; namespace mozilla { namespace layers { class CompositorD3D9 : public Compositor { public: - CompositorD3D9(CompositorBridgeParent* aParent, widget::CompositorWidgetProxy* aWidget); + CompositorD3D9(CompositorBridgeParent* aParent, widget::CompositorWidget* aWidget); ~CompositorD3D9(); virtual CompositorD3D9* AsCompositorD3D9() override { return this; } virtual bool Initialize() override; virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() override;
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -228,23 +228,23 @@ CompositorVsyncScheduler::Observer::Noti void CompositorVsyncScheduler::Observer::Destroy() { MutexAutoLock lock(mMutex); mOwner = nullptr; } CompositorVsyncScheduler::CompositorVsyncScheduler(CompositorBridgeParent* aCompositorBridgeParent, - widget::CompositorWidgetProxy* aWidgetProxy) + widget::CompositorWidget* aWidget) : mCompositorBridgeParent(aCompositorBridgeParent) , mLastCompose(TimeStamp::Now()) , mIsObservingVsync(false) , mNeedsComposite(0) , mVsyncNotificationsSkipped(0) - , mCompositorVsyncDispatcher(aWidgetProxy->GetCompositorVsyncDispatcher()) + , mCompositorVsyncDispatcher(aWidget->GetCompositorVsyncDispatcher()) , mCurrentCompositeTaskMonitor("CurrentCompositeTaskMonitor") , mCurrentCompositeTask(nullptr) , mSetNeedsCompositeMonitor("SetNeedsCompositeMonitor") , mSetNeedsCompositeTask(nullptr) #ifdef MOZ_WIDGET_GONK #if ANDROID_VERSION >= 19 , mDisplayEnabled(false) , mSetDisplayMonitor("SetDisplayMonitor") @@ -577,23 +577,23 @@ CompositorVsyncScheduler::ComposeToTarge } static inline MessageLoop* CompositorLoop() { return CompositorThreadHolder::Loop(); } -CompositorBridgeParent::CompositorBridgeParent(widget::CompositorWidgetProxy* aWidget, +CompositorBridgeParent::CompositorBridgeParent(widget::CompositorWidget* aWidget, CSSToLayoutDeviceScale aScale, bool aUseAPZ, bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize) : CompositorBridgeParentIPCAllocator("CompositorBridgeParent") - , mWidgetProxy(aWidget) + , mWidget(aWidget) , mIsTesting(false) , mPendingTransaction(0) , mPaused(false) , mUseExternalSurfaceSize(aUseExternalSurfaceSize) , mEGLSurfaceSize(aSurfaceSize) , mPauseCompositionMonitor("PauseCompositionMonitor") , mResumeCompositionMonitor("ResumeCompositionMonitor") , mResetCompositorMonitor("ResetCompositorMonitor") @@ -694,17 +694,17 @@ CompositorBridgeParent::StopAndClearReso if (mCompositor) { mCompositor->DetachWidget(); mCompositor->Destroy(); mCompositor = nullptr; } // After this point, it is no longer legal to access the widget. - mWidgetProxy = nullptr; + mWidget = nullptr; } bool CompositorBridgeParent::RecvWillClose() { StopAndClearResources(); return true; } @@ -1144,17 +1144,17 @@ CompositorBridgeParent::CompositeToTarge &hasRemoteContent, &updatePluginsFlag); #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) // We do not support plugins in local content. When switching tabs // to local pages, hide every plugin associated with the window. if (!hasRemoteContent && BrowserTabsRemoteAutostart() && mCachedPluginData.Length()) { - Unused << SendHideAllPlugins(GetWidgetProxy()->GetWidgetKey()); + Unused << SendHideAllPlugins(GetWidget()->GetWidgetKey()); mCachedPluginData.Clear(); } #endif if (aTarget) { mLayerManager->BeginTransactionWithDrawTarget(aTarget, *aRect); } else { mLayerManager->BeginTransaction(); @@ -1490,34 +1490,34 @@ CompositorBridgeParent::InitializeLayerM RefPtr<Compositor> CompositorBridgeParent::NewCompositor(const nsTArray<LayersBackend>& aBackendHints) { for (size_t i = 0; i < aBackendHints.Length(); ++i) { RefPtr<Compositor> compositor; if (aBackendHints[i] == LayersBackend::LAYERS_OPENGL) { compositor = new CompositorOGL(this, - mWidgetProxy, + mWidget, mEGLSurfaceSize.width, mEGLSurfaceSize.height, mUseExternalSurfaceSize); } else if (aBackendHints[i] == LayersBackend::LAYERS_BASIC) { #ifdef MOZ_WIDGET_GTK if (gfxPlatformGtk::GetPlatform()->UseXRender()) { - compositor = new X11BasicCompositor(this, mWidgetProxy); + compositor = new X11BasicCompositor(this, mWidget); } else #endif { - compositor = new BasicCompositor(this, mWidgetProxy); + compositor = new BasicCompositor(this, mWidget); } #ifdef XP_WIN } else if (aBackendHints[i] == LayersBackend::LAYERS_D3D11) { - compositor = new CompositorD3D11(this, mWidgetProxy); + compositor = new CompositorD3D11(this, mWidget); } else if (aBackendHints[i] == LayersBackend::LAYERS_D3D9) { - compositor = new CompositorD3D9(this, mWidgetProxy); + compositor = new CompositorD3D9(this, mWidget); #endif } if (compositor && compositor->Initialize()) { compositor->SetCompositorID(mCompositorID); return compositor; } } @@ -2460,17 +2460,17 @@ CompositorBridgeParent::UpdatePluginWind if (!lts.mPluginData.Length()) { // Don't hide plugins if the previous remote layer tree didn't contain any. if (!mCachedPluginData.Length()) { PLUGINS_LOG("[%" PRIu64 "] nothing to hide", aId); return false; } - uintptr_t parentWidget = GetWidgetProxy()->GetWidgetKey(); + uintptr_t parentWidget = GetWidget()->GetWidgetKey(); // We will pass through here in cases where the previous shadow layer // tree contained visible plugins and the new tree does not. All we need // to do here is hide the plugins for the old tree, so don't waste time // calculating clipping. mPluginsLayerOffset = nsIntPoint(0,0); mPluginsLayerVisibleRegion.SetEmpty(); Unused << lts.mParent->SendHideAllPlugins(parentWidget); @@ -2545,17 +2545,17 @@ CompositorBridgeParent::HideAllPluginWin { MOZ_ASSERT(!NS_IsMainThread()); // No plugins in the cache implies no plugins to manage // in this content. if (!mCachedPluginData.Length() || mDeferPluginWindows) { return; } - uintptr_t parentWidget = GetWidgetProxy()->GetWidgetKey(); + uintptr_t parentWidget = GetWidget()->GetWidgetKey(); mDeferPluginWindows = true; mPluginWindowsHidden = true; Unused << SendHideAllPlugins(parentWidget); ScheduleComposition(); } #endif // #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
--- a/gfx/layers/ipc/CompositorBridgeParent.h +++ b/gfx/layers/ipc/CompositorBridgeParent.h @@ -28,20 +28,20 @@ #include "mozilla/ipc/ProtocolUtils.h" #include "mozilla/ipc/SharedMemory.h" #include "mozilla/layers/GeckoContentController.h" #include "mozilla/layers/ISurfaceAllocator.h" // for ShmemAllocator #include "mozilla/layers/LayersMessages.h" // for TargetConfig #include "mozilla/layers/PCompositorBridgeParent.h" #include "mozilla/layers/ShadowLayersManager.h" // for ShadowLayersManager #include "mozilla/layers/APZTestData.h" +#include "mozilla/widget/CompositorWidget.h" #include "nsISupportsImpl.h" #include "ThreadSafeRefcountingWithMainThreadDestruction.h" #include "mozilla/VsyncDispatcher.h" -#include "CompositorWidgetProxy.h" class MessageLoop; class nsIWidget; namespace mozilla { class CancelableRunnable; @@ -85,17 +85,17 @@ private: * Turns vsync notifications into scheduled composites. **/ class CompositorVsyncScheduler { NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorVsyncScheduler) public: explicit CompositorVsyncScheduler(CompositorBridgeParent* aCompositorBridgeParent, - widget::CompositorWidgetProxy* aWidgetProxy); + widget::CompositorWidget* aWidget); #ifdef MOZ_WIDGET_GONK // emulator-ics never trigger the display on/off, so compositor will always // skip composition request at that device. Only check the display status // with kk device and upon. #if ANDROID_VERSION >= 19 // SetDisplay() and CancelSetDisplayTask() are used for the display on/off. // It will clear all composition related task and flag, and skip another @@ -207,17 +207,17 @@ class CompositorBridgeParent final : pub public ShmemAllocator { friend class CompositorVsyncScheduler; friend class CompositorThreadHolder; friend class InProcessCompositorSession; friend class gfx::GPUProcessManager; public: - explicit CompositorBridgeParent(widget::CompositorWidgetProxy* aWidget, + explicit CompositorBridgeParent(widget::CompositorWidget* aWidget, CSSToLayoutDeviceScale aScale, bool aUseAPZ, bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize); virtual bool RecvGetFrameUniformity(FrameUniformityData* aOutData) override; virtual bool RecvRequestOverfill() override; virtual bool RecvWillClose() override; @@ -459,17 +459,17 @@ public: /** * Used by the profiler to denote when a vsync occured */ static void PostInsertVsyncProfilerMarker(mozilla::TimeStamp aVsyncTimestamp); float ComputeRenderIntegrity(); - widget::CompositorWidgetProxy* GetWidgetProxy() { return mWidgetProxy; } + widget::CompositorWidget* GetWidget() { return mWidget; } void ForceComposeToTarget(gfx::DrawTarget* aTarget, const gfx::IntRect* aRect = nullptr); bool AsyncPanZoomEnabled() const { return !!mApzcTreeManager; } private: @@ -581,17 +581,17 @@ protected: // The indirect layer tree lock must be held before calling this function. // Callback should take (LayerTreeState* aState, const uint64_t& aLayersId) template <typename Lambda> inline void ForEachIndirectLayerTree(const Lambda& aCallback); RefPtr<LayerManagerComposite> mLayerManager; RefPtr<Compositor> mCompositor; RefPtr<AsyncCompositionManager> mCompositionManager; - widget::CompositorWidgetProxy* mWidgetProxy; + widget::CompositorWidget* mWidget; TimeStamp mTestTime; bool mIsTesting; uint64_t mPendingTransaction; bool mPaused; bool mUseExternalSurfaceSize;
--- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -79,17 +79,17 @@ CompositorOGL::BindBackdrop(ShaderProgra mGLContext->fActiveTexture(aTexUnit); mGLContext->fBindTexture(LOCAL_GL_TEXTURE_2D, aBackdrop); mGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR); mGLContext->fTexParameteri(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER, LOCAL_GL_LINEAR); aProgram->SetBackdropTextureUnit(aTexUnit - LOCAL_GL_TEXTURE0); } CompositorOGL::CompositorOGL(CompositorBridgeParent* aParent, - widget::CompositorWidgetProxy* aWidget, + widget::CompositorWidget* aWidget, int aSurfaceWidth, int aSurfaceHeight, bool aUseExternalSurfaceSize) : Compositor(aWidget, aParent) , mWidgetSize(-1, -1) , mSurfaceSize(aSurfaceWidth, aSurfaceHeight) , mHasBGRA(0) , mUseExternalSurfaceSize(aUseExternalSurfaceSize) , mFrameInProgress(false) @@ -613,17 +613,17 @@ CompositingRenderTarget* CompositorOGL::GetCurrentRenderTarget() const { return mCurrentRenderTarget; } static GLenum GetFrameBufferInternalFormat(GLContext* gl, GLuint aFrameBuffer, - mozilla::widget::CompositorWidgetProxy* aWidget) + mozilla::widget::CompositorWidget* aWidget) { if (aFrameBuffer == 0) { // default framebuffer return aWidget->GetGLFrameBufferFormat(); } return LOCAL_GL_RGBA; } void
--- a/gfx/layers/opengl/CompositorOGL.h +++ b/gfx/layers/opengl/CompositorOGL.h @@ -188,17 +188,17 @@ class CompositorOGL final : public Compo typedef mozilla::gl::GLContext GLContext; friend class GLManagerCompositor; friend class CompositingRenderTargetOGL; std::map<ShaderConfigOGL, ShaderProgramOGL*> mPrograms; public: explicit CompositorOGL(CompositorBridgeParent* aParent, - widget::CompositorWidgetProxy* aWidget, + widget::CompositorWidget* aWidget, int aSurfaceWidth = -1, int aSurfaceHeight = -1, bool aUseExternalSurfaceSize = false); protected: virtual ~CompositorOGL(); public: virtual CompositorOGL* AsCompositorOGL() override { return this; }
--- a/gfx/tests/gtest/TestCompositor.cpp +++ b/gfx/tests/gtest/TestCompositor.cpp @@ -94,31 +94,31 @@ private: ~MockWidget() {} }; NS_IMPL_ISUPPORTS_INHERITED0(MockWidget, nsBaseWidget) struct LayerManagerData { RefPtr<MockWidget> mWidget; RefPtr<Compositor> mCompositor; - RefPtr<widget::CompositorWidgetProxy> mCompositorWidgetProxy; + RefPtr<widget::CompositorWidget> mCompositorWidget; RefPtr<LayerManagerComposite> mLayerManager; LayerManagerData(Compositor* compositor, MockWidget* widget, - widget::CompositorWidgetProxy* aProxy, + widget::CompositorWidget* aWidget, LayerManagerComposite* layerManager) : mWidget(widget) , mCompositor(compositor) - , mCompositorWidgetProxy(aProxy) + , mCompositorWidget(aWidget) , mLayerManager(layerManager) {} }; -static already_AddRefed<Compositor> CreateTestCompositor(LayersBackend backend, widget::CompositorWidgetProxy* widget) +static already_AddRefed<Compositor> CreateTestCompositor(LayersBackend backend, widget::CompositorWidget* widget) { gfxPrefs::GetSingleton(); RefPtr<Compositor> compositor; if (backend == LayersBackend::LAYERS_OPENGL) { compositor = new CompositorOGL(nullptr, widget, @@ -152,17 +152,17 @@ static already_AddRefed<Compositor> Crea static std::vector<LayerManagerData> GetLayerManagers(std::vector<LayersBackend> aBackends) { std::vector<LayerManagerData> managers; for (size_t i = 0; i < aBackends.size(); i++) { auto backend = aBackends[i]; RefPtr<MockWidget> widget = new MockWidget(); - RefPtr<widget::CompositorWidgetProxy> proxy = widget->NewCompositorWidgetProxy(); + RefPtr<widget::CompositorWidget> proxy = widget->NewCompositorWidget(); RefPtr<Compositor> compositor = CreateTestCompositor(backend, proxy); RefPtr<LayerManagerComposite> layerManager = new LayerManagerComposite(compositor); managers.push_back(LayerManagerData(compositor, widget, proxy, layerManager)); } return managers;
rename from widget/CompositorWidgetProxy.cpp rename to widget/CompositorWidget.cpp --- a/widget/CompositorWidgetProxy.cpp +++ b/widget/CompositorWidget.cpp @@ -1,40 +1,40 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "CompositorWidgetProxy.h" +#include "CompositorWidget.h" #include "GLConsts.h" #include "nsBaseWidget.h" #include "VsyncDispatcher.h" namespace mozilla { namespace widget { -CompositorWidgetProxy::~CompositorWidgetProxy() +CompositorWidget::~CompositorWidget() { } already_AddRefed<gfx::DrawTarget> -CompositorWidgetProxy::StartRemoteDrawing() +CompositorWidget::StartRemoteDrawing() { return nullptr; } void -CompositorWidgetProxy::CleanupRemoteDrawing() +CompositorWidget::CleanupRemoteDrawing() { mLastBackBuffer = nullptr; } already_AddRefed<gfx::DrawTarget> -CompositorWidgetProxy::GetBackBufferDrawTarget(gfx::DrawTarget* aScreenTarget, - const LayoutDeviceIntRect& aRect, - const LayoutDeviceIntRect& aClearRect) +CompositorWidget::GetBackBufferDrawTarget(gfx::DrawTarget* aScreenTarget, + const LayoutDeviceIntRect& aRect, + const LayoutDeviceIntRect& aClearRect) { MOZ_ASSERT(aScreenTarget); gfx::SurfaceFormat format = aScreenTarget->GetFormat() == gfx::SurfaceFormat::B8G8R8X8 ? gfx::SurfaceFormat::B8G8R8X8 : gfx::SurfaceFormat::B8G8R8A8; gfx::IntSize size = aRect.ToUnknownRect().Size(); gfx::IntSize clientSize(GetClientSize().ToUnknownSize()); RefPtr<gfx::DrawTarget> target; @@ -53,134 +53,134 @@ CompositorWidgetProxy::GetBackBufferDraw } else { target = aScreenTarget->CreateSimilarDrawTarget(size, format); mLastBackBuffer = target; } return target.forget(); } already_AddRefed<gfx::SourceSurface> -CompositorWidgetProxy::EndBackBufferDrawing() +CompositorWidget::EndBackBufferDrawing() { RefPtr<gfx::SourceSurface> surface = mLastBackBuffer ? mLastBackBuffer->Snapshot() : nullptr; return surface.forget(); } uint32_t -CompositorWidgetProxy::GetGLFrameBufferFormat() +CompositorWidget::GetGLFrameBufferFormat() { return LOCAL_GL_RGBA; } -CompositorWidgetProxyWrapper::CompositorWidgetProxyWrapper(nsBaseWidget* aWidget) +InProcessCompositorWidget::InProcessCompositorWidget(nsBaseWidget* aWidget) : mWidget(aWidget) { } bool -CompositorWidgetProxyWrapper::PreRender(layers::LayerManagerComposite* aManager) +InProcessCompositorWidget::PreRender(layers::LayerManagerComposite* aManager) { return mWidget->PreRender(aManager); } void -CompositorWidgetProxyWrapper::PostRender(layers::LayerManagerComposite* aManager) +InProcessCompositorWidget::PostRender(layers::LayerManagerComposite* aManager) { mWidget->PostRender(aManager); } void -CompositorWidgetProxyWrapper::DrawWindowUnderlay(layers::LayerManagerComposite* aManager, - LayoutDeviceIntRect aRect) +InProcessCompositorWidget::DrawWindowUnderlay(layers::LayerManagerComposite* aManager, + LayoutDeviceIntRect aRect) { mWidget->DrawWindowUnderlay(aManager, aRect); } void -CompositorWidgetProxyWrapper::DrawWindowOverlay(layers::LayerManagerComposite* aManager, - LayoutDeviceIntRect aRect) +InProcessCompositorWidget::DrawWindowOverlay(layers::LayerManagerComposite* aManager, + LayoutDeviceIntRect aRect) { mWidget->DrawWindowOverlay(aManager, aRect); } already_AddRefed<gfx::DrawTarget> -CompositorWidgetProxyWrapper::StartRemoteDrawing() +InProcessCompositorWidget::StartRemoteDrawing() { return mWidget->StartRemoteDrawing(); } already_AddRefed<gfx::DrawTarget> -CompositorWidgetProxyWrapper::StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion, - layers::BufferMode* aBufferMode) +InProcessCompositorWidget::StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion, + layers::BufferMode* aBufferMode) { return mWidget->StartRemoteDrawingInRegion(aInvalidRegion, aBufferMode); } void -CompositorWidgetProxyWrapper::EndRemoteDrawing() +InProcessCompositorWidget::EndRemoteDrawing() { mWidget->EndRemoteDrawing(); } void -CompositorWidgetProxyWrapper::EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget, - LayoutDeviceIntRegion& aInvalidRegion) +InProcessCompositorWidget::EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget, + LayoutDeviceIntRegion& aInvalidRegion) { mWidget->EndRemoteDrawingInRegion(aDrawTarget, aInvalidRegion); } void -CompositorWidgetProxyWrapper::CleanupRemoteDrawing() +InProcessCompositorWidget::CleanupRemoteDrawing() { mWidget->CleanupRemoteDrawing(); } void -CompositorWidgetProxyWrapper::CleanupWindowEffects() +InProcessCompositorWidget::CleanupWindowEffects() { mWidget->CleanupWindowEffects(); } bool -CompositorWidgetProxyWrapper::InitCompositor(layers::Compositor* aCompositor) +InProcessCompositorWidget::InitCompositor(layers::Compositor* aCompositor) { return mWidget->InitCompositor(aCompositor); } LayoutDeviceIntSize -CompositorWidgetProxyWrapper::GetClientSize() +InProcessCompositorWidget::GetClientSize() { return mWidget->GetClientSize(); } uint32_t -CompositorWidgetProxyWrapper::GetGLFrameBufferFormat() +InProcessCompositorWidget::GetGLFrameBufferFormat() { return mWidget->GetGLFrameBufferFormat(); } layers::Composer2D* -CompositorWidgetProxyWrapper::GetComposer2D() +InProcessCompositorWidget::GetComposer2D() { return mWidget->GetComposer2D(); } uintptr_t -CompositorWidgetProxyWrapper::GetWidgetKey() +InProcessCompositorWidget::GetWidgetKey() { return reinterpret_cast<uintptr_t>(mWidget); } nsIWidget* -CompositorWidgetProxyWrapper::RealWidget() +InProcessCompositorWidget::RealWidget() { return mWidget; } already_AddRefed<CompositorVsyncDispatcher> -CompositorWidgetProxyWrapper::GetCompositorVsyncDispatcher() +InProcessCompositorWidget::GetCompositorVsyncDispatcher() { RefPtr<CompositorVsyncDispatcher> cvd = mWidget->GetCompositorVsyncDispatcher(); return cvd.forget(); } } // namespace widget } // namespace mozilla
rename from widget/CompositorWidgetProxy.h rename to widget/CompositorWidget.h --- a/widget/CompositorWidgetProxy.h +++ b/widget/CompositorWidget.h @@ -1,14 +1,14 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef mozilla_widget_CompositorWidgetProxy_h__ -#define mozilla_widget_CompositorWidgetProxy_h__ +#ifndef mozilla_widget_CompositorWidget_h__ +#define mozilla_widget_CompositorWidget_h__ #include "nsISupports.h" #include "mozilla/RefPtr.h" #include "Units.h" #include "mozilla/gfx/2D.h" #include "mozilla/layers/LayersTypes.h" class nsIWidget; @@ -23,25 +23,25 @@ class Compositor; class Composer2D; } // namespace layers namespace gfx { class DrawTarget; class SourceSurface; } // namespace gfx namespace widget { -class WinCompositorWidgetProxy; +class WinCompositorWidget; /** * Access to a widget from the compositor is restricted to these methods. */ -class CompositorWidgetProxy +class CompositorWidget { public: - NS_INLINE_DECL_REFCOUNTING(mozilla::widget::CompositorWidgetProxy) + NS_INLINE_DECL_REFCOUNTING(mozilla::widget::CompositorWidget) /** * Called before rendering using OMTC. Returns false when the widget is * not ready to be rendered (for example while the window is closed). * * Always called from the compositing thread, which may be the main-thread if * OMTC is not enabled. */ @@ -195,33 +195,33 @@ public: */ virtual already_AddRefed<gfx::SourceSurface> EndBackBufferDrawing(); /** * Return a compositor vsync dispatcher for this widget. */ virtual already_AddRefed<CompositorVsyncDispatcher> GetCompositorVsyncDispatcher() = 0; - virtual WinCompositorWidgetProxy* AsWindowsProxy() { + virtual WinCompositorWidget* AsWindows() { return nullptr; } protected: - virtual ~CompositorWidgetProxy(); + virtual ~CompositorWidget(); // Back buffer of BasicCompositor RefPtr<gfx::DrawTarget> mLastBackBuffer; }; -// This version of CompositorWidgetProxy implements a wrapper around +// This version of CompositorWidget implements a wrapper around // nsBaseWidget. -class CompositorWidgetProxyWrapper : public CompositorWidgetProxy +class InProcessCompositorWidget : public CompositorWidget { public: - explicit CompositorWidgetProxyWrapper(nsBaseWidget* aWidget); + explicit InProcessCompositorWidget(nsBaseWidget* aWidget); virtual bool PreRender(layers::LayerManagerComposite* aManager) override; virtual void PostRender(layers::LayerManagerComposite* aManager) override; virtual void DrawWindowUnderlay(layers::LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override; virtual void DrawWindowOverlay(layers::LayerManagerComposite* aManager, LayoutDeviceIntRect aRect) override; virtual already_AddRefed<gfx::DrawTarget> StartRemoteDrawing() override; @@ -235,17 +235,17 @@ public: virtual void CleanupWindowEffects() override; virtual bool InitCompositor(layers::Compositor* aCompositor) override; virtual LayoutDeviceIntSize GetClientSize() override; virtual uint32_t GetGLFrameBufferFormat() override; virtual layers::Composer2D* GetComposer2D() override; virtual already_AddRefed<CompositorVsyncDispatcher> GetCompositorVsyncDispatcher() override; virtual uintptr_t GetWidgetKey() override; - // If you can override this method, inherit from CompositorWidgetProxy instead. + // If you can override this method, inherit from CompositorWidget instead. nsIWidget* RealWidget() override; private: nsBaseWidget* mWidget; }; } // namespace widget } // namespace mozilla
--- a/widget/PuppetWidget.h +++ b/widget/PuppetWidget.h @@ -275,17 +275,17 @@ public: const bool aIsVertical, const LayoutDeviceIntPoint& aPoint) override; protected: virtual nsresult NotifyIMEInternal( const IMENotification& aIMENotification) override; // PuppetWidgets do not create compositors. - widget::CompositorWidgetProxy* NewCompositorWidgetProxy() override { + widget::CompositorWidget* NewCompositorWidget() override { MOZ_ASSERT_UNREACHABLE("PuppetWidgets should not have widget proxies"); return nullptr; } private: nsresult Paint(); void SetChild(PuppetWidget* aChild);
--- a/widget/cocoa/nsCocoaWindow.h +++ b/widget/cocoa/nsCocoaWindow.h @@ -348,17 +348,17 @@ public: const mozilla::WidgetKeyboardEvent& aEvent, DoCommandCallback aCallback, void* aCallbackData) override; void SetPopupWindowLevel(); NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) override; - CompositorWidgetProxy* NewCompositorWidgetProxy() override { + CompositorWidget* NewCompositorWidget() override { return nullptr; } protected: virtual ~nsCocoaWindow(); nsresult CreateNativeWindow(const NSRect &aRect, nsBorderStyle aBorderStyle,
--- a/widget/moz.build +++ b/widget/moz.build @@ -83,17 +83,16 @@ XPIDL_SOURCES += [ 'nsIScreenManager.idl', 'nsISound.idl', 'nsITransferable.idl', ] XPIDL_MODULE = 'widget' EXPORTS += [ - 'CompositorWidgetProxy.h', 'GfxDriverInfo.h', 'GfxInfoBase.h', 'GfxInfoCollector.h', 'InputData.h', 'nsBaseScreen.h', 'nsBaseWidget.h', 'nsIDeviceContextSpec.h', 'nsIKeyEventInPluginCallback.h', @@ -124,23 +123,24 @@ EXPORTS.mozilla += [ 'TextEvents.h', 'TextRange.h', 'TouchEvents.h', 'VsyncDispatcher.h', 'WidgetUtils.h', ] EXPORTS.mozilla.widget += [ + 'CompositorWidget.h', 'IMEData.h', 'PuppetBidiKeyboard.h', 'WidgetMessageUtils.h', ] UNIFIED_SOURCES += [ - 'CompositorWidgetProxy.cpp', + 'CompositorWidget.cpp', 'ContentCache.cpp', 'GfxDriverInfo.cpp', 'GfxInfoBase.cpp', 'GfxInfoCollector.cpp', 'GfxInfoWebGL.cpp', 'InputData.cpp', 'nsBaseAppShell.cpp', 'nsBaseScreen.cpp',
--- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -277,17 +277,17 @@ void nsBaseWidget::DestroyCompositor() // XXX CompositorBridgeChild and CompositorBridgeParent might be re-created in // ClientLayerManager destructor. See bug 1133426. RefPtr<CompositorSession> session = mCompositorSession.forget(); session->Shutdown(); // Widget is used in CompositorBridgeParent, so we can't release it until // it has acknowledged shutdown. - mCompositorWidgetProxy = nullptr; + mCompositorWidget = nullptr; } // Can have base widgets that are things like tooltips // which don't have CompositorVsyncDispatchers if (mCompositorVsyncDispatcher) { mCompositorVsyncDispatcher->Shutdown(); mCompositorVsyncDispatcher = nullptr; } @@ -1301,25 +1301,25 @@ void nsBaseWidget::CreateCompositor(int // If we've already received a shutdown notification, don't try // create a new compositor. if (!mShutdownObserver) { return; } CreateCompositorVsyncDispatcher(); - if (!mCompositorWidgetProxy) { - mCompositorWidgetProxy = NewCompositorWidgetProxy(); + if (!mCompositorWidget) { + mCompositorWidget = NewCompositorWidget(); } RefPtr<ClientLayerManager> lm = new ClientLayerManager(this); gfx::GPUProcessManager* gpu = gfx::GPUProcessManager::Get(); mCompositorSession = gpu->CreateTopLevelCompositor( - mCompositorWidgetProxy, + mCompositorWidget, lm, GetDefaultScale(), UseAPZ(), UseExternalCompositingSurface(), gfx::IntSize(aWidth, aHeight)); mCompositorBridgeChild = mCompositorSession->GetCompositorBridgeChild(); mAPZC = mCompositorSession->GetAPZCTreeManager(); @@ -1415,20 +1415,20 @@ nsBaseWidget::StartRemoteDrawing() } uint32_t nsBaseWidget::GetGLFrameBufferFormat() { return LOCAL_GL_RGBA; } -mozilla::widget::CompositorWidgetProxy* -nsBaseWidget::NewCompositorWidgetProxy() +mozilla::widget::CompositorWidget* +nsBaseWidget::NewCompositorWidget() { - return new mozilla::widget::CompositorWidgetProxyWrapper(this); + return new mozilla::widget::InProcessCompositorWidget(this); } //------------------------------------------------------------------------- // // Destroy the window // //------------------------------------------------------------------------- void nsBaseWidget::OnDestroy()
--- a/widget/nsBaseWidget.h +++ b/widget/nsBaseWidget.h @@ -16,17 +16,16 @@ #include "nsIFile.h" #include "nsString.h" #include "nsCOMPtr.h" #include "nsIRollupListener.h" #include "nsIObserver.h" #include "nsIWidgetListener.h" #include "nsPIDOMWindow.h" #include "nsWeakReference.h" -#include "CompositorWidgetProxy.h" #include <algorithm> class nsIContent; class nsAutoRollup; class gfxContext; namespace mozilla { class CompositorVsyncDispatcher; #ifdef ACCESSIBILITY @@ -45,16 +44,21 @@ class CompositorBridgeChild; class CompositorBridgeParent; class APZCTreeManager; class GeckoContentController; class APZEventState; class CompositorSession; struct ScrollableLayerGuid; } // namespace layers +namespace widget { +class CompositorWidget; +class InProcessCompositorWidget; +} // namespace widget + class CompositorVsyncDispatcher; } // namespace mozilla namespace base { class Thread; } // namespace base // Windows specific constant indicating the maximum number of touch points the @@ -90,34 +94,34 @@ public: * (Note: widget implementations are not required to use this * class, but it gives them a head start.) */ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference { friend class nsAutoRollup; friend class DispatchWheelEventOnMainThread; - friend class mozilla::widget::CompositorWidgetProxyWrapper; + friend class mozilla::widget::InProcessCompositorWidget; protected: typedef base::Thread Thread; typedef mozilla::gfx::DrawTarget DrawTarget; typedef mozilla::layers::BasicLayerManager BasicLayerManager; typedef mozilla::layers::BufferMode BufferMode; typedef mozilla::layers::CompositorBridgeChild CompositorBridgeChild; typedef mozilla::layers::CompositorBridgeParent CompositorBridgeParent; typedef mozilla::layers::APZCTreeManager APZCTreeManager; typedef mozilla::layers::GeckoContentController GeckoContentController; typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid; typedef mozilla::layers::APZEventState APZEventState; typedef mozilla::layers::SetAllowedTouchBehaviorCallback SetAllowedTouchBehaviorCallback; typedef mozilla::CSSIntRect CSSIntRect; typedef mozilla::CSSRect CSSRect; typedef mozilla::ScreenRotation ScreenRotation; - typedef mozilla::widget::CompositorWidgetProxy CompositorWidgetProxy; + typedef mozilla::widget::CompositorWidget CompositorWidget; typedef mozilla::layers::CompositorSession CompositorSession; virtual ~nsBaseWidget(); public: nsBaseWidget(); NS_DECL_ISUPPORTS @@ -345,21 +349,21 @@ public: friend class AutoLayerManagerSetup; virtual bool ShouldUseOffMainThreadCompositing(); static nsIRollupListener* GetActiveRollupListener(); void Shutdown(); - // Return a new CompositorWidgetProxy for this widget. - virtual CompositorWidgetProxy* NewCompositorWidgetProxy(); + // Return a new CompositorWidget for this widget. + virtual CompositorWidget* NewCompositorWidget(); protected: - // These are methods for CompositorWidgetProxyWrapper, and should only be + // These are methods for CompositorWidgetWrapper, and should only be // accessed from that class. Derived widgets can choose which methods to // implement, or none if supporting out-of-process compositing. virtual bool PreRender(mozilla::layers::LayerManagerComposite* aManager) { return true; } virtual void PostRender(mozilla::layers::LayerManagerComposite* aManager) {} virtual void DrawWindowUnderlay(mozilla::layers::LayerManagerComposite* aManager, @@ -582,17 +586,17 @@ protected: // When this pointer is null, the widget is not clipped mozilla::UniquePtr<LayoutDeviceIntRect[]> mClipRects; uint32_t mClipRectCount; nsSizeMode mSizeMode; nsPopupLevel mPopupLevel; nsPopupType mPopupType; SizeConstraints mSizeConstraints; - RefPtr<CompositorWidgetProxy> mCompositorWidgetProxy; + RefPtr<CompositorWidget> mCompositorWidget; bool mUpdateCursor; bool mUseAttachedEvents; bool mIMEHasFocus; #if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) bool mAccessibilityInUseFlag; #endif static nsIRollupListener* gRollupListener;
rename from widget/windows/WinCompositorWidgetProxy.cpp rename to widget/windows/WinCompositorWidget.cpp --- a/widget/windows/WinCompositorWidgetProxy.cpp +++ b/widget/windows/WinCompositorWidget.cpp @@ -1,83 +1,83 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "WinCompositorWidgetProxy.h" +#include "WinCompositorWidget.h" #include "nsWindow.h" #include "VsyncDispatcher.h" #include "mozilla/gfx/Point.h" namespace mozilla { namespace widget { using namespace mozilla::gfx; -WinCompositorWidgetProxy::WinCompositorWidgetProxy(HWND aWnd, - uintptr_t aWidgetKey, - nsTransparencyMode aMode, - nsWindow* aWindow) +WinCompositorWidget::WinCompositorWidget(HWND aWnd, + uintptr_t aWidgetKey, + nsTransparencyMode aMode, + nsWindow* aWindow) : mWindow(aWindow), mWidgetKey(aWidgetKey), mWnd(aWnd), mTransparencyMode(aMode), mMemoryDC(nullptr), mCompositeDC(nullptr), mLockedBackBufferData(nullptr) { MOZ_ASSERT(mWnd && ::IsWindow(mWnd)); } void -WinCompositorWidgetProxy::OnDestroyWindow() +WinCompositorWidget::OnDestroyWindow() { mTransparentSurface = nullptr; mMemoryDC = nullptr; } bool -WinCompositorWidgetProxy::PreRender(layers::LayerManagerComposite* aManager) +WinCompositorWidget::PreRender(layers::LayerManagerComposite* aManager) { // This can block waiting for WM_SETTEXT to finish // Using PreRender is unnecessarily pessimistic because // we technically only need to block during the present call // not all of compositor rendering mPresentLock.Enter(); return true; } void -WinCompositorWidgetProxy::PostRender(layers::LayerManagerComposite* aManager) +WinCompositorWidget::PostRender(layers::LayerManagerComposite* aManager) { mPresentLock.Leave(); } nsIWidget* -WinCompositorWidgetProxy::RealWidget() +WinCompositorWidget::RealWidget() { MOZ_ASSERT(mWindow); return mWindow; } LayoutDeviceIntSize -WinCompositorWidgetProxy::GetClientSize() +WinCompositorWidget::GetClientSize() { RECT r; if (!::GetClientRect(mWnd, &r)) { return LayoutDeviceIntSize(); } return LayoutDeviceIntSize( r.right - r.left, r.bottom - r.top); } already_AddRefed<gfx::DrawTarget> -WinCompositorWidgetProxy::StartRemoteDrawing() +WinCompositorWidget::StartRemoteDrawing() { MOZ_ASSERT(!mCompositeDC); RefPtr<gfxASurface> surf; if (mTransparencyMode == eTransparencyTransparent) { surf = EnsureTransparentSurface(); } @@ -103,39 +103,39 @@ WinCompositorWidgetProxy::StartRemoteDra MOZ_ASSERT(!mCompositeDC); mCompositeDC = dc; return mozilla::gfx::Factory::CreateDrawTargetForCairoSurface(surf->CairoSurface(), size); } void -WinCompositorWidgetProxy::EndRemoteDrawing() +WinCompositorWidget::EndRemoteDrawing() { MOZ_ASSERT(!mLockedBackBufferData); if (mTransparencyMode == eTransparencyTransparent) { MOZ_ASSERT(mTransparentSurface); RedrawTransparentWindow(); } if (mCompositeDC) { FreeWindowSurface(mCompositeDC); } mCompositeDC = nullptr; } already_AddRefed<gfx::DrawTarget> -WinCompositorWidgetProxy::GetBackBufferDrawTarget(gfx::DrawTarget* aScreenTarget, - const LayoutDeviceIntRect& aRect, - const LayoutDeviceIntRect& aClearRect) +WinCompositorWidget::GetBackBufferDrawTarget(gfx::DrawTarget* aScreenTarget, + const LayoutDeviceIntRect& aRect, + const LayoutDeviceIntRect& aClearRect) { MOZ_ASSERT(!mLockedBackBufferData); RefPtr<gfx::DrawTarget> target = - CompositorWidgetProxy::GetBackBufferDrawTarget(aScreenTarget, aRect, aClearRect); + CompositorWidget::GetBackBufferDrawTarget(aScreenTarget, aRect, aClearRect); if (!target) { return nullptr; } MOZ_ASSERT(target->GetBackendType() == BackendType::CAIRO); uint8_t* destData; IntSize destSize; @@ -153,107 +153,107 @@ WinCompositorWidgetProxy::GetBackBufferD destStride, destFormat); mLockedBackBufferData = destData; return dataTarget.forget(); } already_AddRefed<gfx::SourceSurface> -WinCompositorWidgetProxy::EndBackBufferDrawing() +WinCompositorWidget::EndBackBufferDrawing() { if (mLockedBackBufferData) { MOZ_ASSERT(mLastBackBuffer); mLastBackBuffer->ReleaseBits(mLockedBackBufferData); mLockedBackBufferData = nullptr; } - return CompositorWidgetProxy::EndBackBufferDrawing(); + return CompositorWidget::EndBackBufferDrawing(); } already_AddRefed<CompositorVsyncDispatcher> -WinCompositorWidgetProxy::GetCompositorVsyncDispatcher() +WinCompositorWidget::GetCompositorVsyncDispatcher() { RefPtr<CompositorVsyncDispatcher> cvd = mWindow->GetCompositorVsyncDispatcher(); return cvd.forget(); } uintptr_t -WinCompositorWidgetProxy::GetWidgetKey() +WinCompositorWidget::GetWidgetKey() { return mWidgetKey; } void -WinCompositorWidgetProxy::EnterPresentLock() +WinCompositorWidget::EnterPresentLock() { mPresentLock.Enter(); } void -WinCompositorWidgetProxy::LeavePresentLock() +WinCompositorWidget::LeavePresentLock() { mPresentLock.Leave(); } RefPtr<gfxASurface> -WinCompositorWidgetProxy::EnsureTransparentSurface() +WinCompositorWidget::EnsureTransparentSurface() { MOZ_ASSERT(mTransparencyMode == eTransparencyTransparent); if (!mTransparentSurface) { LayoutDeviceIntSize size = GetClientSize(); CreateTransparentSurface(size.width, size.height); } RefPtr<gfxASurface> surface = mTransparentSurface; return surface.forget(); } void -WinCompositorWidgetProxy::CreateTransparentSurface(int32_t aWidth, int32_t aHeight) +WinCompositorWidget::CreateTransparentSurface(int32_t aWidth, int32_t aHeight) { MOZ_ASSERT(!mTransparentSurface && !mMemoryDC); RefPtr<gfxWindowsSurface> surface = new gfxWindowsSurface(IntSize(aWidth, aHeight), SurfaceFormat::A8R8G8B8_UINT32); mTransparentSurface = surface; mMemoryDC = surface->GetDC(); } void -WinCompositorWidgetProxy::UpdateTransparency(nsTransparencyMode aMode) +WinCompositorWidget::UpdateTransparency(nsTransparencyMode aMode) { if (mTransparencyMode == aMode) { return; } mTransparencyMode = aMode; mTransparentSurface = nullptr; mMemoryDC = nullptr; if (mTransparencyMode == eTransparencyTransparent) { EnsureTransparentSurface(); } } void -WinCompositorWidgetProxy::ClearTransparentWindow() +WinCompositorWidget::ClearTransparentWindow() { if (!mTransparentSurface) { return; } IntSize size = mTransparentSurface->GetSize(); RefPtr<DrawTarget> drawTarget = gfxPlatform::GetPlatform()-> CreateDrawTargetForSurface(mTransparentSurface, size); drawTarget->ClearRect(Rect(0, 0, size.width, size.height)); RedrawTransparentWindow(); } void -WinCompositorWidgetProxy::ResizeTransparentWindow(int32_t aNewWidth, int32_t aNewHeight) +WinCompositorWidget::ResizeTransparentWindow(int32_t aNewWidth, int32_t aNewHeight) { MOZ_ASSERT(mTransparencyMode == eTransparencyTransparent); if (mTransparentSurface && mTransparentSurface->GetSize() == IntSize(aNewWidth, aNewHeight)) { return; } @@ -261,17 +261,17 @@ WinCompositorWidgetProxy::ResizeTranspar // Destroy the old surface. mTransparentSurface = nullptr; mMemoryDC = nullptr; CreateTransparentSurface(aNewWidth, aNewHeight); } bool -WinCompositorWidgetProxy::RedrawTransparentWindow() +WinCompositorWidget::RedrawTransparentWindow() { MOZ_ASSERT(mTransparencyMode == eTransparencyTransparent); LayoutDeviceIntSize size = GetClientSize(); ::GdiFlush(); BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA }; @@ -283,24 +283,24 @@ WinCompositorWidgetProxy::RedrawTranspar // perform the alpha blend return !!::UpdateLayeredWindow( hWnd, nullptr, (POINT*)&winRect, &winSize, mMemoryDC, &srcPos, 0, &bf, ULW_ALPHA); } HDC -WinCompositorWidgetProxy::GetWindowSurface() +WinCompositorWidget::GetWindowSurface() { return eTransparencyTransparent == mTransparencyMode ? mMemoryDC : ::GetDC(mWnd); } void -WinCompositorWidgetProxy::FreeWindowSurface(HDC dc) +WinCompositorWidget::FreeWindowSurface(HDC dc) { if (eTransparencyTransparent != mTransparencyMode) ::ReleaseDC(mWnd, dc); } } // namespace widget } // namespace mozilla
rename from widget/windows/WinCompositorWidgetProxy.h rename to widget/windows/WinCompositorWidget.h --- a/widget/windows/WinCompositorWidgetProxy.h +++ b/widget/windows/WinCompositorWidget.h @@ -1,49 +1,49 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef _widget_windows_WinCompositorWidget_h__ #define _widget_windows_WinCompositorWidget_h__ -#include "CompositorWidgetProxy.h" +#include "CompositorWidget.h" #include "mozilla/gfx/CriticalSection.h" class nsWindow; namespace mozilla { namespace widget { -// This is the Windows-specific implementation of CompositorWidgetProxy. For +// This is the Windows-specific implementation of CompositorWidget. For // the most part it only requires an HWND, however it maintains extra state // for transparent windows, as well as for synchronizing WM_SETTEXT messages // with the compositor. -class WinCompositorWidgetProxy : public CompositorWidgetProxy +class WinCompositorWidget: public CompositorWidget { public: - WinCompositorWidgetProxy(HWND aWnd, - uintptr_t aWidgetKey, - nsTransparencyMode aMode, - nsWindow* aWindow = nullptr); + WinCompositorWidget(HWND aWnd, + uintptr_t aWidgetKey, + nsTransparencyMode aMode, + nsWindow* aWindow = nullptr); bool PreRender(layers::LayerManagerComposite*) override; void PostRender(layers::LayerManagerComposite*) override; already_AddRefed<gfx::DrawTarget> StartRemoteDrawing() override; void EndRemoteDrawing() override; LayoutDeviceIntSize GetClientSize() override; already_AddRefed<gfx::DrawTarget> GetBackBufferDrawTarget(gfx::DrawTarget* aScreenTarget, const LayoutDeviceIntRect& aRect, const LayoutDeviceIntRect& aClearRect) override; already_AddRefed<gfx::SourceSurface> EndBackBufferDrawing() override; already_AddRefed<CompositorVsyncDispatcher> GetCompositorVsyncDispatcher() override; uintptr_t GetWidgetKey() override; nsIWidget* RealWidget() override; - WinCompositorWidgetProxy* AsWindowsProxy() override { + WinCompositorWidget* AsWindows() override { return this; } // Callbacks for nsWindow. void EnterPresentLock(); void LeavePresentLock(); void OnDestroyWindow();
--- a/widget/windows/moz.build +++ b/widget/windows/moz.build @@ -9,17 +9,17 @@ TEST_DIRS += ['tests'] EXPORTS += [ 'nsdefs.h', 'WindowHook.h', 'WinUtils.h', ] EXPORTS.mozilla.widget += [ 'AudioSession.h', - 'WinCompositorWidgetProxy.h', + 'WinCompositorWidget.h', 'WinMessages.h', 'WinModifierKeyState.h', 'WinNativeEventData.h', ] UNIFIED_SOURCES += [ 'AudioSession.cpp', 'GfxInfo.cpp', @@ -50,17 +50,17 @@ UNIFIED_SOURCES += [ 'nsWindowDbg.cpp', 'nsWindowGfx.cpp', 'nsWinGesture.cpp', 'TaskbarPreview.cpp', 'TaskbarPreviewButton.cpp', 'TaskbarTabPreview.cpp', 'TaskbarWindowPreview.cpp', 'WidgetTraceEvent.cpp', - 'WinCompositorWidgetProxy.cpp', + 'WinCompositorWidget.cpp', 'WindowHook.cpp', 'WinIMEHandler.cpp', 'WinTaskbar.cpp', 'WinTextEventDispatcherListener.cpp', 'WinUtils.cpp', ] # The following files cannot be built in unified mode because of name clashes.
--- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -135,17 +135,17 @@ #include "mozilla/WindowsVersion.h" #include "mozilla/TextEvents.h" // For WidgetKeyboardEvent #include "mozilla/TextEventDispatcherListener.h" #include "mozilla/widget/WinNativeEventData.h" #include "nsThemeConstants.h" #include "nsBidiKeyboard.h" #include "nsThemeConstants.h" #include "gfxConfig.h" -#include "WinCompositorWidgetProxy.h" +#include "WinCompositorWidget.h" #include "nsIGfxInfo.h" #include "nsUXThemeConstants.h" #include "KeyboardLayout.h" #include "nsNativeDragTarget.h" #include <mmsystem.h> // needed for WIN32_LEAN_AND_MEAN #include <zmouse.h> #include <richedit.h> @@ -1286,17 +1286,17 @@ NS_METHOD nsWindow::Show(bool bState) if (!wasVisible && (mWindowType == eWindowType_toplevel || mWindowType == eWindowType_dialog)) { // when a toplevel window or dialog is shown, initialize the UI state ::SendMessageW(mWnd, WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, UISF_HIDEFOCUS | UISF_HIDEACCEL), 0); } } else { // Clear contents to avoid ghosting of old content if we display // this window again. if (wasVisible && mTransparencyMode == eTransparencyTransparent) { - if (RefPtr<WinCompositorWidgetProxy> proxy = GetCompositorWidgetProxy()) { + if (RefPtr<WinCompositorWidget> proxy = GetCompositorWidget()) { proxy->ClearTransparentWindow(); } } if (mWindowType != eWindowType_dialog) { ::ShowWindow(mWnd, SW_HIDE); } else { ::SetWindowPos(mWnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); @@ -1545,17 +1545,17 @@ NS_METHOD nsWindow::Resize(double aWidth if (mBounds.width == width && mBounds.height == height) { if (aRepaint) { Invalidate(); } return NS_OK; } if (mTransparencyMode == eTransparencyTransparent) { - if (RefPtr<WinCompositorWidgetProxy> proxy = GetCompositorWidgetProxy()) { + if (RefPtr<WinCompositorWidget> proxy = GetCompositorWidget()) { proxy->ResizeTransparentWindow(width, height); } } // Set cached value for lightweight and printing mBounds.width = width; mBounds.height = height; @@ -1604,17 +1604,17 @@ NS_METHOD nsWindow::Resize(double aX, do mBounds.width == width && mBounds.height == height) { if (aRepaint) { Invalidate(); } return NS_OK; } if (eTransparencyTransparent == mTransparencyMode) { - if (RefPtr<WinCompositorWidgetProxy> proxy = GetCompositorWidgetProxy()) { + if (RefPtr<WinCompositorWidget> proxy = GetCompositorWidget()) { proxy->ResizeTransparentWindow(width, height); } } // Set cached value for lightweight and printing mBounds.x = x; mBounds.y = y; mBounds.width = width; @@ -3615,18 +3615,18 @@ nsWindow::GetLayerManager(PLayerTransact CreateCompositor(); } if (!mLayerManager) { MOZ_ASSERT(!mCompositorSession && !mCompositorBridgeChild); // Ensure we have a widget proxy even if we're not using the compositor, // since that's where we handle transparent windows. - if (!mCompositorWidgetProxy) { - mCompositorWidgetProxy = NewCompositorWidgetProxy(); + if (!mCompositorWidget) { + mCompositorWidget= NewCompositorWidget(); } mLayerManager = CreateBasicLayerManager(); } NS_ASSERTION(mLayerManager, "Couldn't provide a valid layer manager."); return mLayerManager; @@ -3679,30 +3679,30 @@ nsWindow::OnDefaultButtonLoaded(const La if (!::SetCursorPos(centerOfButton.x, centerOfButton.y)) { NS_ERROR("SetCursorPos failed"); return NS_ERROR_FAILURE; } return NS_OK; } -mozilla::widget::CompositorWidgetProxy* -nsWindow::NewCompositorWidgetProxy() -{ - return new WinCompositorWidgetProxy( +mozilla::widget::CompositorWidget* +nsWindow::NewCompositorWidget() +{ + return new WinCompositorWidget( mWnd, reinterpret_cast<uintptr_t>(this), mTransparencyMode, this); } -mozilla::widget::WinCompositorWidgetProxy* -nsWindow::GetCompositorWidgetProxy() -{ - return mCompositorWidgetProxy ? mCompositorWidgetProxy->AsWindowsProxy() : nullptr; +mozilla::widget::WinCompositorWidget* +nsWindow::GetCompositorWidget() +{ + return mCompositorWidget? mCompositorWidget->AsWindows() : nullptr; } void nsWindow::UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries) { RefPtr<LayerManager> layerManager = GetLayerManager(); if (!layerManager) { return; @@ -4897,17 +4897,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA { // From msdn, the way around this is to disable the visible state // temporarily. We need the text to be set but we don't want the // redraw to occur. However, we need to make sure that we don't // do this at the same time that a Present is happening. // // To do this we take mPresentLock in nsWindow::PreRender and // if that lock is taken we wait before doing WM_SETTEXT - RefPtr<WinCompositorWidgetProxy> proxy = GetCompositorWidgetProxy(); + RefPtr<WinCompositorWidget> proxy = GetCompositorWidget(); if (proxy) { proxy->EnterPresentLock(); } DWORD style = GetWindowLong(mWnd, GWL_STYLE); SetWindowLong(mWnd, GWL_STYLE, style & ~WS_VISIBLE); *aRetValue = CallWindowProcW(GetPrevWindowProc(), mWnd, msg, wParam, lParam); SetWindowLong(mWnd, GWL_STYLE, style); @@ -6208,17 +6208,17 @@ void nsWindow::OnWindowPosChanged(WINDOW ::GetWindowRect(mWnd, &r); newWidth = r.right - r.left; newHeight = r.bottom - r.top; nsIntRect rect(wp->x, wp->y, newWidth, newHeight); if (eTransparencyTransparent == mTransparencyMode) { - if (RefPtr<WinCompositorWidgetProxy> proxy = GetCompositorWidgetProxy()) { + if (RefPtr<WinCompositorWidget> proxy = GetCompositorWidget()) { proxy->ResizeTransparentWindow(newWidth, newHeight); } } if (newWidth > mLastSize.width) { RECT drect; @@ -6729,17 +6729,17 @@ void nsWindow::OnDestroy() VERIFY(::DeleteObject(mBrush)); mBrush = nullptr; } // Destroy any custom cursor resources. if (mCursor == -1) SetCursor(eCursor_standard); - if (RefPtr<WinCompositorWidgetProxy> proxy = GetCompositorWidgetProxy()) { + if (RefPtr<WinCompositorWidget> proxy = GetCompositorWidget()) { proxy->OnDestroyWindow(); } // Finalize panning feedback to possibly restore window displacement mGesture.PanFeedbackFinalize(mWnd, true); // Clear the main HWND. mWnd = nullptr; @@ -7046,17 +7046,17 @@ void nsWindow::SetWindowTranslucencyInne VERIFY_WINDOW_STYLE(style); ::SetWindowLongPtrW(hWnd, GWL_STYLE, style); ::SetWindowLongPtrW(hWnd, GWL_EXSTYLE, exStyle); if (HasGlass()) memset(&mGlassMargins, 0, sizeof mGlassMargins); mTransparencyMode = aMode; - if (RefPtr<WinCompositorWidgetProxy> proxy = GetCompositorWidgetProxy()) { + if (RefPtr<WinCompositorWidget> proxy = GetCompositorWidget()) { proxy->UpdateTransparency(aMode); } UpdateGlass(); } #endif //MOZ_XUL /**************************************************************
--- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -53,17 +53,17 @@ class nsNativeDragTarget; class nsIRollupListener; class imgIContainer; namespace mozilla { namespace widget { class NativeKey; struct MSGResult; -class WinCompositorWidgetProxy; +class WinCompositorWidget; } // namespace widget } // namespacw mozilla; /** * Native WIN32 window wrapper. */ class nsWindow : public nsWindowBase @@ -307,17 +307,17 @@ public: const mozilla::widget::CandidateWindowPosition& aPosition) override; virtual void DefaultProcOfPluginEvent( const mozilla::WidgetPluginEvent& aEvent) override; virtual nsresult OnWindowedPluginKeyEvent( const mozilla::NativeEventData& aKeyEventData, nsIKeyEventInPluginCallback* aCallback) override; - mozilla::widget::CompositorWidgetProxy* NewCompositorWidgetProxy() override; + mozilla::widget::CompositorWidget* NewCompositorWidget() override; protected: virtual ~nsWindow(); virtual void WindowUsesOMTC() override; virtual void RegisterTouchWindow() override; // A magic number to identify the FAKETRACKPOINTSCROLLABLE window created @@ -482,17 +482,17 @@ protected: virtual nsresult SetWindowClipRegion(const nsTArray<LayoutDeviceIntRect>& aRects, bool aIntersectWithExisting) override; nsIntRegion GetRegionToPaint(bool aForceFullRepaint, PAINTSTRUCT ps, HDC aDC); static void ActivateOtherWindowHelper(HWND aWnd); void ClearCachedResources(); nsIWidgetListener* GetPaintListener(); - mozilla::widget::WinCompositorWidgetProxy* GetCompositorWidgetProxy(); + mozilla::widget::WinCompositorWidget* GetCompositorWidget(); protected: nsCOMPtr<nsIWidget> mParent; nsIntSize mLastSize; nsIntPoint mLastPoint; HWND mWnd; HWND mTransitionWnd; WNDPROC mPrevWndProc;
--- a/widget/windows/nsWindowGfx.cpp +++ b/widget/windows/nsWindowGfx.cpp @@ -234,17 +234,17 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t // we force generation of WM_PAINT messages by invalidating window areas with // RedrawWindow, InvalidateRect or InvalidateRgn function calls. // BeginPaint/EndPaint must be called to make Windows think that invalid area // is painted. Otherwise it will continue sending the same message endlessly. ::BeginPaint(mWnd, &ps); ::EndPaint(mWnd, &ps); // We're guaranteed to have a widget proxy since we called GetLayerManager(). - aDC = GetCompositorWidgetProxy()->GetTransparentDC(); + aDC = GetCompositorWidget()->GetTransparentDC(); } #endif mPainting = true; #ifdef WIDGET_DEBUG_OUTPUT HRGN debugPaintFlashRegion = nullptr; HDC debugPaintFlashDC = nullptr; @@ -308,17 +308,17 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t switch (GetLayerManager()->GetBackendType()) { case LayersBackend::LAYERS_BASIC: { RefPtr<gfxASurface> targetSurface; #if defined(MOZ_XUL) // don't support transparency for non-GDI rendering, for now if (eTransparencyTransparent == mTransparencyMode) { - targetSurface = GetCompositorWidgetProxy()->EnsureTransparentSurface(); + targetSurface = GetCompositorWidget()->EnsureTransparentSurface(); } #endif RefPtr<gfxWindowsSurface> targetSurfaceWin; if (!targetSurface) { uint32_t flags = (mTransparencyMode == eTransparencyOpaque) ? 0 : gfxWindowsSurface::FLAG_IS_TRANSPARENT; @@ -373,17 +373,17 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t this, LayoutDeviceIntRegion::FromUnknownRegion(region)); } #ifdef MOZ_XUL if (eTransparencyTransparent == mTransparencyMode) { // Data from offscreen drawing surface was copied to memory bitmap of transparent // bitmap. Now it can be read from memory bitmap to apply alpha channel and after // that displayed on the screen. - GetCompositorWidgetProxy()->RedrawTransparentWindow(); + GetCompositorWidget()->RedrawTransparentWindow(); } #endif } break; case LayersBackend::LAYERS_CLIENT: { result = listener->PaintWindow( this, LayoutDeviceIntRegion::FromUnknownRegion(region));