forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move InProcessCompositorWidget to its own file. (bug 1281998 part 3, …
…r=jimm) --HG-- rename : widget/CompositorWidget.cpp => widget/InProcessCompositorWidget.cpp
- Loading branch information
David Anderson
committed
Jul 1, 2016
1 parent
3f0ea05
commit 56c221c
Showing
8 changed files
with
183 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* 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 "InProcessCompositorWidget.h" | ||
|
||
namespace mozilla { | ||
namespace widget { | ||
|
||
InProcessCompositorWidget::InProcessCompositorWidget(nsBaseWidget* aWidget) | ||
: mWidget(aWidget) | ||
{ | ||
} | ||
|
||
bool | ||
InProcessCompositorWidget::PreRender(layers::LayerManagerComposite* aManager) | ||
{ | ||
return mWidget->PreRender(aManager); | ||
} | ||
|
||
void | ||
InProcessCompositorWidget::PostRender(layers::LayerManagerComposite* aManager) | ||
{ | ||
mWidget->PostRender(aManager); | ||
} | ||
|
||
void | ||
InProcessCompositorWidget::DrawWindowUnderlay(layers::LayerManagerComposite* aManager, | ||
LayoutDeviceIntRect aRect) | ||
{ | ||
mWidget->DrawWindowUnderlay(aManager, aRect); | ||
} | ||
|
||
void | ||
InProcessCompositorWidget::DrawWindowOverlay(layers::LayerManagerComposite* aManager, | ||
LayoutDeviceIntRect aRect) | ||
{ | ||
mWidget->DrawWindowOverlay(aManager, aRect); | ||
} | ||
|
||
already_AddRefed<gfx::DrawTarget> | ||
InProcessCompositorWidget::StartRemoteDrawing() | ||
{ | ||
return mWidget->StartRemoteDrawing(); | ||
} | ||
|
||
already_AddRefed<gfx::DrawTarget> | ||
InProcessCompositorWidget::StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion, | ||
layers::BufferMode* aBufferMode) | ||
{ | ||
return mWidget->StartRemoteDrawingInRegion(aInvalidRegion, aBufferMode); | ||
} | ||
|
||
void | ||
InProcessCompositorWidget::EndRemoteDrawing() | ||
{ | ||
mWidget->EndRemoteDrawing(); | ||
} | ||
|
||
void | ||
InProcessCompositorWidget::EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget, | ||
LayoutDeviceIntRegion& aInvalidRegion) | ||
{ | ||
mWidget->EndRemoteDrawingInRegion(aDrawTarget, aInvalidRegion); | ||
} | ||
|
||
void | ||
InProcessCompositorWidget::CleanupRemoteDrawing() | ||
{ | ||
mWidget->CleanupRemoteDrawing(); | ||
} | ||
|
||
void | ||
InProcessCompositorWidget::CleanupWindowEffects() | ||
{ | ||
mWidget->CleanupWindowEffects(); | ||
} | ||
|
||
bool | ||
InProcessCompositorWidget::InitCompositor(layers::Compositor* aCompositor) | ||
{ | ||
return mWidget->InitCompositor(aCompositor); | ||
} | ||
|
||
LayoutDeviceIntSize | ||
InProcessCompositorWidget::GetClientSize() | ||
{ | ||
return mWidget->GetClientSize(); | ||
} | ||
|
||
uint32_t | ||
InProcessCompositorWidget::GetGLFrameBufferFormat() | ||
{ | ||
return mWidget->GetGLFrameBufferFormat(); | ||
} | ||
|
||
layers::Composer2D* | ||
InProcessCompositorWidget::GetComposer2D() | ||
{ | ||
return mWidget->GetComposer2D(); | ||
} | ||
|
||
uintptr_t | ||
InProcessCompositorWidget::GetWidgetKey() | ||
{ | ||
return reinterpret_cast<uintptr_t>(mWidget); | ||
} | ||
|
||
nsIWidget* | ||
InProcessCompositorWidget::RealWidget() | ||
{ | ||
return mWidget; | ||
} | ||
|
||
already_AddRefed<CompositorVsyncDispatcher> | ||
InProcessCompositorWidget::GetCompositorVsyncDispatcher() | ||
{ | ||
RefPtr<CompositorVsyncDispatcher> cvd = mWidget->GetCompositorVsyncDispatcher(); | ||
return cvd.forget(); | ||
} | ||
|
||
} // namespace widget | ||
} // namespace mozilla | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* 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_InProcessCompositorWidget_h__ | ||
#define mozilla_widget_InProcessCompositorWidget_h__ | ||
|
||
#include "CompositorWidget.h" | ||
|
||
namespace mozilla { | ||
namespace widget { | ||
|
||
// This version of CompositorWidget implements a wrapper around | ||
// nsBaseWidget. | ||
class InProcessCompositorWidget : public CompositorWidget | ||
{ | ||
public: | ||
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; | ||
virtual already_AddRefed<gfx::DrawTarget> | ||
StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion, | ||
layers::BufferMode* aBufferMode) override; | ||
virtual void EndRemoteDrawing() override; | ||
virtual void EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget, | ||
LayoutDeviceIntRegion& aInvalidRegion) override; | ||
virtual void CleanupRemoteDrawing() override; | ||
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 CompositorWidget instead. | ||
nsIWidget* RealWidget() override; | ||
|
||
private: | ||
nsBaseWidget* mWidget; | ||
}; | ||
|
||
} // namespace widget | ||
} // namespace mozilla | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters