Bug 1331515 - More WR to Wr prefix conversion. r=gfx?

This commit is contained in:
Nicolas Silva 2017-01-17 10:17:38 -05:00
Родитель a2579a7676
Коммит d8d26d90cf
17 изменённых файлов: 112 добавлений и 112 удалений

Просмотреть файл

@ -462,17 +462,17 @@ CompositorBridgeParent::StopAndClearResources()
mCompositionManager = nullptr;
}
if (mWRBridge) {
if (mWrBridge) {
MonitorAutoLock lock(*sIndirectLayerTreesLock);
ForEachIndirectLayerTree([this] (LayerTreeState* lts, uint64_t) -> void {
if (lts->mWRBridge) {
lts->mWRBridge->Destroy();
lts->mWRBridge = nullptr;
if (lts->mWrBridge) {
lts->mWrBridge->Destroy();
lts->mWrBridge = nullptr;
}
lts->mParent = nullptr;
});
mWRBridge->Destroy();
mWRBridge = nullptr;
mWrBridge->Destroy();
mWrBridge = nullptr;
}
if (mCompositor) {
@ -1572,7 +1572,7 @@ CompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t& aPipelineId,
MOZ_RELEASE_ASSERT(false);
#endif
MOZ_ASSERT(aPipelineId == mRootLayerTreeID);
MOZ_ASSERT(!mWRBridge);
MOZ_ASSERT(!mWrBridge);
MOZ_ASSERT(!mCompositor);
MOZ_ASSERT(!mCompositorScheduler);
@ -1581,20 +1581,20 @@ CompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t& aPipelineId,
// MOZ_ASSERT(mWidget);
// RefPtr<widget::CompositorWidget> widget = mWidget;
// 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));
mCompositor = new WebRenderCompositorOGL(this, glc.get());
mWRBridge = new WebRenderBridgeParent(this, aPipelineId,
mWrBridge = new WebRenderBridgeParent(this, aPipelineId,
mWidget, glc.get(), nullptr, mCompositor.get());
mCompositorScheduler = mWRBridge->CompositorScheduler();
mCompositorScheduler = mWrBridge->CompositorScheduler();
MOZ_ASSERT(mCompositorScheduler);
mWRBridge.get()->AddRef(); // IPDL reference
mWrBridge.get()->AddRef(); // IPDL reference
MonitorAutoLock lock(*sIndirectLayerTreesLock);
MOZ_ASSERT(sIndirectLayerTrees[aPipelineId].mWRBridge == nullptr);
sIndirectLayerTrees[aPipelineId].mWRBridge = mWRBridge;
MOZ_ASSERT(sIndirectLayerTrees[aPipelineId].mWrBridge == nullptr);
sIndirectLayerTrees[aPipelineId].mWrBridge = mWrBridge;
*aTextureFactoryIdentifier = mCompositor->GetTextureFactoryIdentifier();
return mWRBridge;
return mWrBridge;
}
bool
@ -1610,7 +1610,7 @@ CompositorBridgeParent::DeallocPWebRenderBridgeParent(PWebRenderBridgeParent* aA
MonitorAutoLock lock(*sIndirectLayerTreesLock);
auto it = sIndirectLayerTrees.find(parent->PipelineId());
if (it != sIndirectLayerTrees.end()) {
it->second.mWRBridge = nullptr;
it->second.mWrBridge = nullptr;
}
}
parent->Release(); // IPDL reference
@ -1623,8 +1623,8 @@ CompositorBridgeParent::SetWebRenderProfilerEnabled(bool aEnabled)
MonitorAutoLock lock(*sIndirectLayerTreesLock);
for (auto it = sIndirectLayerTrees.begin(); it != sIndirectLayerTrees.end(); it++) {
LayerTreeState* state = &it->second;
if (state->mWRBridge) {
state->mWRBridge->SetWebRenderProfilerEnabled(aEnabled);
if (state->mWrBridge) {
state->mWrBridge->SetWebRenderProfilerEnabled(aEnabled);
}
}
}

Просмотреть файл

@ -354,7 +354,7 @@ public:
APZCTreeManagerParent* mApzcTreeManagerParent;
RefPtr<CompositorBridgeParent> mParent;
HostLayerManager* mLayerManager;
RefPtr<WebRenderBridgeParent> mWRBridge;
RefPtr<WebRenderBridgeParent> mWrBridge;
// Pointer to the CrossProcessCompositorBridgeParent. Used by APZCs to share
// their FrameMetrics with the corresponding child process that holds
// the PCompositorBridgeChild
@ -553,7 +553,7 @@ protected:
RefPtr<HostLayerManager> mLayerManager;
RefPtr<Compositor> mCompositor;
RefPtr<AsyncCompositionManager> mCompositionManager;
RefPtr<WebRenderBridgeParent> mWRBridge;
RefPtr<WebRenderBridgeParent> mWrBridge;
widget::CompositorWidget* mWidget;
TimeStamp mTestTime;
CSSToLayoutDeviceScale mScale;

Просмотреть файл

@ -212,15 +212,15 @@ CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const uint64_t&
MonitorAutoLock lock(*sIndirectLayerTreesLock);
MOZ_ASSERT(sIndirectLayerTrees.find(aPipelineId) != sIndirectLayerTrees.end());
MOZ_ASSERT(sIndirectLayerTrees[aPipelineId].mWRBridge == nullptr);
MOZ_ASSERT(sIndirectLayerTrees[aPipelineId].mWrBridge == nullptr);
CompositorBridgeParent* cbp = sIndirectLayerTrees[aPipelineId].mParent;
WebRenderBridgeParent* root = sIndirectLayerTrees[cbp->RootLayerTreeId()].mWRBridge.get();
WebRenderBridgeParent* root = sIndirectLayerTrees[cbp->RootLayerTreeId()].mWrBridge.get();
WebRenderBridgeParent* parent = new WebRenderBridgeParent(
this, aPipelineId, nullptr, root->GLContext(), root->WindowState(), root->Compositor());
parent->AddRef(); // IPDL reference
sIndirectLayerTrees[aPipelineId].mCrossProcessParent = this;
sIndirectLayerTrees[aPipelineId].mWRBridge = parent;
sIndirectLayerTrees[aPipelineId].mWrBridge = parent;
*aTextureFactoryIdentifier = parent->Compositor()->GetTextureFactoryIdentifier();
return parent;
}
@ -317,7 +317,7 @@ CrossProcessCompositorBridgeParent::DidComposite(
if (LayerTransactionParent *layerTree = sIndirectLayerTrees[aId].mLayerTree) {
Unused << SendDidComposite(aId, layerTree->GetPendingTransactionId(), aCompositeStart, aCompositeEnd);
layerTree->SetPendingTransactionId(0);
} else if (WebRenderBridgeParent* wrbridge = sIndirectLayerTrees[aId].mWRBridge) {
} else if (WebRenderBridgeParent* wrbridge = sIndirectLayerTrees[aId].mWrBridge) {
Unused << SendDidComposite(aId, wrbridge->GetPendingTransactionId(), aCompositeStart, aCompositeEnd);
wrbridge->SetPendingTransactionId(0);
}

Просмотреть файл

@ -18,7 +18,7 @@ using namespace mozilla::gfx;
void
WebRenderBorderLayer::RenderLayer()
{
WRScrollFrameStackingContextGenerator scrollFrames(this);
WrScrollFrameStackingContextGenerator scrollFrames(this);
Rect rect = RelativeToVisible(mRect.ToUnknownRect());
Rect clip;
@ -33,10 +33,10 @@ WebRenderBorderLayer::RenderLayer()
Rect relBounds = TransformedVisibleBoundsRelativeToParent();
Rect overflow(0, 0, relBounds.width, relBounds.height);
Matrix4x4 transform;// = GetTransform();
WRBridge()->AddWebRenderCommand(
WrBridge()->AddWebRenderCommand(
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), Nothing(), transform, FrameMetrics::NULL_SCROLL_ID));
WRBridge()->AddWebRenderCommand(
WrBridge()->AddWebRenderCommand(
OpDPPushBorder(wr::ToWrRect(rect), wr::ToWrRect(clip),
wr::ToWrBorderSide(mWidths[0], mColors[0]),
wr::ToWrBorderSide(mWidths[1], mColors[1]),
@ -48,7 +48,7 @@ WebRenderBorderLayer::RenderLayer()
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());
WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
WrBridge()->AddWebRenderCommand(OpDPPopStackingContext());
}
} // namespace layers

Просмотреть файл

@ -79,7 +79,7 @@ WebRenderBridgeParent::WebRenderBridgeParent(CompositorBridgeParentBase* aCompos
const uint64_t& aPipelineId,
widget::CompositorWidget* aWidget,
gl::GLContext* aGlContext,
wrwindowstate* aWrWindowState,
WrWindowState* aWrWindowState,
layers::Compositor* aCompositor)
: mCompositorBridge(aCompositorBridge)
, mPipelineId(aPipelineId)

Просмотреть файл

@ -51,11 +51,11 @@ public:
const uint64_t& aPipelineId,
widget::CompositorWidget* aWidget,
gl::GLContext* aGlContext,
wrwindowstate* aWrWindowState,
WrWindowState* aWrWindowState,
layers::Compositor* aCompositor);
uint64_t PipelineId() { return mPipelineId; }
gl::GLContext* GLContext() { return mGLContext.get(); }
wrwindowstate* WindowState() { return mWRWindowState; }
WrWindowState* WindowState() { return mWRWindowState; }
layers::Compositor* Compositor() { return mCompositor.get(); }
CompositorVsyncScheduler* CompositorScheduler() { return mCompositorScheduler.get(); }
@ -142,7 +142,7 @@ private:
RefPtr<widget::CompositorWidget> mWidget;
Maybe<wr::DisplayListBuilder> mBuilder;
RefPtr<gl::GLContext> mGLContext;
wrwindowstate* mWRWindowState;
WrWindowState* mWRWindowState;
RefPtr<wr::WebRenderAPI> mApi;
RefPtr<layers::Compositor> mCompositor;
RefPtr<CompositorVsyncScheduler> mCompositorScheduler;

Просмотреть файл

@ -26,7 +26,7 @@ WebRenderCanvasLayer::~WebRenderCanvasLayer()
MOZ_COUNT_DTOR(WebRenderCanvasLayer);
if (mExternalImageId) {
WRBridge()->DeallocExternalImageId(mExternalImageId);
WrBridge()->DeallocExternalImageId(mExternalImageId);
}
}
@ -50,7 +50,7 @@ WebRenderCanvasLayer::RenderLayer()
UpdateCompositableClient();
if (!mExternalImageId) {
mExternalImageId = WRBridge()->AllocExternalImageIdForCompositable(mCanvasClient);
mExternalImageId = WrBridge()->AllocExternalImageIdForCompositable(mCanvasClient);
}
MOZ_ASSERT(mExternalImageId);
@ -77,10 +77,10 @@ WebRenderCanvasLayer::RenderLayer()
Maybe<WrImageMask> mask = buildMaskLayer();
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));
WRBridge()->AddWebRenderCommand(OpDPPushExternalImageId(LayerIntRegion(), wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), filter, mExternalImageId));
WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
WrBridge()->AddWebRenderCommand(OpDPPushExternalImageId(LayerIntRegion(), wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), filter, mExternalImageId));
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());
}

