Bug 1728925 - Convert IsImageContainerAvailable to use WindowRenderer. r=aosmond

Differential Revision: https://phabricator.services.mozilla.com/D124427
This commit is contained in:
Matt Woodrow 2021-09-05 22:36:45 +00:00
Родитель 700f26a934
Коммит 5fa3be57b1
16 изменённых файлов: 25 добавлений и 34 удалений

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

@ -25,7 +25,6 @@ namespace mozilla {
using namespace gfx;
using layers::ImageContainer;
using layers::LayerManager;
using std::make_pair;
using std::max;
using std::modf;
@ -290,10 +289,10 @@ std::pair<ImgDrawResult, RefPtr<SourceSurface>> ClippedImage::GetFrameInternal(
}
NS_IMETHODIMP_(bool)
ClippedImage::IsImageContainerAvailable(LayerManager* aManager,
ClippedImage::IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) {
if (!ShouldClip()) {
return InnerImage()->IsImageContainerAvailable(aManager, aFlags);
return InnerImage()->IsImageContainerAvailable(aRenderer, aFlags);
}
return false;
}

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

@ -43,7 +43,7 @@ class ClippedImage : public ImageWrapper {
GetFrameAtSize(const gfx::IntSize& aSize, uint32_t aWhichFrame,
uint32_t aFlags) override;
NS_IMETHOD_(bool)
IsImageContainerAvailable(layers::LayerManager* aManager,
IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) override;
NS_IMETHOD_(ImgDrawResult)
GetImageContainerAtSize(WindowRenderer* aRenderer, const gfx::IntSize& aSize,

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

@ -20,7 +20,6 @@
using namespace mozilla;
using namespace mozilla::gfx;
using mozilla::layers::ImageContainer;
using mozilla::layers::LayerManager;
namespace mozilla {
namespace image {
@ -165,7 +164,7 @@ NS_IMETHODIMP_(bool)
DynamicImage::WillDrawOpaqueNow() { return false; }
NS_IMETHODIMP_(bool)
DynamicImage::IsImageContainerAvailable(LayerManager* aManager,
DynamicImage::IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) {
return false;
}

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

@ -9,7 +9,6 @@ namespace mozilla {
using namespace gfx;
using layers::ImageContainer;
using layers::LayerManager;
namespace image {
@ -52,10 +51,10 @@ bool FrozenImage::IsNonAnimated() const {
}
NS_IMETHODIMP_(bool)
FrozenImage::IsImageContainerAvailable(LayerManager* aManager,
FrozenImage::IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) {
if (IsNonAnimated()) {
return InnerImage()->IsImageContainerAvailable(aManager, aFlags);
return InnerImage()->IsImageContainerAvailable(aRenderer, aFlags);
}
return false;
}

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

@ -42,7 +42,7 @@ class FrozenImage : public ImageWrapper {
GetFrameAtSize(const gfx::IntSize& aSize, uint32_t aWhichFrame,
uint32_t aFlags) override;
NS_IMETHOD_(bool)
IsImageContainerAvailable(layers::LayerManager* aManager,
IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) override;
NS_IMETHOD_(ImgDrawResult)
GetImageContainerAtSize(WindowRenderer* aRenderer, const gfx::IntSize& aSize,

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

@ -18,7 +18,6 @@ using gfx::IntSize;
using gfx::SamplingFilter;
using gfx::SourceSurface;
using layers::ImageContainer;
using layers::LayerManager;
namespace image {
@ -166,9 +165,9 @@ NS_IMETHODIMP_(bool)
ImageWrapper::WillDrawOpaqueNow() { return mInnerImage->WillDrawOpaqueNow(); }
NS_IMETHODIMP_(bool)
ImageWrapper::IsImageContainerAvailable(LayerManager* aManager,
ImageWrapper::IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) {
return mInnerImage->IsImageContainerAvailable(aManager, aFlags);
return mInnerImage->IsImageContainerAvailable(aRenderer, aFlags);
}
NS_IMETHODIMP_(ImgDrawResult)

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

@ -21,7 +21,6 @@ namespace mozilla {
using namespace gfx;
using layers::ImageContainer;
using layers::LayerManager;
namespace image {
@ -148,10 +147,10 @@ OrientedImage::GetFrameAtSize(const IntSize& aSize, uint32_t aWhichFrame,
}
NS_IMETHODIMP_(bool)
OrientedImage::IsImageContainerAvailable(LayerManager* aManager,
OrientedImage::IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) {
if (mOrientation.IsIdentity()) {
return InnerImage()->IsImageContainerAvailable(aManager, aFlags);
return InnerImage()->IsImageContainerAvailable(aRenderer, aFlags);
}
return false;
}

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

@ -38,7 +38,7 @@ class OrientedImage : public ImageWrapper {
GetFrameAtSize(const gfx::IntSize& aSize, uint32_t aWhichFrame,
uint32_t aFlags) override;
NS_IMETHOD_(bool)
IsImageContainerAvailable(layers::LayerManager* aManager,
IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) override;
NS_IMETHOD_(ImgDrawResult)
GetImageContainerAtSize(WindowRenderer* aRenderer, const gfx::IntSize& aSize,

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

@ -645,7 +645,7 @@ Tuple<ImgDrawResult, IntSize> RasterImage::GetImageContainerSize(
}
NS_IMETHODIMP_(bool)
RasterImage::IsImageContainerAvailable(LayerManager* aManager,
RasterImage::IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) {
return LoadHasSize();
}

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

@ -19,7 +19,6 @@
#include "mozilla/dom/SVGDocument.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/layers/LayerManager.h"
#include "mozilla/PendingAnimationTracker.h"
#include "mozilla/PresShell.h"
#include "mozilla/ProfilerLabels.h"
@ -809,10 +808,10 @@ Tuple<ImgDrawResult, IntSize> VectorImage::GetImageContainerSize(
}
NS_IMETHODIMP_(bool)
VectorImage::IsImageContainerAvailable(LayerManager* aManager,
VectorImage::IsImageContainerAvailable(WindowRenderer* aRenderer,
uint32_t aFlags) {
if (mError || !mIsFullyLoaded ||
aManager->GetBackendType() != LayersBackend::LAYERS_WR) {
aRenderer->GetBackendType() != LayersBackend::LAYERS_WR) {
return false;
}

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

@ -31,7 +31,6 @@ class SourceSurface;
class WindowRenderer;
namespace layers {
class LayerManager;
class ImageContainer;
}
}
@ -72,7 +71,6 @@ native nsSize(nsSize);
native TempRefImageContainer(already_AddRefed<mozilla::layers::ImageContainer>);
[ptr] native ImageContainer(mozilla::layers::ImageContainer);
[ref] native ImageRegion(mozilla::image::ImageRegion);
[ptr] native LayerManager(mozilla::layers::LayerManager);
[ptr] native WindowRenderer(mozilla::WindowRenderer);
native Orientation(mozilla::image::Orientation);
native ImageResolution(mozilla::image::Resolution);
@ -319,10 +317,10 @@ interface imgIContainer : nsISupports
/**
* @return true if getImageContainer() is expected to return a valid
* ImageContainer when passed the given @Manager and @Flags
* ImageContainer when passed the given @Renderer and @Flags
* parameters.
*/
[noscript, notxpcom] boolean isImageContainerAvailable(in LayerManager aManager,
[noscript, notxpcom] boolean isImageContainerAvailable(in WindowRenderer aRenderer,
in uint32_t aFlags);
/**

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

@ -1809,7 +1809,7 @@ ImgDrawResult nsCSSRendering::PaintStyleImageLayer(const PaintBGParams& aParams,
}
bool nsCSSRendering::CanBuildWebRenderDisplayItemsForStyleImageLayer(
LayerManager* aManager, nsPresContext& aPresCtx, nsIFrame* aFrame,
WebRenderLayerManager* aManager, nsPresContext& aPresCtx, nsIFrame* aFrame,
const nsStyleBackground* aBackgroundStyle, int32_t aLayer,
uint32_t aPaintFlags) {
if (!aBackgroundStyle) {

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

@ -36,7 +36,7 @@ namespace layers {
class ImageContainer;
class StackingContextHelper;
class WebRenderParentCommand;
class LayerManager;
class WebRenderLayerManager;
class RenderRootStateManager;
} // namespace layers
@ -103,7 +103,7 @@ struct nsCSSRendering {
typedef mozilla::gfx::Rect Rect;
typedef mozilla::gfx::Size Size;
typedef mozilla::gfx::RectCornerRadii RectCornerRadii;
typedef mozilla::layers::LayerManager LayerManager;
typedef mozilla::layers::WebRenderLayerManager WebRenderLayerManager;
typedef mozilla::image::ImgDrawResult ImgDrawResult;
typedef nsIFrame::Sides Sides;
@ -505,9 +505,9 @@ struct nsCSSRendering {
mozilla::ComputedStyle* mBackgroundSC, const nsStyleBorder& aBorder);
static bool CanBuildWebRenderDisplayItemsForStyleImageLayer(
LayerManager* aManager, nsPresContext& aPresCtx, nsIFrame* aFrame,
const nsStyleBackground* aBackgroundStyle, int32_t aLayer,
uint32_t aPaintFlags);
WebRenderLayerManager* aManager, nsPresContext& aPresCtx,
nsIFrame* aFrame, const nsStyleBackground* aBackgroundStyle,
int32_t aLayer, uint32_t aPaintFlags);
static ImgDrawResult BuildWebRenderDisplayItemsForStyleImageLayer(
const PaintBGParams& aParams, mozilla::wr::DisplayListBuilder& aBuilder,
mozilla::wr::IpcResourceUpdateQueue& aResources,

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

@ -3615,7 +3615,7 @@ static void CheckForBorderItem(nsDisplayItem* aItem, uint32_t& aFlags) {
}
bool nsDisplayBackgroundImage::CanBuildWebRenderDisplayItems(
LayerManager* aManager, nsDisplayListBuilder* aBuilder) {
WebRenderLayerManager* aManager, nsDisplayListBuilder* aBuilder) {
if (aBuilder) {
mImageFlags = aBuilder->GetBackgroundPaintFlags();
}

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

@ -4357,7 +4357,7 @@ class nsDisplayBackgroundImage : public nsPaintedDisplayItem {
}
protected:
bool CanBuildWebRenderDisplayItems(LayerManager* aManager,
bool CanBuildWebRenderDisplayItems(layers::WebRenderLayerManager* aManager,
nsDisplayListBuilder* aBuilder);
nsRect GetBoundsInternal(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrameForBounds = nullptr);

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

@ -96,7 +96,6 @@ struct CSSSizeOrRatio {
class nsImageRenderer {
public:
typedef mozilla::image::ImgDrawResult ImgDrawResult;
typedef mozilla::layers::LayerManager LayerManager;
typedef mozilla::layers::ImageContainer ImageContainer;
enum {