зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1360717 - Make WebRenderCompositableHolder could generate WrImageKey r=nical
This commit is contained in:
Родитель
5d5cdc518c
Коммит
38717ce0a5
|
@ -1612,7 +1612,8 @@ CompositorBridgeParent::AllocPWebRenderBridgeParent(const wr::PipelineId& aPipel
|
|||
RefPtr<widget::CompositorWidget> widget = mWidget;
|
||||
RefPtr<wr::WebRenderAPI> api = wr::WebRenderAPI::Create(
|
||||
gfxPrefs::WebRenderProfilerEnabled(), this, Move(widget), aSize);
|
||||
RefPtr<WebRenderCompositableHolder> holder = new WebRenderCompositableHolder();
|
||||
RefPtr<WebRenderCompositableHolder> holder =
|
||||
new WebRenderCompositableHolder(WebRenderBridgeParent::AllocIdNameSpace());
|
||||
MOZ_ASSERT(api); // TODO have a fallback
|
||||
api->SetRootPipeline(aPipelineId);
|
||||
mWrBridge = new WebRenderBridgeParent(this, aPipelineId, mWidget, nullptr, Move(api), Move(holder));
|
||||
|
|
|
@ -119,7 +119,7 @@ WebRenderBridgeParent::WebRenderBridgeParent(CompositorBridgeParentBase* aCompos
|
|||
, mChildLayerObserverEpoch(0)
|
||||
, mParentLayerObserverEpoch(0)
|
||||
, mWrEpoch(0)
|
||||
, mIdNameSpace(++sIdNameSpace)
|
||||
, mIdNameSpace(AllocIdNameSpace())
|
||||
, mPaused(false)
|
||||
, mDestroyed(false)
|
||||
{
|
||||
|
|
|
@ -165,6 +165,10 @@ public:
|
|||
void UpdateAPZ();
|
||||
const WebRenderScrollData& GetScrollData() const;
|
||||
|
||||
static uint32_t AllocIdNameSpace() {
|
||||
return ++sIdNameSpace;
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~WebRenderBridgeParent();
|
||||
|
||||
|
|
|
@ -15,7 +15,9 @@ using namespace gfx;
|
|||
|
||||
namespace layers {
|
||||
|
||||
WebRenderCompositableHolder::WebRenderCompositableHolder()
|
||||
WebRenderCompositableHolder::WebRenderCompositableHolder(uint32_t aIdNamespace)
|
||||
: mIdNamespace(aIdNamespace)
|
||||
, mResourceId(0)
|
||||
{
|
||||
MOZ_COUNT_CTOR(WebRenderCompositableHolder);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class WebRenderCompositableHolder final
|
|||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebRenderCompositableHolder)
|
||||
|
||||
explicit WebRenderCompositableHolder();
|
||||
explicit WebRenderCompositableHolder(uint32_t aIdNamespace);
|
||||
|
||||
protected:
|
||||
~WebRenderCompositableHolder();
|
||||
|
@ -59,6 +59,16 @@ public:
|
|||
return mCompositeUntilTime;
|
||||
}
|
||||
|
||||
uint32_t GetNextResourceId() { return ++mResourceId; }
|
||||
uint32_t GetNamespace() { return mIdNamespace; }
|
||||
WrImageKey GetImageKey()
|
||||
{
|
||||
WrImageKey key;
|
||||
key.mNamespace = GetNamespace();
|
||||
key.mHandle = GetNextResourceId();
|
||||
return key;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
struct ForwardingTextureHost {
|
||||
|
@ -75,6 +85,8 @@ private:
|
|||
std::queue<ForwardingTextureHost> mTextureHosts;
|
||||
};
|
||||
|
||||
uint32_t mIdNamespace;
|
||||
uint32_t mResourceId;
|
||||
nsClassHashtable<nsUint64HashKey, PipelineTexturesHolder> mPipelineTexturesHolders;
|
||||
|
||||
// Render time for the current composition.
|
||||
|
|
Загрузка…
Ссылка в новой задаче