Bug 1711061 - Part 7. Remove support for ImageContainer-based SVG image blob recordings. r=tnikkel

This will be replaced by a WebRenderImageProvider-based implementation
in a later part in this series.

Differential Revision: https://phabricator.services.mozilla.com/D126600
This commit is contained in:
Andrew Osmond 2021-10-26 13:28:25 +00:00
Родитель 836ad9882e
Коммит ca9bcdf869
3 изменённых файлов: 6 добавлений и 50 удалений

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

@ -8,7 +8,6 @@
#include "SharedSurfacesParent.h"
#include "CompositorManagerChild.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/image/SourceSurfaceBlobImage.h"
#include "mozilla/layers/IpcResourceUpdateQueue.h"
#include "mozilla/layers/SourceSurfaceSharedData.h"
#include "mozilla/layers/WebRenderBridgeChild.h"
@ -395,17 +394,7 @@ nsresult SharedSurfacesChild::ShareBlob(ImageContainer* aContainer,
return NS_ERROR_NOT_IMPLEMENTED;
}
auto* blobSurface =
static_cast<image::SourceSurfaceBlobImage*>(surface.get());
Maybe<wr::BlobImageKey> key =
blobSurface->UpdateKey(aManager->LayerManager(), aResources);
if (!key) {
return NS_ERROR_FAILURE;
}
aKey = key.value();
return NS_OK;
return NS_ERROR_FAILURE;
}
/* static */

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

@ -20,7 +20,6 @@
#include "mozilla/TimeStamp.h"
#include "mozilla/Tuple.h" // for Tie
#include "mozilla/layers/SharedSurfacesChild.h"
#include "SourceSurfaceBlobImage.h"
namespace mozilla {
namespace image {
@ -175,10 +174,10 @@ ImgDrawResult ImageResource::GetImageContainerImpl(
layers::ImageContainer** aOutContainer) {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aRenderer);
MOZ_ASSERT((aFlags &
~(FLAG_SYNC_DECODE | FLAG_SYNC_DECODE_IF_FAST | FLAG_RECORD_BLOB |
FLAG_ASYNC_NOTIFY | FLAG_HIGH_QUALITY_SCALING)) == FLAG_NONE,
"Unsupported flag passed to GetImageContainer");
MOZ_ASSERT(
(aFlags & ~(FLAG_SYNC_DECODE | FLAG_SYNC_DECODE_IF_FAST |
FLAG_ASYNC_NOTIFY | FLAG_HIGH_QUALITY_SCALING)) == FLAG_NONE,
"Unsupported flag passed to GetImageContainer");
ImgDrawResult drawResult;
gfx::IntSize size;
@ -323,27 +322,6 @@ bool ImageResource::UpdateImageContainer(
ImageContainerEntry& entry = mImageContainers[i];
RefPtr<layers::ImageContainer> container(entry.mContainer);
if (container) {
// Blob recordings should just be marked as dirty. We will regenerate the
// recording when the display list update comes around.
if (entry.mFlags & FLAG_RECORD_BLOB) {
AutoTArray<layers::ImageContainer::OwningImage, 1> images;
container->GetCurrentImages(&images);
if (images.IsEmpty()) {
MOZ_ASSERT_UNREACHABLE("Empty container!");
continue;
}
RefPtr<gfx::SourceSurface> surface =
images[0].mImage->GetAsSourceSurface();
if (!surface || surface->GetType() != gfx::SurfaceType::BLOB_IMAGE) {
MOZ_ASSERT_UNREACHABLE("No/wrong surface in container!");
continue;
}
static_cast<SourceSurfaceBlobImage*>(surface.get())->MarkDirty();
continue;
}
gfx::IntSize bestSize;
RefPtr<gfx::SourceSurface> surface;
Tie(entry.mLastDrawResult, bestSize, surface) =

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

@ -37,7 +37,6 @@
#include "ISurfaceProvider.h"
#include "LookupResult.h"
#include "Orientation.h"
#include "SourceSurfaceBlobImage.h"
#include "SVGDocumentWrapper.h"
#include "SVGDrawingCallback.h"
#include "SVGDrawingParameters.h"
@ -46,6 +45,7 @@
#include "mozilla/dom/Document.h"
#include "mozilla/dom/DocumentInlines.h"
#include "mozilla/image/Resolution.h"
#include "WindowRenderer.h"
namespace mozilla {
@ -758,17 +758,6 @@ VectorImage::GetFrameInternal(const IntSize& aSize,
SamplingFilter::POINT, aSVGContext, animTime,
aFlags, 1.0);
// Blob recorded vector images just create a simple surface responsible for
// generating blob keys and recording bindings. The recording won't happen
// until the caller requests the key after GetImageContainerAtSize.
if (aFlags & FLAG_RECORD_BLOB) {
RefPtr<SourceSurface> surface =
new SourceSurfaceBlobImage(mSVGDocumentWrapper, aSVGContext, aRegion,
decodeSize, whichFrame, aFlags);
return MakeTuple(ImgDrawResult::SUCCESS, decodeSize, std::move(surface));
}
bool didCache; // Was the surface put into the cache?
bool contextPaint = aSVGContext && aSVGContext->GetContextPaint();