Просмотреть файл

@ -31,7 +31,7 @@ public:
virtual CompositableForwarder* GetForwarder() override
{
return Manager()->WRBridge();
return Manager()->WrBridge();
}
virtual void AttachCompositable() override;

Просмотреть файл

@ -15,7 +15,7 @@ namespace layers {
void
WebRenderColorLayer::RenderLayer()
{
WRScrollFrameStackingContextGenerator scrollFrames(this);
WrScrollFrameStackingContextGenerator scrollFrames(this);
LayerIntRegion visibleRegion = GetVisibleRegion();
LayerIntRect bounds = visibleRegion.GetBounds();
@ -35,13 +35,13 @@ WebRenderColorLayer::RenderLayer()
Maybe<WrImageMask> mask = buildMaskLayer();
WRBridge()->AddWebRenderCommand(
WrBridge()->AddWebRenderCommand(
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));
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

Просмотреть файл

@ -15,7 +15,7 @@ namespace layers {
void
WebRenderContainerLayer::RenderLayer()
{
WRScrollFrameStackingContextGenerator scrollFrames(this);
WrScrollFrameStackingContextGenerator scrollFrames(this);
nsTArray<LayerPolygon> children = SortChildrenBy3DZOrder(SortMode::WITHOUT_GEOMETRY);
@ -26,7 +26,7 @@ WebRenderContainerLayer::RenderLayer()
Maybe<WrImageMask> mask = buildMaskLayer();
WRBridge()->AddWebRenderCommand(
WrBridge()->AddWebRenderCommand(
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
for (LayerPolygon& child : children) {
if (child.layer->IsBackfaceHidden()) {
@ -34,19 +34,19 @@ WebRenderContainerLayer::RenderLayer()
}
ToWebRenderLayer(child.layer)->RenderLayer();
}
WRBridge()->AddWebRenderCommand(
WrBridge()->AddWebRenderCommand(
OpDPPopStackingContext());
}
void
WebRenderRefLayer::RenderLayer()
{
WRScrollFrameStackingContextGenerator scrollFrames(this);
WrScrollFrameStackingContextGenerator scrollFrames(this);
gfx::Rect relBounds = TransformedVisibleBoundsRelativeToParent();
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());
WRBridge()->AddWebRenderCommand(OpDPPushIframe(wr::ToWrRect(relBounds), wr::ToWrRect(relBounds), mId));
WrBridge()->AddWebRenderCommand(OpDPPushIframe(wr::ToWrRect(relBounds), wr::ToWrRect(relBounds), mId));
}
} // namespace layers

Просмотреть файл

@ -28,7 +28,7 @@ WebRenderImageLayer::~WebRenderImageLayer()
{
MOZ_COUNT_DTOR(WebRenderImageLayer);
if (mExternalImageId) {
WRBridge()->DeallocExternalImageId(mExternalImageId);
WrBridge()->DeallocExternalImageId(mExternalImageId);
}
}
@ -72,7 +72,7 @@ WebRenderImageLayer::RenderLayer()
if (!mImageClient) {
mImageClient = ImageClient::CreateImageClient(CompositableType::IMAGE,
WRBridge(),
WrBridge(),
TextureFlags::DEFAULT);
if (!mImageClient) {
return;
@ -84,12 +84,12 @@ WebRenderImageLayer::RenderLayer()
// XXX update async ImageContainer rendering path
//if (mContainer->IsAsync() && !mImageId) {
// mExternalImageId = WRBridge()->AllocExternalImageId(mContainer->GetAsyncContainerID());
// mExternalImageId = WrBridge()->AllocExternalImageId(mContainer->GetAsyncContainerID());
// MOZ_ASSERT(mImageId);
//}
if (!mExternalImageId) {
mExternalImageId = WRBridge()->AllocExternalImageIdForCompositable(mImageClient);
mExternalImageId = WrBridge()->AllocExternalImageIdForCompositable(mImageClient);
MOZ_ASSERT(mExternalImageId);
}
@ -124,7 +124,7 @@ WebRenderImageLayer::RenderLayer()
return;
}
WRScrollFrameStackingContextGenerator scrollFrames(this);
WrScrollFrameStackingContextGenerator scrollFrames(this);
Rect rect(0, 0, size.width, size.height);
@ -143,10 +143,10 @@ WebRenderImageLayer::RenderLayer()
Maybe<WrImageMask> mask = buildMaskLayer();
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));
WRBridge()->AddWebRenderCommand(OpDPPushExternalImageId(LayerIntRegion(), wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), filter, mExternalImageId));
WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
WrBridge()->AddWebRenderCommand(OpDPPushExternalImageId(LayerIntRegion(), wr::ToWrRect(rect), wr::ToWrRect(clip), Nothing(), filter, mExternalImageId));
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());

Просмотреть файл

@ -31,15 +31,15 @@ using namespace gfx;
namespace layers {
WebRenderLayerManager*
WebRenderLayer::WRManager()
WebRenderLayer::WrManager()
{
return static_cast<WebRenderLayerManager*>(GetLayer()->Manager());
}
WebRenderBridgeChild*
WebRenderLayer::WRBridge()
WebRenderLayer::WrBridge()
{
return WRManager()->WRBridge();
return WrManager()->WrBridge();
}
Rect
@ -115,12 +115,12 @@ WebRenderLayer::buildMaskLayer() {
MOZ_RELEASE_ASSERT(surface->GetFormat() == SurfaceFormat::A8, "bad format");
wr::ByteBuffer buf(size.height * map.GetStride(), map.GetData());
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.rect = wr::ToWrRect(Rect(0, 0, size.width, size.height));
imageMask.repeat = false;
WRManager()->AddImageKeyForDiscard(maskKey);
WrManager()->AddImageKeyForDiscard(maskKey);
mask = Some(imageMask);
}
}
@ -131,7 +131,7 @@ WebRenderLayer::buildMaskLayer() {
WRScrollFrameStackingContextGenerator::WRScrollFrameStackingContextGenerator(
WrScrollFrameStackingContextGenerator::WrScrollFrameStackingContextGenerator(
WebRenderLayer* aLayer)
: mLayer(aLayer)
{
@ -157,12 +157,12 @@ WRScrollFrameStackingContextGenerator::WRScrollFrameStackingContextGenerator(
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()));
}
}
WRScrollFrameStackingContextGenerator::~WRScrollFrameStackingContextGenerator()
WrScrollFrameStackingContextGenerator::~WrScrollFrameStackingContextGenerator()
{
Layer* layer = mLayer->GetLayer();
for (size_t i = 0; i < layer->GetScrollMetadataCount(); i++) {
@ -171,7 +171,7 @@ WRScrollFrameStackingContextGenerator::~WRScrollFrameStackingContextGenerator()
continue;
}
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*
WebRenderLayerManager::AsKnowsCompositor()
{
return mWRChild;
return mWrChild;
}
void
@ -195,17 +195,17 @@ WebRenderLayerManager::Initialize(PCompositorBridgeChild* aCBChild,
uint64_t aLayersId,
TextureFactoryIdentifier* aTextureFactoryIdentifier)
{
MOZ_ASSERT(mWRChild == nullptr);
MOZ_ASSERT(mWrChild == nullptr);
MOZ_ASSERT(aTextureFactoryIdentifier);
TextureFactoryIdentifier textureFactoryIdentifier;
PWebRenderBridgeChild* bridge = aCBChild->SendPWebRenderBridgeConstructor(aLayersId,
&textureFactoryIdentifier);
MOZ_ASSERT(bridge);
mWRChild = static_cast<WebRenderBridgeChild*>(bridge);
mWrChild = static_cast<WebRenderBridgeChild*>(bridge);
LayoutDeviceIntSize size = mWidget->GetClientSize();
WRBridge()->SendCreate(size.width, size.height);
WRBridge()->IdentifyTextureHost(textureFactoryIdentifier);
WrBridge()->SendCreate(size.width, size.height);
WrBridge()->IdentifyTextureHost(textureFactoryIdentifier);
*aTextureFactoryIdentifier = textureFactoryIdentifier;
}
@ -218,7 +218,7 @@ WebRenderLayerManager::Destroy()
LayerManager::Destroy();
DiscardImages();
WRBridge()->Destroy();
WrBridge()->Destroy();
if (mTransactionIdAllocator) {
// Make sure to notify the refresh driver just in case it's waiting on a
@ -249,7 +249,7 @@ WebRenderLayerManager::GetCompositorBridgeChild()
int32_t
WebRenderLayerManager::GetMaxTextureSize() const
{
return WRBridge()->GetMaxTextureSize();
return WrBridge()->GetMaxTextureSize();
}
bool
@ -289,7 +289,7 @@ WebRenderLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
mAnimationReadyTime = TimeStamp::Now();
LayoutDeviceIntSize size = mWidget->GetClientSize();
if (!WRBridge()->DPBegin(size.width, size.height)) {
if (!WrBridge()->DPBegin(size.width, size.height)) {
return;
}
@ -298,7 +298,7 @@ WebRenderLayerManager::EndTransaction(DrawPaintedLayerCallback aCallback,
bool sync = mTarget != nullptr;
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId();
WRBridge()->DPEnd(sync, mLatestTransactionId);
WrBridge()->DPEnd(sync, mLatestTransactionId);
MakeSnapshotIfRequired(size);
@ -319,7 +319,7 @@ WebRenderLayerManager::MakeSnapshotIfRequired(LayoutDeviceIntSize aSize)
// TODO: fixup for proper surface format.
RefPtr<TextureClient> texture =
TextureClient::CreateForRawBufferAccess(WRBridge(),
TextureClient::CreateForRawBufferAccess(WrBridge(),
SurfaceFormat::B8G8R8A8,
aSize.ToUnknownSize(),
BackendType::SKIA,
@ -328,13 +328,13 @@ WebRenderLayerManager::MakeSnapshotIfRequired(LayoutDeviceIntSize aSize)
return;
}
texture->InitIPDLActor(WRBridge());
texture->InitIPDLActor(WrBridge());
if (!texture->GetIPDLActor()) {
return;
}
IntRect bounds = ToOutsideIntRect(mTarget->GetClipExtents());
if (!WRBridge()->SendDPGetSnapshot(texture->GetIPDLActor())) {
if (!WrBridge()->SendDPGetSnapshot(texture->GetIPDLActor())) {
return;
}
@ -379,7 +379,7 @@ void
WebRenderLayerManager::DiscardImages()
{
for (auto key : mImageKeys) {
WRBridge()->SendDeleteImage(key);
WrBridge()->SendDeleteImage(key);
}
mImageKeys.clear();
}
@ -393,7 +393,7 @@ WebRenderLayerManager::Hold(Layer* aLayer)
void
WebRenderLayerManager::SetLayerObserverEpoch(uint64_t aLayerObserverEpoch)
{
WRBridge()->SendSetLayerObserverEpoch(aLayerObserverEpoch);
WrBridge()->SendSetLayerObserverEpoch(aLayerObserverEpoch);
}
void
@ -436,7 +436,7 @@ WebRenderLayerManager::ClearLayer(Layer* aLayer)
void
WebRenderLayerManager::ClearCachedResources(Layer* aSubtree)
{
WRBridge()->SendClearCachedResources();
WrBridge()->SendClearCachedResources();
if (aSubtree) {
ClearLayer(aSubtree);
} else if (mRoot) {
@ -447,13 +447,13 @@ WebRenderLayerManager::ClearCachedResources(Layer* aSubtree)
void
WebRenderLayerManager::UpdateTextureFactoryIdentifier(const TextureFactoryIdentifier& aNewIdentifier)
{
WRBridge()->IdentifyTextureHost(aNewIdentifier);
WrBridge()->IdentifyTextureHost(aNewIdentifier);
}
TextureFactoryIdentifier
WebRenderLayerManager::GetTextureFactoryIdentifier()
{
return WRBridge()->GetTextureFactoryIdentifier();
return WrBridge()->GetTextureFactoryIdentifier();
}
void

Просмотреть файл

@ -37,8 +37,8 @@ public:
return static_cast<WebRenderLayer*>(aLayer->ImplData());
}
WebRenderLayerManager* WRManager();
WebRenderBridgeChild* WRBridge();
WebRenderLayerManager* WrManager();
WebRenderBridgeChild* WrBridge();
gfx::Rect RelativeToVisible(gfx::Rect aRect);
gfx::Rect RelativeToTransformedVisible(gfx::Rect aRect);
@ -50,11 +50,11 @@ protected:
};
class MOZ_RAII WRScrollFrameStackingContextGenerator
class MOZ_RAII WrScrollFrameStackingContextGenerator
{
public:
explicit WRScrollFrameStackingContextGenerator(WebRenderLayer* aLayer);
~WRScrollFrameStackingContextGenerator();
explicit WrScrollFrameStackingContextGenerator(WebRenderLayer* aLayer);
~WrScrollFrameStackingContextGenerator();
private:
WebRenderLayer* mLayer;
};
@ -131,7 +131,7 @@ public:
void AddImageKeyForDiscard(WrImageKey);
void DiscardImages();
WebRenderBridgeChild* WRBridge() const { return mWRChild; }
WebRenderBridgeChild* WrBridge() const { return mWrChild; }
void Hold(Layer* aLayer);
@ -153,7 +153,7 @@ private:
DrawPaintedLayerCallback mPaintedLayerCallback;
void *mPaintedLayerCallbackData;
RefPtr<WebRenderBridgeChild> mWRChild;
RefPtr<WebRenderBridgeChild> mWrChild;
RefPtr<TransactionIdAllocator> mTransactionIdAllocator;
uint64_t mLatestTransactionId;

Просмотреть файл

@ -86,7 +86,7 @@ void
WebRenderPaintedLayer::RenderLayerWithReadback(ReadbackProcessor *aReadback)
{
if (!mContentClient) {
mContentClient = ContentClient::CreateContentClient(Manager()->WRBridge());
mContentClient = ContentClient::CreateContentClient(Manager()->WrBridge());
if (!mContentClient) {
return;
}
@ -112,7 +112,7 @@ WebRenderPaintedLayer::RenderLayer()
RenderLayerWithReadback(nullptr);
if (!mExternalImageId) {
mExternalImageId = WRBridge()->AllocExternalImageIdForCompositable(mContentClient);
mExternalImageId = WrBridge()->AllocExternalImageIdForCompositable(mContentClient);
MOZ_ASSERT(mExternalImageId);
}
@ -123,7 +123,7 @@ WebRenderPaintedLayer::RenderLayer()
return;
}
WRScrollFrameStackingContextGenerator scrollFrames(this);
WrScrollFrameStackingContextGenerator scrollFrames(this);
// 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
@ -145,15 +145,15 @@ WebRenderPaintedLayer::RenderLayer()
Rect overflow(0, 0, relBounds.width, relBounds.height);
Matrix4x4 transform;// = GetTransform();
WRBridge()->AddWebRenderCommand(
WrBridge()->AddWebRenderCommand(
OpDPPushStackingContext(wr::ToWrRect(relBounds), wr::ToWrRect(overflow), mask, transform, FrameMetrics::NULL_SCROLL_ID));
ContentClientRemoteBuffer* contentClientRemote = static_cast<ContentClientRemoteBuffer*>(mContentClient.get());
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());
WRBridge()->AddWebRenderCommand(OpDPPopStackingContext());
WrBridge()->AddWebRenderCommand(OpDPPopStackingContext());
}
} // namespace layers

Просмотреть файл

@ -33,7 +33,7 @@ protected:
{
MOZ_COUNT_DTOR(WebRenderPaintedLayer);
if (mExternalImageId) {
WRBridge()->DeallocExternalImageId(mExternalImageId);
WrBridge()->DeallocExternalImageId(mExternalImageId);
}
}
WebRenderLayerManager* Manager()

Просмотреть файл

@ -67,7 +67,7 @@ WebRenderTextLayer::RenderLayer()
}
}
WRBridge()->AddWebRenderCommand(OpDPPushText(
WrBridge()->AddWebRenderCommand(OpDPPushText(
wr::ToWrRect(rect),
wr::ToWrRect(clip),
wr_glyphs,

Просмотреть файл

@ -178,7 +178,7 @@ struct WrExternalImageIdHandler {
ReleaseExternalImageCallback release_func;
};
struct wrwindowstate;
struct WrWindowState;
#ifdef MOZ_ENABLE_WEBRENDER
# define WR_INLINE
@ -218,7 +218,7 @@ wr_window_new(WrWindowId window_id,
WrRenderer** out_renderer) WR_FUNC;
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_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_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_api_add_raw_font(WrAPI* api, uint8_t* font_buffer, size_t buffer_size) WR_FUNC;
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,
void* webrender_bridge_ptr,
bool enable_profiler,
@ -268,33 +268,33 @@ WR_INLINE void
wr_state_delete(WrState* state) WR_FUNC;
WR_INLINE void
wr_destroy(wrwindowstate* wrWindow, WrState* WrState)
wr_destroy(WrWindowState* wrWindow, WrState* WrState)
WR_FUNC;
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)
WR_FUNC;
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)
WR_FUNC;
//TODO(Jerry): handle shmem in WR
//// 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)
//// WR_FUNC;
WR_INLINE void
wr_update_image(wrwindowstate* wrWindow, WrImageKey key,
wr_update_image(WrWindowState* wrWindow, WrImageKey key,
uint32_t width, uint32_t height,
WrImageFormat format, uint8_t *bytes, size_t size)
WR_FUNC;
WR_INLINE void
wr_delete_image(wrwindowstate* wrWindow, WrImageKey key)
wr_delete_image(WrWindowState* wrWindow, WrImageKey key)
WR_FUNC;
WR_INLINE void
@ -313,18 +313,18 @@ wr_dp_begin(WrState* wrState, uint32_t width, uint32_t height)
WR_FUNC;
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_INLINE void
wr_window_dp_end(wrwindowstate* wrWindow, WrState* wrState)
wr_window_dp_end(WrWindowState* wrWindow, WrState* wrState)
WR_FUNC;
WR_INLINE void
wr_dp_end(WrState* builder, WrAPI* api, uint32_t epoch) WR_FUNC;
WR_INLINE void
wr_composite_window(wrwindowstate* wrWindow)
wr_composite_window(WrWindowState* wrWindow)
WR_FUNC;
WR_INLINE void
@ -354,7 +354,7 @@ WR_FUNC;
// TODO: Remove.
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)
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
// and also free it at the proper time.
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)
WR_FUNC;
// TODO: Remove.
WR_INLINE void
wr_profiler_set_enabled(wrwindowstate* wrWindow, bool enabled)
wr_profiler_set_enabled(WrWindowState* wrWindow, bool enabled)
WR_FUNC;
#undef WR_FUNC