зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1574592 - Add CompositorWidget::GetNativeLayerRoot. r=mattwoodrow
This will give the layer manager direct access to the native layers. Differential Revision: https://phabricator.services.mozilla.com/D42400 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
88d33edc42
Коммит
222be5a822
|
@ -11,6 +11,7 @@
|
|||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/layers/CompositorOptions.h"
|
||||
#include "mozilla/layers/LayersTypes.h"
|
||||
#include "mozilla/layers/NativeLayer.h"
|
||||
|
||||
class nsIWidget;
|
||||
class nsBaseWidget;
|
||||
|
@ -123,6 +124,10 @@ class CompositorWidget {
|
|||
*/
|
||||
virtual void DoCompositorCleanup() {}
|
||||
|
||||
virtual RefPtr<layers::NativeLayerRoot> GetNativeLayerRoot() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called before the LayerManager draws the layer tree.
|
||||
*
|
||||
|
|
|
@ -48,6 +48,11 @@ void InProcessCompositorWidget::DoCompositorCleanup() {
|
|||
mWidget->DoCompositorCleanup();
|
||||
}
|
||||
|
||||
RefPtr<layers::NativeLayerRoot>
|
||||
InProcessCompositorWidget::GetNativeLayerRoot() {
|
||||
return mWidget->GetNativeLayerRoot();
|
||||
}
|
||||
|
||||
void InProcessCompositorWidget::DrawWindowUnderlay(
|
||||
WidgetRenderingContext* aContext, LayoutDeviceIntRect aRect) {
|
||||
mWidget->DrawWindowUnderlay(aContext, aRect);
|
||||
|
|
|
@ -20,6 +20,7 @@ class InProcessCompositorWidget : public CompositorWidget {
|
|||
virtual bool PreRender(WidgetRenderingContext* aManager) override;
|
||||
virtual void PostRender(WidgetRenderingContext* aManager) override;
|
||||
virtual void DoCompositorCleanup() override;
|
||||
virtual RefPtr<layers::NativeLayerRoot> GetNativeLayerRoot() override;
|
||||
virtual void DrawWindowUnderlay(WidgetRenderingContext* aContext,
|
||||
LayoutDeviceIntRect aRect) override;
|
||||
virtual void DrawWindowOverlay(WidgetRenderingContext* aContext,
|
||||
|
|
|
@ -498,6 +498,7 @@ class nsChildView final : public nsBaseWidget {
|
|||
bool PreRenderImpl(mozilla::widget::WidgetRenderingContext* aContext);
|
||||
virtual void PostRender(mozilla::widget::WidgetRenderingContext* aContext) override;
|
||||
virtual void DoCompositorCleanup() override;
|
||||
virtual RefPtr<mozilla::layers::NativeLayerRoot> GetNativeLayerRoot() override;
|
||||
virtual void DrawWindowOverlay(mozilla::widget::WidgetRenderingContext* aManager,
|
||||
LayoutDeviceIntRect aRect) override;
|
||||
|
||||
|
|
|
@ -2086,6 +2086,8 @@ void nsChildView::DoCompositorCleanup() {
|
|||
}
|
||||
}
|
||||
|
||||
RefPtr<layers::NativeLayerRoot> nsChildView::GetNativeLayerRoot() { return mNativeLayerRoot; }
|
||||
|
||||
void nsChildView::DrawWindowOverlay(WidgetRenderingContext* aContext, LayoutDeviceIntRect aRect) {
|
||||
mozilla::UniquePtr<GLManager> manager(GLManager::CreateGLManager(aContext->mLayerManager));
|
||||
if (manager) {
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "mozilla/WidgetUtils.h"
|
||||
#include "mozilla/layers/APZCCallbackHelper.h"
|
||||
#include "mozilla/layers/CompositorOptions.h"
|
||||
#include "mozilla/layers/NativeLayer.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsWidgetsCID.h"
|
||||
|
@ -449,6 +450,9 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
|
|||
}
|
||||
virtual void PostRender(mozilla::widget::WidgetRenderingContext* aContext) {}
|
||||
virtual void DoCompositorCleanup() {}
|
||||
virtual RefPtr<mozilla::layers::NativeLayerRoot> GetNativeLayerRoot() {
|
||||
return nullptr;
|
||||
}
|
||||
virtual void DrawWindowUnderlay(
|
||||
mozilla::widget::WidgetRenderingContext* aContext,
|
||||
LayoutDeviceIntRect aRect) {}
|
||||
|
|
Загрузка…
Ссылка в новой задаче