зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 3f41992ab77e (bug 1446309) because wrong bug number. r=backout
This commit is contained in:
Родитель
cf006cd593
Коммит
b30de56ba9
|
@ -30,39 +30,20 @@ public:
|
||||||
|
|
||||||
ImageKeyData(ImageKeyData&& aOther)
|
ImageKeyData(ImageKeyData&& aOther)
|
||||||
: mManager(std::move(aOther.mManager))
|
: mManager(std::move(aOther.mManager))
|
||||||
, mDirtyRect(std::move(aOther.mDirtyRect))
|
|
||||||
, mImageKey(aOther.mImageKey)
|
, mImageKey(aOther.mImageKey)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
ImageKeyData& operator=(ImageKeyData&& aOther)
|
ImageKeyData& operator=(ImageKeyData&& aOther)
|
||||||
{
|
{
|
||||||
mManager = std::move(aOther.mManager);
|
mManager = std::move(aOther.mManager);
|
||||||
mDirtyRect = std::move(aOther.mDirtyRect);
|
|
||||||
mImageKey = aOther.mImageKey;
|
mImageKey = aOther.mImageKey;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MergeDirtyRect(const Maybe<IntRect>& aDirtyRect)
|
|
||||||
{
|
|
||||||
if (mDirtyRect) {
|
|
||||||
if (aDirtyRect) {
|
|
||||||
mDirtyRect->UnionRect(mDirtyRect.ref(), aDirtyRect.ref());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mDirtyRect = aDirtyRect;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Maybe<IntRect> TakeDirtyRect()
|
|
||||||
{
|
|
||||||
return std::move(mDirtyRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImageKeyData(const ImageKeyData&) = delete;
|
ImageKeyData(const ImageKeyData&) = delete;
|
||||||
ImageKeyData& operator=(const ImageKeyData&) = delete;
|
ImageKeyData& operator=(const ImageKeyData&) = delete;
|
||||||
|
|
||||||
RefPtr<WebRenderLayerManager> mManager;
|
RefPtr<WebRenderLayerManager> mManager;
|
||||||
Maybe<IntRect> mDirtyRect;
|
|
||||||
wr::ImageKey mImageKey;
|
wr::ImageKey mImageKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -162,23 +143,14 @@ public:
|
||||||
bool ownsKey = wrBridge->GetNamespace() == entry.mImageKey.mNamespace;
|
bool ownsKey = wrBridge->GetNamespace() == entry.mImageKey.mNamespace;
|
||||||
if (!ownsKey) {
|
if (!ownsKey) {
|
||||||
entry.mImageKey = wrBridge->GetNextImageKey();
|
entry.mImageKey = wrBridge->GetNextImageKey();
|
||||||
entry.TakeDirtyRect();
|
|
||||||
aResources.AddExternalImage(mId, entry.mImageKey);
|
aResources.AddExternalImage(mId, entry.mImageKey);
|
||||||
} else {
|
} else if (aDirtyRect) {
|
||||||
entry.MergeDirtyRect(aDirtyRect);
|
aResources.UpdateExternalImage(mId, entry.mImageKey,
|
||||||
Maybe<IntRect> dirtyRect = entry.TakeDirtyRect();
|
ViewAs<ImagePixel>(aDirtyRect.ref()));
|
||||||
if (dirtyRect) {
|
|
||||||
aResources.UpdateExternalImage(mId, entry.mImageKey,
|
|
||||||
ViewAs<ImagePixel>(dirtyRect.ref()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
key = entry.mImageKey;
|
key = entry.mImageKey;
|
||||||
found = true;
|
found = true;
|
||||||
} else {
|
|
||||||
// We don't have the resource update queue for this manager, so just
|
|
||||||
// accumulate the dirty rects until it is requested.
|
|
||||||
entry.MergeDirtyRect(aDirtyRect);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +316,7 @@ SharedSurfacesChild::Share(SourceSurfaceSharedData* aSurface,
|
||||||
// Each time the surface changes, the producers of SourceSurfaceSharedData
|
// Each time the surface changes, the producers of SourceSurfaceSharedData
|
||||||
// surfaces promise to increment the invalidation counter each time the
|
// surfaces promise to increment the invalidation counter each time the
|
||||||
// surface has changed. We can use this counter to determine whether or not
|
// surface has changed. We can use this counter to determine whether or not
|
||||||
// we should update our paired ImageKey.
|
// we should upate our paired ImageKey.
|
||||||
Maybe<IntRect> dirtyRect = aSurface->TakeDirtyRect();
|
Maybe<IntRect> dirtyRect = aSurface->TakeDirtyRect();
|
||||||
SharedUserData* data = nullptr;
|
SharedUserData* data = nullptr;
|
||||||
nsresult rv = SharedSurfacesChild::ShareInternal(aSurface, &data);
|
nsresult rv = SharedSurfacesChild::ShareInternal(aSurface, &data);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче