зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1331515 - More WR to Wr prefix conversion. r=gfx?
This commit is contained in:
Родитель
a2579a7676
Коммит
d8d26d90cf
|
@ -462,17 +462,17 @@ CompositorBridgeParent::StopAndClearResources()
|
||||||
mCompositionManager = nullptr;
|
mCompositionManager = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mWRBridge) {
|
if (mWrBridge) {
|
||||||
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
||||||
ForEachIndirectLayerTree([this] (LayerTreeState* lts, uint64_t) -> void {
|
ForEachIndirectLayerTree([this] (LayerTreeState* lts, uint64_t) -> void {
|
||||||
if (lts->mWRBridge) {
|
if (lts->mWrBridge) {
|
||||||
lts->mWRBridge->Destroy();
|
lts->mWrBridge->Destroy();
|
||||||
lts->mWRBridge = nullptr;
|
lts->mWrBridge = nullptr;
|
||||||
}
|
}
|
||||||
lts->mParent = nullptr;
|
lts->mParent = nullptr;
|
||||||
});
|
});
|
||||||
mWRBridge->Destroy();
|
mWrBridge->Destroy();
|
||||||
mWRBridge = nullptr;
|
mWrBridge = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCompositor) {
|
if (mCompositor) {
|
||||||
|
@ -1572,7 +1572,7 @@ CompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t& aPipelineId,
|
||||||
MOZ_RELEASE_ASSERT(false);
|
MOZ_RELEASE_ASSERT(false);
|
||||||
#endif
|
#endif
|
||||||
MOZ_ASSERT(aPipelineId == mRootLayerTreeID);
|
MOZ_ASSERT(aPipelineId == mRootLayerTreeID);
|
||||||
MOZ_ASSERT(!mWRBridge);
|
MOZ_ASSERT(!mWrBridge);
|
||||||
MOZ_ASSERT(!mCompositor);
|
MOZ_ASSERT(!mCompositor);
|
||||||
MOZ_ASSERT(!mCompositorScheduler);
|
MOZ_ASSERT(!mCompositorScheduler);
|
||||||
|
|
||||||
|
@ -1581,20 +1581,20 @@ CompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t& aPipelineId,
|
||||||
// MOZ_ASSERT(mWidget);
|
// MOZ_ASSERT(mWidget);
|
||||||
// RefPtr<widget::CompositorWidget> widget = mWidget;
|
// RefPtr<widget::CompositorWidget> widget = mWidget;
|
||||||
// RefPtr<WebRenderAPI> wr = WebRenderAPI::Create(gfxPrefs::WebRenderProfilerEnabled(), this, Move(widget));
|
// RefPtr<WebRenderAPI> wr = WebRenderAPI::Create(gfxPrefs::WebRenderProfilerEnabled(), this, Move(widget));
|
||||||
// mWRBridge = new WebRenderBridgeParent(this, aPipelineId, mWidget, Move(wr));
|
// mWrBridge = new WebRenderBridgeParent(this, aPipelineId, mWidget, Move(wr));
|
||||||
|
|
||||||
RefPtr<gl::GLContext> glc(gl::GLContextProvider::CreateForCompositorWidget(mWidget, true));
|
RefPtr<gl::GLContext> glc(gl::GLContextProvider::CreateForCompositorWidget(mWidget, true));
|
||||||
mCompositor = new WebRenderCompositorOGL(this, glc.get());
|
mCompositor = new WebRenderCompositorOGL(this, glc.get());
|
||||||
mWRBridge = new WebRenderBridgeParent(this, aPipelineId,
|
mWrBridge = new WebRenderBridgeParent(this, aPipelineId,
|
||||||
mWidget, glc.get(), nullptr, mCompositor.get());
|
mWidget, glc.get(), nullptr, mCompositor.get());
|
||||||
mCompositorScheduler = mWRBridge->CompositorScheduler();
|
mCompositorScheduler = mWrBridge->CompositorScheduler();
|
||||||
MOZ_ASSERT(mCompositorScheduler);
|
MOZ_ASSERT(mCompositorScheduler);
|
||||||
mWRBridge.get()->AddRef(); // IPDL reference
|
mWrBridge.get()->AddRef(); // IPDL reference
|
||||||
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
||||||
MOZ_ASSERT(sIndirectLayerTrees[aPipelineId].mWRBridge == nullptr);
|
MOZ_ASSERT(sIndirectLayerTrees[aPipelineId].mWrBridge == nullptr);
|
||||||
sIndirectLayerTrees[aPipelineId].mWRBridge = mWRBridge;
|
sIndirectLayerTrees[aPipelineId].mWrBridge = mWrBridge;
|
||||||
*aTextureFactoryIdentifier = mCompositor->GetTextureFactoryIdentifier();
|
*aTextureFactoryIdentifier = mCompositor->GetTextureFactoryIdentifier();
|
||||||
return mWRBridge;
|
return mWrBridge;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -1610,7 +1610,7 @@ CompositorBridgeParent::DeallocPWebRenderBridgeParent(PWebRenderBridgeParent* aA
|
||||||
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
||||||
auto it = sIndirectLayerTrees.find(parent->PipelineId());
|
auto it = sIndirectLayerTrees.find(parent->PipelineId());
|
||||||
if (it != sIndirectLayerTrees.end()) {
|
if (it != sIndirectLayerTrees.end()) {
|
||||||
it->second.mWRBridge = nullptr;
|
it->second.mWrBridge = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
parent->Release(); // IPDL reference
|
parent->Release(); // IPDL reference
|
||||||
|
@ -1623,8 +1623,8 @@ CompositorBridgeParent::SetWebRenderProfilerEnabled(bool aEnabled)
|
||||||
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
||||||
for (auto it = sIndirectLayerTrees.begin(); it != sIndirectLayerTrees.end(); it++) {
|
for (auto it = sIndirectLayerTrees.begin(); it != sIndirectLayerTrees.end(); it++) {
|
||||||
LayerTreeState* state = &it->second;
|
LayerTreeState* state = &it->second;
|
||||||
if (state->mWRBridge) {
|
if (state->mWrBridge) {
|
||||||
state->mWRBridge->SetWebRenderProfilerEnabled(aEnabled);
|
state->mWrBridge->SetWebRenderProfilerEnabled(aEnabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -354,7 +354,7 @@ public:
|
||||||
APZCTreeManagerParent* mApzcTreeManagerParent;
|
APZCTreeManagerParent* mApzcTreeManagerParent;
|
||||||
RefPtr<CompositorBridgeParent> mParent;
|
RefPtr<CompositorBridgeParent> mParent;
|
||||||
HostLayerManager* mLayerManager;
|
HostLayerManager* mLayerManager;
|
||||||
RefPtr<WebRenderBridgeParent> mWRBridge;
|
RefPtr<WebRenderBridgeParent> mWrBridge;
|
||||||
// Pointer to the CrossProcessCompositorBridgeParent. Used by APZCs to share
|
// Pointer to the CrossProcessCompositorBridgeParent. Used by APZCs to share
|
||||||
// their FrameMetrics with the corresponding child process that holds
|
// their FrameMetrics with the corresponding child process that holds
|
||||||
// the PCompositorBridgeChild
|
// the PCompositorBridgeChild
|
||||||
|
@ -553,7 +553,7 @@ protected:
|
||||||
RefPtr<HostLayerManager> mLayerManager;
|
RefPtr<HostLayerManager> mLayerManager;
|
||||||
RefPtr<Compositor> mCompositor;
|
RefPtr<Compositor> mCompositor;
|
||||||
RefPtr<AsyncCompositionManager> mCompositionManager;
|
RefPtr<AsyncCompositionManager> mCompositionManager;
|
||||||
RefPtr<WebRenderBridgeParent> mWRBridge;
|
RefPtr<WebRenderBridgeParent> mWrBridge;
|
||||||
widget::CompositorWidget* mWidget;
|
widget::CompositorWidget* mWidget;
|
||||||
TimeStamp mTestTime;
|
TimeStamp mTestTime;
|
||||||
CSSToLayoutDeviceScale mScale;
|
CSSToLayoutDeviceScale mScale;
|
||||||
|
|
|
@ -212,15 +212,15 @@ CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t&
|
||||||
|
|
||||||
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
MonitorAutoLock lock(*sIndirectLayerTreesLock);
|
||||||
MOZ_ASSERT(sIndirectLayerTrees.find(aPipelineId) != sIndirectLayerTrees.end());
|
MOZ_ASSERT(sIndirectLayerTrees.find(aPipelineId) != sIndirectLayerTrees.end());
|
||||||
MOZ_ASSERT(sIndirectLayerTrees[aPipelineId].mWRBridge == nullptr);
|
MOZ_ASSERT(sIndirectLayerTrees[aPipelineId].mWrBridge == nullptr);
|
||||||
CompositorBridgeParent* cbp = sIndirectLayerTrees[aPipelineId].mParent;
|
CompositorBridgeParent* cbp = sIndirectLayerTrees[aPipelineId].mParent;
|
||||||
WebRenderBridgeParent* root = sIndirectLayerTrees[cbp->RootLayerTreeId()].mWRBridge.get();
|
WebRenderBridgeParent* root = sIndirectLayerTrees[cbp->RootLayerTreeId()].mWrBridge.get();
|
||||||
|
|
||||||
WebRenderBridgeParent* parent = new WebRenderBridgeParent(
|
WebRenderBridgeParent* parent = new WebRenderBridgeParent(
|
||||||
this, aPipelineId, nullptr, root->GLContext(), root->WindowState(), root->Compositor());
|
this, aPipelineId, nullptr, root->GLContext(), root->WindowState(), root->Compositor());
|
||||||
parent->AddRef(); // IPDL reference
|
parent->AddRef(); // IPDL reference
|
||||||
sIndirectLayerTrees[aPipelineId].mCrossProcessParent = this;
|
sIndirectLayerTrees[aPipelineId].mCrossProcessParent = this;
|
||||||
sIndirectLayerTrees[aPipelineId].mWRBridge = parent;
|
sIndirectLayerTrees[aPipelineId].mWrBridge = parent;
|
||||||
*aTextureFactoryIdentifier = parent->Compositor()->GetTextureFactoryIdentifier();
|
*aTextureFactoryIdentifier = parent->Compositor()->GetTextureFactoryIdentifier();
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
@ -317,7 +317,7 @@ CrossProcessCompositorBridgeParent::DidComposite(
|
||||||
if (LayerTransactionParent *layerTree = sIndirectLayerTrees[aId].mLayerTree) {
|
if (LayerTransactionParent *layerTree = sIndirectLayerTrees[aId].mLayerTree) {
|
||||||
Unused << SendDidComposite(aId, layerTree->GetPendingTransactionId(), aCompositeStart, aCompositeEnd);
|
Unused << SendDidComposite(aId, layerTree->GetPendingTransactionId(), aCompositeStart, aCompositeEnd);
|
||||||
layerTree->SetPendingTransactionId(0);
|
layerTree->SetPendingTransactionId(0);
|
||||||
} else if (WebRenderBridgeParent* wrbridge = sIndirectLayerTrees[aId].mWRBridge) {
|
} else if (WebRenderBridgeParent* wrbridge = sIndirectLayerTrees[aId].mWrBridge) {
|
||||||
Unused << SendDidComposite(aId, wrbridge->GetPendingTransactionId(), aCompositeStart, aCompositeEnd);
|
Unused << SendDidComposite(aId, wrbridge->GetPendingTransactionId(), aCompositeStart, aCompositeEnd);
|
||||||
wrbridge->SetPendingTransactionId(0);
|
wrbridge->SetPendingTransactionId(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ using namespace mozilla::gfx;
|
||||||
void
|
void
|
||||||
WebRenderBorderLayer::RenderLayer()
|
WebRenderBorderLayer::RenderLayer()
|
||||||
{
|
{
|
||||||
WRScrollFrameStackingContextGenerator scrollFrames(this);
|
WrScrollFrameStackingContextGenerator scrollFrames(this);
|
||||||
|
|
||||||
Rect rect = RelativeToVisible(mRect.ToUnknownRect());
|
Rect rect = RelativeToVisible(mRect.ToUnknownRect());
|
||||||
Rect clip;
|
Rect clip;
|
||||||
|
@ -33,10 +33,10 @@ WebRenderBorderLayer::RenderLayer()
|
||||||
Rect relBounds = TransformedVisibleBoundsRelativeToParent();
|
Rect relBounds = TransformedVisibleBoundsRelativeToParent();
|
||||||
Rect overflow(0, 0, relBounds.width, relBounds.height);
|
Rect overflow(0, 0, relBounds.width, relBounds.height);
|
||||||
Matrix4x4 transform;// = GetTransform();
|
Matrix4x4 transform;// = GetTransform();
|
||||||
WRBridge()->AddWebRenderCommand(
|
WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), Nothing(), transform, FrameMetrics::NULL_SCROLL_ID));
|
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), Nothing(), transform, FrameMetrics::NULL_SCROLL_ID));
|
||||||
|
|
||||||
WRBridge()->AddWebRenderCommand(
|
WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPushBorder(wr::ToWrRect(rect), wr::ToWrRect(clip),
|
OpDPPushBorder(wr::ToWrRect(rect), wr::ToWrRect(clip),
|
||||||
wr::ToWrBorderSide(mWidths[0], mColors[0]),
|
wr::ToWrBorderSide(mWidths[0], mColors[0]),
|
||||||
wr::ToWrBorderSide(mWidths[1], mColors[1]),
|
wr::ToWrBorderSide(mWidths[1], mColors[1]),
|
||||||
|
@ -48,7 +48,7 @@ WebRenderBorderLayer::RenderLayer()
|
||||||
wr::ToWrLayoutSize(mCorners[2])));
|
wr::ToWrLayoutSize(mCorners[2])));
|
||||||
if (gfxPrefs::LayersDump()) printf_stderr("BorderLayer %p using %s as bounds/overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
if (gfxPrefs::LayersDump()) printf_stderr("BorderLayer %p using %s as bounds/overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
||||||
|
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
WrBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
|
|
|
@ -79,7 +79,7 @@ WebRenderBridgeParent::WebRenderBridgeParent(CompositorBridgeParentBase* aCompos
|
||||||
const uint64_t& aPipelineId,
|
const uint64_t& aPipelineId,
|
||||||
widget::CompositorWidget* aWidget,
|
widget::CompositorWidget* aWidget,
|
||||||
gl::GLContext* aGlContext,
|
gl::GLContext* aGlContext,
|
||||||
wrwindowstate* aWrWindowState,
|
WrWindowState* aWrWindowState,
|
||||||
layers::Compositor* aCompositor)
|
layers::Compositor* aCompositor)
|
||||||
: mCompositorBridge(aCompositorBridge)
|
: mCompositorBridge(aCompositorBridge)
|
||||||
, mPipelineId(aPipelineId)
|
, mPipelineId(aPipelineId)
|
||||||
|
|
|
@ -51,11 +51,11 @@ public:
|
||||||
const uint64_t& aPipelineId,
|
const uint64_t& aPipelineId,
|
||||||
widget::CompositorWidget* aWidget,
|
widget::CompositorWidget* aWidget,
|
||||||
gl::GLContext* aGlContext,
|
gl::GLContext* aGlContext,
|
||||||
wrwindowstate* aWrWindowState,
|
WrWindowState* aWrWindowState,
|
||||||
layers::Compositor* aCompositor);
|
layers::Compositor* aCompositor);
|
||||||
uint64_t PipelineId() { return mPipelineId; }
|
uint64_t PipelineId() { return mPipelineId; }
|
||||||
gl::GLContext* GLContext() { return mGLContext.get(); }
|
gl::GLContext* GLContext() { return mGLContext.get(); }
|
||||||
wrwindowstate* WindowState() { return mWRWindowState; }
|
WrWindowState* WindowState() { return mWRWindowState; }
|
||||||
layers::Compositor* Compositor() { return mCompositor.get(); }
|
layers::Compositor* Compositor() { return mCompositor.get(); }
|
||||||
CompositorVsyncScheduler* CompositorScheduler() { return mCompositorScheduler.get(); }
|
CompositorVsyncScheduler* CompositorScheduler() { return mCompositorScheduler.get(); }
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ private:
|
||||||
RefPtr<widget::CompositorWidget> mWidget;
|
RefPtr<widget::CompositorWidget> mWidget;
|
||||||
Maybe<wr::DisplayListBuilder> mBuilder;
|
Maybe<wr::DisplayListBuilder> mBuilder;
|
||||||
RefPtr<gl::GLContext> mGLContext;
|
RefPtr<gl::GLContext> mGLContext;
|
||||||
wrwindowstate* mWRWindowState;
|
WrWindowState* mWRWindowState;
|
||||||
RefPtr<wr::WebRenderAPI> mApi;
|
RefPtr<wr::WebRenderAPI> mApi;
|
||||||
RefPtr<layers::Compositor> mCompositor;
|
RefPtr<layers::Compositor> mCompositor;
|
||||||
RefPtr<CompositorVsyncScheduler> mCompositorScheduler;
|
RefPtr<CompositorVsyncScheduler> mCompositorScheduler;
|
||||||
|
|
|
@ -26,7 +26,7 @@ WebRenderCanvasLayer::~WebRenderCanvasLayer()
|
||||||
MOZ_COUNT_DTOR(WebRenderCanvasLayer);
|
MOZ_COUNT_DTOR(WebRenderCanvasLayer);
|
||||||
|
|
||||||
if (mExternalImageId) {
|
if (mExternalImageId) {
|
||||||
WRBridge()->DeallocExternalImageId(mExternalImageId);
|
WrBridge()->DeallocExternalImageId(mExternalImageId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ WebRenderCanvasLayer::RenderLayer()
|
||||||
UpdateCompositableClient();
|
UpdateCompositableClient();
|
||||||
|
|
||||||
if (!mExternalImageId) {
|
if (!mExternalImageId) {
|
||||||
mExternalImageId = WRBridge()->AllocExternalImageIdForCompositable(mCanvasClient);
|
mExternalImageId = WrBridge()->AllocExternalImageIdForCompositable(mCanvasClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(mExternalImageId);
|
MOZ_ASSERT(mExternalImageId);
|
||||||
|
@ -77,10 +77,10 @@ WebRenderCanvasLayer::RenderLayer()
|
||||||
Maybe<WrImageMask> mask = buildMaskLayer();
|
Maybe<WrImageMask> mask = buildMaskLayer();
|
||||||
WrTextureFilter filter = (mFlags | TextureFlags::USE_NEAREST_FILTER) ? WrTextureFilter::Point : WrTextureFilter::Linear;
|
WrTextureFilter filter = (mFlags | TextureFlags::USE_NEAREST_FILTER) ? WrTextureFilter::Point : WrTextureFilter::Linear;
|
||||||
|
|
||||||
WRBridge()->AddWebRenderCommand(
|
WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPushExternalImageId(LayerIntRegion(), wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), filter, mExternalImageId));
|
WrBridge()->AddWebRenderCommand(OpDPPushExternalImageId(LayerIntRegion(), wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), filter, mExternalImageId));
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
WrBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
||||||
|
|
||||||
if (gfxPrefs::LayersDump()) printf_stderr("CanvasLayer %p using %s as bounds/overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
if (gfxPrefs::LayersDump()) printf_stderr("CanvasLayer %p using %s as bounds/overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ public:
|
||||||
|
|
||||||
virtual CompositableForwarder* GetForwarder() override
|
virtual CompositableForwarder* GetForwarder() override
|
||||||
{
|
{
|
||||||
return Manager()->WRBridge();
|
return Manager()->WrBridge();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void AttachCompositable() override;
|
virtual void AttachCompositable() override;
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace layers {
|
||||||
void
|
void
|
||||||
WebRenderColorLayer::RenderLayer()
|
WebRenderColorLayer::RenderLayer()
|
||||||
{
|
{
|
||||||
WRScrollFrameStackingContextGenerator scrollFrames(this);
|
WrScrollFrameStackingContextGenerator scrollFrames(this);
|
||||||
|
|
||||||
LayerIntRegion visibleRegion = GetVisibleRegion();
|
LayerIntRegion visibleRegion = GetVisibleRegion();
|
||||||
LayerIntRect bounds = visibleRegion.GetBounds();
|
LayerIntRect bounds = visibleRegion.GetBounds();
|
||||||
|
@ -35,13 +35,13 @@ WebRenderColorLayer::RenderLayer()
|
||||||
|
|
||||||
Maybe<WrImageMask> mask = buildMaskLayer();
|
Maybe<WrImageMask> mask = buildMaskLayer();
|
||||||
|
|
||||||
WRBridge()->AddWebRenderCommand(
|
WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
||||||
WRBridge()->AddWebRenderCommand(
|
WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPushRect(wr::ToWrRect(rect), wr::ToWrRect(clip), mColor.r, mColor.g, mColor.b, mColor.a));
|
OpDPPushRect(wr::ToWrRect(rect), wr::ToWrRect(clip), mColor.r, mColor.g, mColor.b, mColor.a));
|
||||||
|
|
||||||
if (gfxPrefs::LayersDump()) printf_stderr("ColorLayer %p using %s as bounds, %s as overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(overflow).c_str(), Stringify(transform).c_str());
|
if (gfxPrefs::LayersDump()) printf_stderr("ColorLayer %p using %s as bounds, %s as overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(overflow).c_str(), Stringify(transform).c_str());
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
WrBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace layers {
|
||||||
void
|
void
|
||||||
WebRenderContainerLayer::RenderLayer()
|
WebRenderContainerLayer::RenderLayer()
|
||||||
{
|
{
|
||||||
WRScrollFrameStackingContextGenerator scrollFrames(this);
|
WrScrollFrameStackingContextGenerator scrollFrames(this);
|
||||||
|
|
||||||
nsTArray<LayerPolygon> children = SortChildrenBy3DZOrder(SortMode::WITHOUT_GEOMETRY);
|
nsTArray<LayerPolygon> children = SortChildrenBy3DZOrder(SortMode::WITHOUT_GEOMETRY);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ WebRenderContainerLayer::RenderLayer()
|
||||||
|
|
||||||
Maybe<WrImageMask> mask = buildMaskLayer();
|
Maybe<WrImageMask> mask = buildMaskLayer();
|
||||||
|
|
||||||
WRBridge()->AddWebRenderCommand(
|
WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
||||||
for (LayerPolygon& child : children) {
|
for (LayerPolygon& child : children) {
|
||||||
if (child.layer->IsBackfaceHidden()) {
|
if (child.layer->IsBackfaceHidden()) {
|
||||||
|
@ -34,19 +34,19 @@ WebRenderContainerLayer::RenderLayer()
|
||||||
}
|
}
|
||||||
ToWebRenderLayer(child.layer)->RenderLayer();
|
ToWebRenderLayer(child.layer)->RenderLayer();
|
||||||
}
|
}
|
||||||
WRBridge()->AddWebRenderCommand(
|
WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPopStackingContext());
|
OpDPPopStackingContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
WebRenderRefLayer::RenderLayer()
|
WebRenderRefLayer::RenderLayer()
|
||||||
{
|
{
|
||||||
WRScrollFrameStackingContextGenerator scrollFrames(this);
|
WrScrollFrameStackingContextGenerator scrollFrames(this);
|
||||||
|
|
||||||
gfx::Rect relBounds = TransformedVisibleBoundsRelativeToParent();
|
gfx::Rect relBounds = TransformedVisibleBoundsRelativeToParent();
|
||||||
gfx::Matrix4x4 transform;// = GetTransform();
|
gfx::Matrix4x4 transform;// = GetTransform();
|
||||||
if (gfxPrefs::LayersDump()) printf_stderr("RefLayer %p (%" PRIu64 ") using %s as bounds/overflow, %s as transform\n", this, mId, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
if (gfxPrefs::LayersDump()) printf_stderr("RefLayer %p (%" PRIu64 ") using %s as bounds/overflow, %s as transform\n", this, mId, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPushIframe(wr::ToWrRect(relBounds), wr::ToWrRect(relBounds), mId));
|
WrBridge()->AddWebRenderCommand(OpDPPushIframe(wr::ToWrRect(relBounds), wr::ToWrRect(relBounds), mId));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
|
|
|
@ -28,7 +28,7 @@ WebRenderImageLayer::~WebRenderImageLayer()
|
||||||
{
|
{
|
||||||
MOZ_COUNT_DTOR(WebRenderImageLayer);
|
MOZ_COUNT_DTOR(WebRenderImageLayer);
|
||||||
if (mExternalImageId) {
|
if (mExternalImageId) {
|
||||||
WRBridge()->DeallocExternalImageId(mExternalImageId);
|
WrBridge()->DeallocExternalImageId(mExternalImageId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ WebRenderImageLayer::RenderLayer()
|
||||||
|
|
||||||
if (!mImageClient) {
|
if (!mImageClient) {
|
||||||
mImageClient = ImageClient::CreateImageClient(CompositableType::IMAGE,
|
mImageClient = ImageClient::CreateImageClient(CompositableType::IMAGE,
|
||||||
WRBridge(),
|
WrBridge(),
|
||||||
TextureFlags::DEFAULT);
|
TextureFlags::DEFAULT);
|
||||||
if (!mImageClient) {
|
if (!mImageClient) {
|
||||||
return;
|
return;
|
||||||
|
@ -84,12 +84,12 @@ WebRenderImageLayer::RenderLayer()
|
||||||
|
|
||||||
// XXX update async ImageContainer rendering path
|
// XXX update async ImageContainer rendering path
|
||||||
//if (mContainer->IsAsync() && !mImageId) {
|
//if (mContainer->IsAsync() && !mImageId) {
|
||||||
// mExternalImageId = WRBridge()->AllocExternalImageId(mContainer->GetAsyncContainerID());
|
// mExternalImageId = WrBridge()->AllocExternalImageId(mContainer->GetAsyncContainerID());
|
||||||
// MOZ_ASSERT(mImageId);
|
// MOZ_ASSERT(mImageId);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (!mExternalImageId) {
|
if (!mExternalImageId) {
|
||||||
mExternalImageId = WRBridge()->AllocExternalImageIdForCompositable(mImageClient);
|
mExternalImageId = WrBridge()->AllocExternalImageIdForCompositable(mImageClient);
|
||||||
MOZ_ASSERT(mExternalImageId);
|
MOZ_ASSERT(mExternalImageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ WebRenderImageLayer::RenderLayer()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WRScrollFrameStackingContextGenerator scrollFrames(this);
|
WrScrollFrameStackingContextGenerator scrollFrames(this);
|
||||||
|
|
||||||
Rect rect(0, 0, size.width, size.height);
|
Rect rect(0, 0, size.width, size.height);
|
||||||
|
|
||||||
|
@ -143,10 +143,10 @@ WebRenderImageLayer::RenderLayer()
|
||||||
Maybe<WrImageMask> mask = buildMaskLayer();
|
Maybe<WrImageMask> mask = buildMaskLayer();
|
||||||
WrTextureFilter filter = (mSamplingFilter == gfx::SamplingFilter::POINT) ? WrTextureFilter::Point : WrTextureFilter::Linear;
|
WrTextureFilter filter = (mSamplingFilter == gfx::SamplingFilter::POINT) ? WrTextureFilter::Point : WrTextureFilter::Linear;
|
||||||
|
|
||||||
WRBridge()->AddWebRenderCommand(
|
WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPushExternalImageId(LayerIntRegion(), wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), filter, mExternalImageId));
|
WrBridge()->AddWebRenderCommand(OpDPPushExternalImageId(LayerIntRegion(), wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), filter, mExternalImageId));
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
WrBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
||||||
|
|
||||||
if (gfxPrefs::LayersDump()) printf_stderr("ImageLayer %p using %s as bounds/overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
if (gfxPrefs::LayersDump()) printf_stderr("ImageLayer %p using %s as bounds/overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
||||||
|
|
||||||
|
|
|
@ -31,15 +31,15 @@ using namespace gfx;
|
||||||
namespace layers {
|
namespace layers {
|
||||||
|
|
||||||
WebRenderLayerManager*
|
WebRenderLayerManager*
|
||||||
WebRenderLayer::WRManager()
|
WebRenderLayer::WrManager()
|
||||||
{
|
{
|
||||||
return static_cast<WebRenderLayerManager*>(GetLayer()->Manager());
|
return static_cast<WebRenderLayerManager*>(GetLayer()->Manager());
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRenderBridgeChild*
|
WebRenderBridgeChild*
|
||||||
WebRenderLayer::WRBridge()
|
WebRenderLayer::WrBridge()
|
||||||
{
|
{
|
||||||
return WRManager()->WRBridge();
|
return WrManager()->WrBridge();
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect
|
Rect
|
||||||
|
@ -115,12 +115,12 @@ WebRenderLayer::buildMaskLayer() {
|
||||||
MOZ_RELEASE_ASSERT(surface->GetFormat() == SurfaceFormat::A8, "bad format");
|
MOZ_RELEASE_ASSERT(surface->GetFormat() == SurfaceFormat::A8, "bad format");
|
||||||
wr::ByteBuffer buf(size.height * map.GetStride(), map.GetData());
|
wr::ByteBuffer buf(size.height * map.GetStride(), map.GetData());
|
||||||
WrImageKey maskKey;
|
WrImageKey maskKey;
|
||||||
WRBridge()->SendAddImage(size.width, size.height, map.GetStride(), A8, buf, &maskKey);
|
WrBridge()->SendAddImage(size.width, size.height, map.GetStride(), A8, buf, &maskKey);
|
||||||
|
|
||||||
imageMask.image = maskKey;
|
imageMask.image = maskKey;
|
||||||
imageMask.rect = wr::ToWrRect(Rect(0, 0, size.width, size.height));
|
imageMask.rect = wr::ToWrRect(Rect(0, 0, size.width, size.height));
|
||||||
imageMask.repeat = false;
|
imageMask.repeat = false;
|
||||||
WRManager()->AddImageKeyForDiscard(maskKey);
|
WrManager()->AddImageKeyForDiscard(maskKey);
|
||||||
mask = Some(imageMask);
|
mask = Some(imageMask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ WebRenderLayer::buildMaskLayer() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WRScrollFrameStackingContextGenerator::WRScrollFrameStackingContextGenerator(
|
WrScrollFrameStackingContextGenerator::WrScrollFrameStackingContextGenerator(
|
||||||
WebRenderLayer* aLayer)
|
WebRenderLayer* aLayer)
|
||||||
: mLayer(aLayer)
|
: mLayer(aLayer)
|
||||||
{
|
{
|
||||||
|
@ -157,12 +157,12 @@ WRScrollFrameStackingContextGenerator::WRScrollFrameStackingContextGenerator(
|
||||||
fm.GetScrollId(), Stringify(bounds).c_str(), Stringify(overflow).c_str());
|
fm.GetScrollId(), Stringify(bounds).c_str(), Stringify(overflow).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
mLayer->WRBridge()->AddWebRenderCommand(
|
mLayer->WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPushStackingContext(wr::ToWrRect(bounds), wr::ToWrRect(overflow), Nothing(), identity, fm.GetScrollId()));
|
OpDPPushStackingContext(wr::ToWrRect(bounds), wr::ToWrRect(overflow), Nothing(), identity, fm.GetScrollId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WRScrollFrameStackingContextGenerator::~WRScrollFrameStackingContextGenerator()
|
WrScrollFrameStackingContextGenerator::~WrScrollFrameStackingContextGenerator()
|
||||||
{
|
{
|
||||||
Layer* layer = mLayer->GetLayer();
|
Layer* layer = mLayer->GetLayer();
|
||||||
for (size_t i = 0; i < layer->GetScrollMetadataCount(); i++) {
|
for (size_t i = 0; i < layer->GetScrollMetadataCount(); i++) {
|
||||||
|
@ -171,7 +171,7 @@ WRScrollFrameStackingContextGenerator::~WRScrollFrameStackingContextGenerator()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (gfxPrefs::LayersDump()) printf_stderr("Popping stacking context id %" PRIu64"\n", fm.GetScrollId());
|
if (gfxPrefs::LayersDump()) printf_stderr("Popping stacking context id %" PRIu64"\n", fm.GetScrollId());
|
||||||
mLayer->WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
mLayer->WrBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ WebRenderLayerManager::WebRenderLayerManager(nsIWidget* aWidget)
|
||||||
KnowsCompositor*
|
KnowsCompositor*
|
||||||
WebRenderLayerManager::AsKnowsCompositor()
|
WebRenderLayerManager::AsKnowsCompositor()
|
||||||
{
|
{
|
||||||
return mWRChild;
|
return mWrChild;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -195,17 +195,17 @@ WebRenderLayerManager::Initialize(PCompositorBridgeChild* aCBChild,
|
||||||
uint64_t aLayersId,
|
uint64_t aLayersId,
|
||||||
TextureFactoryIdentifier* aTextureFactoryIdentifier)
|
TextureFactoryIdentifier* aTextureFactoryIdentifier)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(mWRChild == nullptr);
|
MOZ_ASSERT(mWrChild == nullptr);
|
||||||
MOZ_ASSERT(aTextureFactoryIdentifier);
|
MOZ_ASSERT(aTextureFactoryIdentifier);
|
||||||
|
|
||||||
TextureFactoryIdentifier textureFactoryIdentifier;
|
TextureFactoryIdentifier textureFactoryIdentifier;
|
||||||
PWebRenderBridgeChild* bridge = aCBChild->SendPWebRenderBridgeConstructor(aLayersId,
|
PWebRenderBridgeChild* bridge = aCBChild->SendPWebRenderBridgeConstructor(aLayersId,
|
||||||
&textureFactoryIdentifier);
|
&textureFactoryIdentifier);
|
||||||
MOZ_ASSERT(bridge);
|
MOZ_ASSERT(bridge);
|
||||||
mWRChild = static_cast<WebRenderBridgeChild*>(bridge);
|
mWrChild = static_cast<WebRenderBridgeChild*>(bridge);
|
||||||
LayoutDeviceIntSize size = mWidget->GetClientSize();
|
LayoutDeviceIntSize size = mWidget->GetClientSize();
|
||||||
WRBridge()->SendCreate(size.width, size.height);
|
WrBridge()->SendCreate(size.width, size.height);
|
||||||
WRBridge()->IdentifyTextureHost(textureFactoryIdentifier);
|
WrBridge()->IdentifyTextureHost(textureFactoryIdentifier);
|
||||||
*aTextureFactoryIdentifier = textureFactoryIdentifier;
|
*aTextureFactoryIdentifier = textureFactoryIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ WebRenderLayerManager::Destroy()
|
||||||
|
|
||||||
LayerManager::Destroy();
|
LayerManager::Destroy();
|
||||||
DiscardImages();
|
DiscardImages();
|
||||||
WRBridge()->Destroy();
|
WrBridge()->Destroy();
|
||||||
|
|
||||||
if (mTransactionIdAllocator) {
|
if (mTransactionIdAllocator) {
|
||||||
// Make sure to notify the refresh driver just in case it's waiting on a
|
// Make sure to notify the refresh driver just in case it's waiting on a
|
||||||
|
@ -249,7 +249,7 @@ WebRenderLayerManager::GetCompositorBridgeChild()
|
||||||
int32_t
|
int32_t
|
||||||
WebRenderLayerManager::GetMaxTextureSize() const
|
WebRenderLayerManager::GetMaxTextureSize() const
|
||||||
{
|
{
|
||||||
return WRBridge()->GetMaxTextureSize();
|
return WrBridge()->GetMaxTextureSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -289,7 +289,7 @@ WebRenderLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||||
mAnimationReadyTime = TimeStamp::Now();
|
mAnimationReadyTime = TimeStamp::Now();
|
||||||
|
|
||||||
LayoutDeviceIntSize size = mWidget->GetClientSize();
|
LayoutDeviceIntSize size = mWidget->GetClientSize();
|
||||||
if (!WRBridge()->DPBegin(size.width, size.height)) {
|
if (!WrBridge()->DPBegin(size.width, size.height)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ WebRenderLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
|
||||||
bool sync = mTarget != nullptr;
|
bool sync = mTarget != nullptr;
|
||||||
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId();
|
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId();
|
||||||
|
|
||||||
WRBridge()->DPEnd(sync, mLatestTransactionId);
|
WrBridge()->DPEnd(sync, mLatestTransactionId);
|
||||||
|
|
||||||
MakeSnapshotIfRequired(size);
|
MakeSnapshotIfRequired(size);
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ WebRenderLayerManager::MakeSnapshotIfRequired(LayoutDeviceIntSize aSize)
|
||||||
|
|
||||||
// TODO: fixup for proper surface format.
|
// TODO: fixup for proper surface format.
|
||||||
RefPtr<TextureClient> texture =
|
RefPtr<TextureClient> texture =
|
||||||
TextureClient::CreateForRawBufferAccess(WRBridge(),
|
TextureClient::CreateForRawBufferAccess(WrBridge(),
|
||||||
SurfaceFormat::B8G8R8A8,
|
SurfaceFormat::B8G8R8A8,
|
||||||
aSize.ToUnknownSize(),
|
aSize.ToUnknownSize(),
|
||||||
BackendType::SKIA,
|
BackendType::SKIA,
|
||||||
|
@ -328,13 +328,13 @@ WebRenderLayerManager::MakeSnapshotIfRequired(LayoutDeviceIntSize aSize)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
texture->InitIPDLActor(WRBridge());
|
texture->InitIPDLActor(WrBridge());
|
||||||
if (!texture->GetIPDLActor()) {
|
if (!texture->GetIPDLActor()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IntRect bounds = ToOutsideIntRect(mTarget->GetClipExtents());
|
IntRect bounds = ToOutsideIntRect(mTarget->GetClipExtents());
|
||||||
if (!WRBridge()->SendDPGetSnapshot(texture->GetIPDLActor())) {
|
if (!WrBridge()->SendDPGetSnapshot(texture->GetIPDLActor())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ void
|
||||||
WebRenderLayerManager::DiscardImages()
|
WebRenderLayerManager::DiscardImages()
|
||||||
{
|
{
|
||||||
for (auto key : mImageKeys) {
|
for (auto key : mImageKeys) {
|
||||||
WRBridge()->SendDeleteImage(key);
|
WrBridge()->SendDeleteImage(key);
|
||||||
}
|
}
|
||||||
mImageKeys.clear();
|
mImageKeys.clear();
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,7 @@ WebRenderLayerManager::Hold(Layer* aLayer)
|
||||||
void
|
void
|
||||||
WebRenderLayerManager::SetLayerObserverEpoch(uint64_t aLayerObserverEpoch)
|
WebRenderLayerManager::SetLayerObserverEpoch(uint64_t aLayerObserverEpoch)
|
||||||
{
|
{
|
||||||
WRBridge()->SendSetLayerObserverEpoch(aLayerObserverEpoch);
|
WrBridge()->SendSetLayerObserverEpoch(aLayerObserverEpoch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -436,7 +436,7 @@ WebRenderLayerManager::ClearLayer(Layer* aLayer)
|
||||||
void
|
void
|
||||||
WebRenderLayerManager::ClearCachedResources(Layer* aSubtree)
|
WebRenderLayerManager::ClearCachedResources(Layer* aSubtree)
|
||||||
{
|
{
|
||||||
WRBridge()->SendClearCachedResources();
|
WrBridge()->SendClearCachedResources();
|
||||||
if (aSubtree) {
|
if (aSubtree) {
|
||||||
ClearLayer(aSubtree);
|
ClearLayer(aSubtree);
|
||||||
} else if (mRoot) {
|
} else if (mRoot) {
|
||||||
|
@ -447,13 +447,13 @@ WebRenderLayerManager::ClearCachedResources(Layer* aSubtree)
|
||||||
void
|
void
|
||||||
WebRenderLayerManager::UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aNewIdentifier)
|
WebRenderLayerManager::UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aNewIdentifier)
|
||||||
{
|
{
|
||||||
WRBridge()->IdentifyTextureHost(aNewIdentifier);
|
WrBridge()->IdentifyTextureHost(aNewIdentifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureFactoryIdentifier
|
TextureFactoryIdentifier
|
||||||
WebRenderLayerManager::GetTextureFactoryIdentifier()
|
WebRenderLayerManager::GetTextureFactoryIdentifier()
|
||||||
{
|
{
|
||||||
return WRBridge()->GetTextureFactoryIdentifier();
|
return WrBridge()->GetTextureFactoryIdentifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -37,8 +37,8 @@ public:
|
||||||
return static_cast<WebRenderLayer*>(aLayer->ImplData());
|
return static_cast<WebRenderLayer*>(aLayer->ImplData());
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRenderLayerManager* WRManager();
|
WebRenderLayerManager* WrManager();
|
||||||
WebRenderBridgeChild* WRBridge();
|
WebRenderBridgeChild* WrBridge();
|
||||||
|
|
||||||
gfx::Rect RelativeToVisible(gfx::Rect aRect);
|
gfx::Rect RelativeToVisible(gfx::Rect aRect);
|
||||||
gfx::Rect RelativeToTransformedVisible(gfx::Rect aRect);
|
gfx::Rect RelativeToTransformedVisible(gfx::Rect aRect);
|
||||||
|
@ -50,11 +50,11 @@ protected:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MOZ_RAII WRScrollFrameStackingContextGenerator
|
class MOZ_RAII WrScrollFrameStackingContextGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit WRScrollFrameStackingContextGenerator(WebRenderLayer* aLayer);
|
explicit WrScrollFrameStackingContextGenerator(WebRenderLayer* aLayer);
|
||||||
~WRScrollFrameStackingContextGenerator();
|
~WrScrollFrameStackingContextGenerator();
|
||||||
private:
|
private:
|
||||||
WebRenderLayer* mLayer;
|
WebRenderLayer* mLayer;
|
||||||
};
|
};
|
||||||
|
@ -131,7 +131,7 @@ public:
|
||||||
void AddImageKeyForDiscard(WrImageKey);
|
void AddImageKeyForDiscard(WrImageKey);
|
||||||
void DiscardImages();
|
void DiscardImages();
|
||||||
|
|
||||||
WebRenderBridgeChild* WRBridge() const { return mWRChild; }
|
WebRenderBridgeChild* WrBridge() const { return mWrChild; }
|
||||||
|
|
||||||
void Hold(Layer* aLayer);
|
void Hold(Layer* aLayer);
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ private:
|
||||||
DrawPaintedLayerCallback mPaintedLayerCallback;
|
DrawPaintedLayerCallback mPaintedLayerCallback;
|
||||||
void *mPaintedLayerCallbackData;
|
void *mPaintedLayerCallbackData;
|
||||||
|
|
||||||
RefPtr<WebRenderBridgeChild> mWRChild;
|
RefPtr<WebRenderBridgeChild> mWrChild;
|
||||||
|
|
||||||
RefPtr<TransactionIdAllocator> mTransactionIdAllocator;
|
RefPtr<TransactionIdAllocator> mTransactionIdAllocator;
|
||||||
uint64_t mLatestTransactionId;
|
uint64_t mLatestTransactionId;
|
||||||
|
|
|
@ -86,7 +86,7 @@ void
|
||||||
WebRenderPaintedLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
WebRenderPaintedLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
|
||||||
{
|
{
|
||||||
if (!mContentClient) {
|
if (!mContentClient) {
|
||||||
mContentClient = ContentClient::CreateContentClient(Manager()->WRBridge());
|
mContentClient = ContentClient::CreateContentClient(Manager()->WrBridge());
|
||||||
if (!mContentClient) {
|
if (!mContentClient) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ WebRenderPaintedLayer::RenderLayer()
|
||||||
RenderLayerWithReadback(nullptr);
|
RenderLayerWithReadback(nullptr);
|
||||||
|
|
||||||
if (!mExternalImageId) {
|
if (!mExternalImageId) {
|
||||||
mExternalImageId = WRBridge()->AllocExternalImageIdForCompositable(mContentClient);
|
mExternalImageId = WrBridge()->AllocExternalImageIdForCompositable(mContentClient);
|
||||||
MOZ_ASSERT(mExternalImageId);
|
MOZ_ASSERT(mExternalImageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ WebRenderPaintedLayer::RenderLayer()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WRScrollFrameStackingContextGenerator scrollFrames(this);
|
WrScrollFrameStackingContextGenerator scrollFrames(this);
|
||||||
|
|
||||||
// Since we are creating a stacking context below using the visible region of
|
// Since we are creating a stacking context below using the visible region of
|
||||||
// this layer, we need to make sure the image display item has coordinates
|
// this layer, we need to make sure the image display item has coordinates
|
||||||
|
@ -145,15 +145,15 @@ WebRenderPaintedLayer::RenderLayer()
|
||||||
Rect overflow(0, 0, relBounds.width, relBounds.height);
|
Rect overflow(0, 0, relBounds.width, relBounds.height);
|
||||||
Matrix4x4 transform;// = GetTransform();
|
Matrix4x4 transform;// = GetTransform();
|
||||||
|
|
||||||
WRBridge()->AddWebRenderCommand(
|
WrBridge()->AddWebRenderCommand(
|
||||||
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
|
||||||
|
|
||||||
ContentClientRemoteBuffer* contentClientRemote = static_cast<ContentClientRemoteBuffer*>(mContentClient.get());
|
ContentClientRemoteBuffer* contentClientRemote = static_cast<ContentClientRemoteBuffer*>(mContentClient.get());
|
||||||
visibleRegion.MoveBy(-contentClientRemote->BufferRect().x, -contentClientRemote->BufferRect().y);
|
visibleRegion.MoveBy(-contentClientRemote->BufferRect().x, -contentClientRemote->BufferRect().y);
|
||||||
|
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPushExternalImageId(visibleRegion, wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), WrTextureFilter::Linear, mExternalImageId));
|
WrBridge()->AddWebRenderCommand(OpDPPushExternalImageId(visibleRegion, wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), WrTextureFilter::Linear, mExternalImageId));
|
||||||
if (gfxPrefs::LayersDump()) printf_stderr("PaintedLayer %p using %s as bounds/overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
if (gfxPrefs::LayersDump()) printf_stderr("PaintedLayer %p using %s as bounds/overflow, %s for transform\n", this, Stringify(relBounds).c_str(), Stringify(transform).c_str());
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
WrBridge()->AddWebRenderCommand(OpDPPopStackingContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace layers
|
} // namespace layers
|
||||||
|
|
|
@ -33,7 +33,7 @@ protected:
|
||||||
{
|
{
|
||||||
MOZ_COUNT_DTOR(WebRenderPaintedLayer);
|
MOZ_COUNT_DTOR(WebRenderPaintedLayer);
|
||||||
if (mExternalImageId) {
|
if (mExternalImageId) {
|
||||||
WRBridge()->DeallocExternalImageId(mExternalImageId);
|
WrBridge()->DeallocExternalImageId(mExternalImageId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WebRenderLayerManager* Manager()
|
WebRenderLayerManager* Manager()
|
||||||
|
|
|
@ -67,7 +67,7 @@ WebRenderTextLayer::RenderLayer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WRBridge()->AddWebRenderCommand(OpDPPushText(
|
WrBridge()->AddWebRenderCommand(OpDPPushText(
|
||||||
wr::ToWrRect(rect),
|
wr::ToWrRect(rect),
|
||||||
wr::ToWrRect(clip),
|
wr::ToWrRect(clip),
|
||||||
wr_glyphs,
|
wr_glyphs,
|
||||||
|
|
|
@ -178,7 +178,7 @@ struct WrExternalImageIdHandler {
|
||||||
ReleaseExternalImageCallback release_func;
|
ReleaseExternalImageCallback release_func;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wrwindowstate;
|
struct WrWindowState;
|
||||||
|
|
||||||
#ifdef MOZ_ENABLE_WEBRENDER
|
#ifdef MOZ_ENABLE_WEBRENDER
|
||||||
# define WR_INLINE
|
# define WR_INLINE
|
||||||
|
@ -218,7 +218,7 @@ wr_window_new(WrWindowId window_id,
|
||||||
WrRenderer** out_renderer) WR_FUNC;
|
WrRenderer** out_renderer) WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_window_remove_pipeline(wrwindowstate* window, WrState* state) WR_FUNC;
|
wr_window_remove_pipeline(WrWindowState* window, WrState* state) WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_api_delete(WrAPI* api) WR_FUNC;
|
wr_api_delete(WrAPI* api) WR_FUNC;
|
||||||
|
@ -246,15 +246,15 @@ WR_INLINE void
|
||||||
wr_api_set_root_display_list(WrAPI* api, WrState* state, uint32_t epoch, float w, float h) WR_FUNC;
|
wr_api_set_root_display_list(WrAPI* api, WrState* state, uint32_t epoch, float w, float h) WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_window_init_pipeline_epoch(wrwindowstate* window, WrPipelineId pipeline, uint32_t width, uint32_t height) WR_FUNC;
|
wr_window_init_pipeline_epoch(WrWindowState* window, WrPipelineId pipeline, uint32_t width, uint32_t height) WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE WrFontKey
|
WR_INLINE WrFontKey
|
||||||
wr_api_add_raw_font(WrAPI* api, uint8_t* font_buffer, size_t buffer_size) WR_FUNC;
|
wr_api_add_raw_font(WrAPI* api, uint8_t* font_buffer, size_t buffer_size) WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE WrFontKey
|
WR_INLINE WrFontKey
|
||||||
wr_window_add_raw_font(wrwindowstate* window, uint8_t* font_buffer, size_t buffer_size) WR_FUNC;
|
wr_window_add_raw_font(WrWindowState* window, uint8_t* font_buffer, size_t buffer_size) WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE wrwindowstate*
|
WR_INLINE WrWindowState*
|
||||||
wr_init_window(WrPipelineId root_pipeline_id,
|
wr_init_window(WrPipelineId root_pipeline_id,
|
||||||
void* webrender_bridge_ptr,
|
void* webrender_bridge_ptr,
|
||||||
bool enable_profiler,
|
bool enable_profiler,
|
||||||
|
@ -268,33 +268,33 @@ WR_INLINE void
|
||||||
wr_state_delete(WrState* state) WR_FUNC;
|
wr_state_delete(WrState* state) WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_destroy(wrwindowstate* wrWindow, WrState* WrState)
|
wr_destroy(WrWindowState* wrWindow, WrState* WrState)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE WrImageKey
|
WR_INLINE WrImageKey
|
||||||
wr_add_image(wrwindowstate* wrWindow, uint32_t width, uint32_t height,
|
wr_add_image(WrWindowState* wrWindow, uint32_t width, uint32_t height,
|
||||||
uint32_t stride, WrImageFormat format, uint8_t *bytes, size_t size)
|
uint32_t stride, WrImageFormat format, uint8_t *bytes, size_t size)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE WrImageKey
|
WR_INLINE WrImageKey
|
||||||
wr_add_external_image_texture(wrwindowstate* wrWindow, uint32_t width, uint32_t height,
|
wr_add_external_image_texture(WrWindowState* wrWindow, uint32_t width, uint32_t height,
|
||||||
WrImageFormat format, uint64_t external_image_id)
|
WrImageFormat format, uint64_t external_image_id)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
//TODO(Jerry): handle shmem in WR
|
//TODO(Jerry): handle shmem in WR
|
||||||
//// WR_INLINE WrImageKey
|
//// WR_INLINE WrImageKey
|
||||||
//// wr_add_external_image_buffer(wrwindowstate* wrWindow, uint32_t width, uint32_t height,
|
//// wr_add_external_image_buffer(WrWindowState* wrWindow, uint32_t width, uint32_t height,
|
||||||
//// uint32_t stride, WrImageFormat format, uint8_t *bytes, size_t size)
|
//// uint32_t stride, WrImageFormat format, uint8_t *bytes, size_t size)
|
||||||
//// WR_FUNC;
|
//// WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_update_image(wrwindowstate* wrWindow, WrImageKey key,
|
wr_update_image(WrWindowState* wrWindow, WrImageKey key,
|
||||||
uint32_t width, uint32_t height,
|
uint32_t width, uint32_t height,
|
||||||
WrImageFormat format, uint8_t *bytes, size_t size)
|
WrImageFormat format, uint8_t *bytes, size_t size)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_delete_image(wrwindowstate* wrWindow, WrImageKey key)
|
wr_delete_image(WrWindowState* wrWindow, WrImageKey key)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
|
@ -313,18 +313,18 @@ wr_dp_begin(WrState* wrState, uint32_t width, uint32_t height)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_window_dp_begin(wrwindowstate* wrWindow, WrState* wrState, uint32_t width, uint32_t height)
|
wr_window_dp_begin(WrWindowState* wrWindow, WrState* wrState, uint32_t width, uint32_t height)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_window_dp_end(wrwindowstate* wrWindow, WrState* wrState)
|
wr_window_dp_end(WrWindowState* wrWindow, WrState* wrState)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_dp_end(WrState* builder, WrAPI* api, uint32_t epoch) WR_FUNC;
|
wr_dp_end(WrState* builder, WrAPI* api, uint32_t epoch) WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_composite_window(wrwindowstate* wrWindow)
|
wr_composite_window(WrWindowState* wrWindow)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
|
@ -354,7 +354,7 @@ WR_FUNC;
|
||||||
|
|
||||||
// TODO: Remove.
|
// TODO: Remove.
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_window_dp_push_iframe(wrwindowstate* wrWindow, WrState* wrState, WrRect bounds, WrRect clip,
|
wr_window_dp_push_iframe(WrWindowState* wrWindow, WrState* wrState, WrRect bounds, WrRect clip,
|
||||||
WrPipelineId layers_id)
|
WrPipelineId layers_id)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
|
@ -365,13 +365,13 @@ wr_dp_push_iframe(WrState* wrState, WrRect bounds, WrRect clip, WrPipelineId lay
|
||||||
// It is the responsibility of the caller to manage the dst_buffer memory
|
// It is the responsibility of the caller to manage the dst_buffer memory
|
||||||
// and also free it at the proper time.
|
// and also free it at the proper time.
|
||||||
WR_INLINE const uint8_t*
|
WR_INLINE const uint8_t*
|
||||||
wr_readback_into_buffer(wrwindowstate* wrWindow, uint32_t width, uint32_t height,
|
wr_readback_into_buffer(WrWindowState* wrWindow, uint32_t width, uint32_t height,
|
||||||
uint8_t* dst_buffer, uint32_t buffer_length)
|
uint8_t* dst_buffer, uint32_t buffer_length)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
// TODO: Remove.
|
// TODO: Remove.
|
||||||
WR_INLINE void
|
WR_INLINE void
|
||||||
wr_profiler_set_enabled(wrwindowstate* wrWindow, bool enabled)
|
wr_profiler_set_enabled(WrWindowState* wrWindow, bool enabled)
|
||||||
WR_FUNC;
|
WR_FUNC;
|
||||||
|
|
||||||
#undef WR_FUNC
|
#undef WR_FUNC
|
||||||
|
|
Загрузка…
Ссылка в новой задаче