2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2018-11-07 00:35:37 +03:00
|
|
|
#ifndef mozilla_layout_RenderFrame_h
|
|
|
|
#define mozilla_layout_RenderFrame_h
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2018-11-05 21:45:06 +03:00
|
|
|
#include "base/process.h"
|
|
|
|
|
2012-09-14 20:10:08 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2018-09-25 05:45:54 +03:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
2017-04-10 00:30:27 +03:00
|
|
|
#include "mozilla/layers/CompositorOptions.h"
|
2015-02-17 05:30:02 +03:00
|
|
|
#include "mozilla/layers/LayersTypes.h"
|
2010-08-21 03:24:41 +04:00
|
|
|
#include "nsDisplayList.h"
|
|
|
|
|
|
|
|
class nsFrameLoader;
|
2011-01-13 20:45:14 +03:00
|
|
|
class nsSubDocumentFrame;
|
2010-08-21 03:24:41 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2011-01-13 20:45:14 +03:00
|
|
|
|
2010-08-21 03:24:41 +04:00
|
|
|
namespace layers {
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
struct TextureFactoryIdentifier;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
2010-08-21 03:24:41 +04:00
|
|
|
|
|
|
|
namespace layout {
|
|
|
|
|
2018-11-07 00:35:37 +03:00
|
|
|
class RenderFrame final {
|
2017-04-10 00:30:27 +03:00
|
|
|
typedef mozilla::layers::CompositorOptions CompositorOptions;
|
2010-08-21 03:24:41 +04:00
|
|
|
typedef mozilla::layers::LayerManager LayerManager;
|
2018-03-25 02:06:01 +03:00
|
|
|
typedef mozilla::layers::LayersId LayersId;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
typedef mozilla::layers::TextureFactoryIdentifier TextureFactoryIdentifier;
|
2011-01-13 20:45:14 +03:00
|
|
|
|
2018-11-30 13:46:48 +03:00
|
|
|
public:
|
2018-11-07 00:35:37 +03:00
|
|
|
RenderFrame();
|
|
|
|
virtual ~RenderFrame();
|
2013-11-20 16:32:52 +04:00
|
|
|
|
2018-10-25 23:23:46 +03:00
|
|
|
bool Initialize(nsFrameLoader* aFrameLoader);
|
2011-01-06 07:54:47 +03:00
|
|
|
void Destroy();
|
|
|
|
|
2018-10-25 23:23:46 +03:00
|
|
|
void EnsureLayersConnected(CompositorOptions* aCompositorOptions);
|
|
|
|
LayerManager* AttachLayerManager();
|
2011-01-13 20:45:14 +03:00
|
|
|
void OwnerContentChanged(nsIContent* aContent);
|
|
|
|
|
2018-10-25 23:23:46 +03:00
|
|
|
nsFrameLoader* GetFrameLoader() const { return mFrameLoader; }
|
|
|
|
LayersId GetLayersId() const { return mLayersId; }
|
|
|
|
CompositorOptions GetCompositorOptions() const { return mCompositorOptions; }
|
2013-08-13 11:56:57 +04:00
|
|
|
|
2018-10-25 23:23:46 +03:00
|
|
|
void GetTextureFactoryIdentifier(
|
|
|
|
TextureFactoryIdentifier* aTextureFactoryIdentifier) const;
|
2017-04-18 07:41:18 +03:00
|
|
|
|
2018-10-25 23:23:46 +03:00
|
|
|
bool IsInitialized() const { return mInitialized; }
|
|
|
|
bool IsLayersConnected() const { return mLayersConnected; }
|
2018-09-25 05:45:54 +03:00
|
|
|
|
2010-08-21 03:24:41 +04:00
|
|
|
private:
|
2018-11-05 21:45:06 +03:00
|
|
|
base::ProcessId mTabProcessId;
|
2012-07-18 03:59:45 +04:00
|
|
|
// When our child frame is pushing transactions directly to the
|
|
|
|
// compositor, this is the ID of its layer tree in the compositor's
|
|
|
|
// context.
|
2018-03-25 02:06:01 +03:00
|
|
|
LayersId mLayersId;
|
2017-04-10 00:30:27 +03:00
|
|
|
// The compositor options for this layers id. This is only meaningful if
|
|
|
|
// the compositor actually knows about this layers id (i.e. when
|
|
|
|
// mLayersConnected is true).
|
|
|
|
CompositorOptions mCompositorOptions;
|
2012-07-18 03:59:45 +04:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsFrameLoader> mFrameLoader;
|
2017-04-18 07:41:18 +03:00
|
|
|
RefPtr<LayerManager> mLayerManager;
|
2013-07-30 22:03:40 +04:00
|
|
|
|
2018-10-25 23:23:46 +03:00
|
|
|
bool mInitialized;
|
|
|
|
// A flag that indicates whether or not the compositor knows about the
|
2018-11-07 00:35:37 +03:00
|
|
|
// layers id. In some cases this RenderFrame is not connected to the
|
2018-10-25 23:23:46 +03:00
|
|
|
// compositor and so this flag is false.
|
|
|
|
bool mLayersConnected;
|
2010-08-21 03:24:41 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layout
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A DisplayRemote exists solely to graft a child process's shadow
|
2018-11-07 00:35:37 +03:00
|
|
|
* layer tree (for a given RenderFrame) into its parent
|
2010-08-21 03:24:41 +04:00
|
|
|
* process's layer tree.
|
|
|
|
*/
|
2018-09-06 04:23:14 +03:00
|
|
|
class nsDisplayRemote final : public nsDisplayItem {
|
2018-10-25 23:23:46 +03:00
|
|
|
typedef mozilla::dom::TabId TabId;
|
|
|
|
typedef mozilla::gfx::Matrix4x4 Matrix4x4;
|
|
|
|
typedef mozilla::layers::EventRegionsOverride EventRegionsOverride;
|
|
|
|
typedef mozilla::layers::Layer Layer;
|
|
|
|
typedef mozilla::layers::LayersId LayersId;
|
|
|
|
typedef mozilla::layers::RefLayer RefLayer;
|
2018-11-07 00:35:37 +03:00
|
|
|
typedef mozilla::layout::RenderFrame RenderFrame;
|
2018-10-25 23:23:46 +03:00
|
|
|
typedef mozilla::LayoutDeviceRect LayoutDeviceRect;
|
|
|
|
typedef mozilla::LayoutDeviceIntPoint LayoutDeviceIntPoint;
|
2010-08-21 03:24:41 +04:00
|
|
|
|
|
|
|
public:
|
2018-08-31 22:08:01 +03:00
|
|
|
nsDisplayRemote(nsDisplayListBuilder* aBuilder, nsSubDocumentFrame* aFrame);
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2018-08-31 22:08:01 +03:00
|
|
|
bool HasDeletedFrame() const override;
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2018-08-31 22:08:01 +03:00
|
|
|
LayerState GetLayerState(
|
|
|
|
nsDisplayListBuilder* aBuilder, LayerManager* aManager,
|
2018-09-25 05:45:54 +03:00
|
|
|
const ContainerLayerParameters& aParameters) override;
|
2018-08-31 22:08:01 +03:00
|
|
|
|
|
|
|
already_AddRefed<Layer> BuildLayer(
|
2011-06-22 16:11:27 +04:00
|
|
|
nsDisplayListBuilder* aBuilder, LayerManager* aManager,
|
2015-03-21 19:28:04 +03:00
|
|
|
const ContainerLayerParameters& aContainerParameters) override;
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2018-09-25 05:45:54 +03:00
|
|
|
void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
|
|
|
|
|
2018-08-31 22:08:01 +03:00
|
|
|
bool CreateWebRenderCommands(
|
|
|
|
mozilla::wr::DisplayListBuilder& aBuilder,
|
|
|
|
mozilla::wr::IpcResourceUpdateQueue& aResources,
|
|
|
|
const StackingContextHelper& aSc,
|
|
|
|
mozilla::layers::WebRenderLayerManager* aManager,
|
|
|
|
nsDisplayListBuilder* aDisplayListBuilder) override;
|
|
|
|
bool UpdateScrollData(
|
|
|
|
mozilla::layers::WebRenderScrollData* aData,
|
|
|
|
mozilla::layers::WebRenderLayerScrollData* aLayerData) override;
|
2017-07-25 15:18:49 +03:00
|
|
|
|
2010-08-21 03:24:41 +04:00
|
|
|
NS_DISPLAY_DECL_NAME("Remote", TYPE_REMOTE)
|
|
|
|
|
|
|
|
private:
|
2018-10-25 23:23:46 +03:00
|
|
|
LayersId GetRemoteLayersId() const;
|
2018-11-07 00:35:37 +03:00
|
|
|
RenderFrame* GetRenderFrame() const;
|
2018-08-31 22:08:01 +03:00
|
|
|
|
2018-10-25 23:23:46 +03:00
|
|
|
TabId mTabId;
|
|
|
|
LayoutDeviceIntPoint mOffset;
|
|
|
|
EventRegionsOverride mEventRegionsOverride;
|
2010-08-21 03:24:41 +04:00
|
|
|
};
|
|
|
|
|
2018-11-07 00:35:37 +03:00
|
|
|
#endif // mozilla_layout_RenderFrame_h
|