Bug 1211324 (part 5) - Remove GraphicsFilter and gfxGraphicsFilter. r=mattwoodrow.

This commit is contained in:
Nicholas Nethercote 2015-10-05 17:18:10 -07:00
parent e6cc09cd51
commit 0c9936d9d3
40 changed files with 114 additions and 146 deletions

View File

@ -12,7 +12,6 @@
#include "nsIDocShell.h"
#include "nsRefreshDriver.h"
#include "mozilla/dom/HTMLCanvasElement.h"
#include "GraphicsFilter.h"
#include "mozilla/RefPtr.h"
#define NS_ICANVASRENDERINGCONTEXTINTERNAL_IID \

View File

@ -11,7 +11,6 @@
#include "nsTArray.h"
#include "gfxTypes.h"
#include "GLContextTypes.h"
#include "GraphicsFilter.h"
#include "mozilla/gfx/Rect.h"
#include "mozilla/RefPtr.h"
@ -199,7 +198,7 @@ public:
virtual bool InUpdate() const = 0;
GLenum GetWrapMode() const { return mWrapMode; }
void SetFilter(GraphicsFilter aFilter) { mFilter = aFilter; }
void SetFilter(gfx::Filter aFilter) { mFilter = aFilter; }
protected:
friend class GLContext;
@ -224,7 +223,7 @@ protected:
GLenum mWrapMode;
ContentType mContentType;
gfx::SurfaceFormat mTextureFormat;
GraphicsFilter mFilter;
gfx::Filter mFilter;
Flags mFlags;
};

View File

@ -14,7 +14,6 @@
#include <stdint.h>
#include "mozilla/gfx/Matrix.h"
#include "GraphicsFilter.h"
#include "gfxPoint.h"
#include "gfxRect.h"
#include "nsRect.h"

View File

@ -7,7 +7,6 @@
#define GFX_IMAGELAYER_H
#include "Layers.h" // for Layer, etc
#include "GraphicsFilter.h" // for GraphicsFilter
#include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/layers/LayersTypes.h"
@ -39,7 +38,7 @@ public:
* CONSTRUCTION PHASE ONLY
* Set the filter used to resample this image if necessary.
*/
void SetFilter(GraphicsFilter aFilter)
void SetFilter(gfx::Filter aFilter)
{
if (mFilter != aFilter) {
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) Filter", this));
@ -63,7 +62,7 @@ public:
ImageContainer* GetContainer() { return mContainer; }
GraphicsFilter GetFilter() { return mFilter; }
gfx::Filter GetFilter() { return mFilter; }
const gfx::IntSize& GetScaleToSize() { return mScaleToSize; }
ScaleMode GetScaleMode() { return mScaleMode; }
@ -95,7 +94,7 @@ protected:
virtual void DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent) override;
nsRefPtr<ImageContainer> mContainer;
GraphicsFilter mFilter;
gfx::Filter mFilter;
gfx::IntSize mScaleToSize;
ScaleMode mScaleMode;
bool mDisallowBigImage;

View File

@ -10,7 +10,6 @@
#include "ImageLayers.h" // for ImageLayer, etc
#include "Layers.h" // for Layer, ContainerLayer, etc
#include "Units.h" // for ParentLayerIntRect
#include "GraphicsFilter.h" // for GraphicsFilter
#include "gfxRect.h" // for gfxRect
#include "gfxUtils.h" // for gfxUtils
#include "mozilla/gfx/BaseSize.h" // for BaseSize
@ -457,7 +456,7 @@ struct ImageLayerProperties : public LayerPropertiesBase
nsRefPtr<ImageContainer> mContainer;
nsRefPtr<ImageHost> mImageHost;
GraphicsFilter mFilter;
Filter mFilter;
gfx::IntSize mScaleToSize;
ScaleMode mScaleMode;
int32_t mLastProducerID;

View File

@ -2144,7 +2144,7 @@ CanvasLayer::PrintInfo(std::stringstream& aStream, const char* aPrefix)
// This help function is used to assign the correct enum value
// to the packet
static void
DumpFilter(layerscope::LayersPacket::Layer* aLayer, const GraphicsFilter& aFilter)
DumpFilter(layerscope::LayersPacket::Layer* aLayer, const Filter& aFilter)
{
using namespace layerscope;
switch (aFilter) {

View File

@ -13,7 +13,6 @@
#include "Units.h" // for LayerMargin, LayerPoint, ParentLayerIntRect
#include "gfxContext.h"
#include "gfxTypes.h"
#include "GraphicsFilter.h" // for GraphicsFilter
#include "gfxPoint.h" // for gfxPoint
#include "gfxRect.h" // for gfxRect
#include "gfx2DGlue.h"
@ -2372,7 +2371,7 @@ public:
* CONSTRUCTION PHASE ONLY
* Set the filter used to resample this image (if necessary).
*/
void SetFilter(GraphicsFilter aFilter)
void SetFilter(gfx::Filter aFilter)
{
if (mFilter != aFilter) {
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) Filter", this));
@ -2380,7 +2379,7 @@ public:
Mutated();
}
}
GraphicsFilter GetFilter() const { return mFilter; }
gfx::Filter GetFilter() const { return mFilter; }
MOZ_LAYER_DECL_NAME("CanvasLayer", TYPE_CANVAS)
@ -2427,7 +2426,7 @@ protected:
void* mPreTransCallbackData;
DidTransactionCallback mPostTransCallback;
void* mPostTransCallbackData;
GraphicsFilter mFilter;
gfx::Filter mFilter;
private:
/**

View File

@ -7,7 +7,6 @@
#define GFX_LAYERSLOGGING_H
#include "FrameMetrics.h" // for FrameMetrics, etc
#include "GraphicsFilter.h" // for GraphicsFilter
#include "mozilla/gfx/Point.h" // for IntSize, etc
#include "mozilla/gfx/Types.h" // for Filter, SurfaceFormat
#include "mozilla/layers/CompositorTypes.h" // for TextureFlags

View File

@ -6,7 +6,6 @@
#include "CanvasLayerComposite.h"
#include "composite/CompositableHost.h" // for CompositableHost
#include "gfx2DGlue.h" // for ToFilter
#include "GraphicsFilter.h" // for GraphicsFilter
#include "gfxUtils.h" // for gfxUtils, etc
#include "mozilla/gfx/Matrix.h" // for Matrix4x4
#include "mozilla/gfx/Point.h" // for Point
@ -129,7 +128,7 @@ CanvasLayerComposite::CleanupResources()
gfx::Filter
CanvasLayerComposite::GetEffectFilter()
{
GraphicsFilter filter = mFilter;
gfx::Filter filter = mFilter;
#ifdef ANDROID
// Bug 691354
// Using the LINEAR filter we get unexplained artifacts.

View File

@ -13,7 +13,6 @@
#include "Layers.h" // for WriteSnapshotToDumpFile
#include "LayerScope.h" // for LayerScope
#include "gfxCrashReporterUtils.h" // for ScopedGfxFeatureReporter
#include "GraphicsFilter.h" // for GraphicsFilter
#include "gfxPlatform.h" // for gfxPlatform
#include "gfxPrefs.h" // for gfxPrefs
#include "gfxRect.h" // for gfxRect

View File

@ -20,7 +20,6 @@
#include "LayerScope.h" // for LayerScope
#include "gfxCrashReporterUtils.h" // for ScopedGfxFeatureReporter
#include "gfxMatrix.h" // for gfxMatrix
#include "GraphicsFilter.h" // for GraphicsFilter
#include "gfxPlatform.h" // for gfxPlatform
#include "gfxPrefs.h" // for gfxPrefs
#include "gfxRect.h" // for gfxRect

View File

@ -1,14 +0,0 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef GraphicsFilter_h
#define GraphicsFilter_h
#include "mozilla/gfx/Types.h"
typedef mozilla::gfx::Filter GraphicsFilter;
#endif

View File

@ -34,7 +34,7 @@ gfxSurfaceDrawable::DrawWithSamplingRect(gfxContext* aContext,
const gfxRect& aFillRect,
const gfxRect& aSamplingRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const Filter& aFilter,
gfxFloat aOpacity)
{
if (!mSourceSurface) {
@ -60,7 +60,7 @@ bool
gfxSurfaceDrawable::Draw(gfxContext* aContext,
const gfxRect& aFillRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const Filter& aFilter,
gfxFloat aOpacity,
const gfxMatrix& aTransform)
{
@ -77,7 +77,7 @@ gfxSurfaceDrawable::DrawInternal(gfxContext* aContext,
const gfxRect& aFillRect,
const IntRect& aSamplingRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const Filter& aFilter,
gfxFloat aOpacity,
const gfxMatrix& aTransform)
{
@ -116,7 +116,7 @@ gfxCallbackDrawable::gfxCallbackDrawable(gfxDrawingCallback* aCallback,
}
already_AddRefed<gfxSurfaceDrawable>
gfxCallbackDrawable::MakeSurfaceDrawable(const GraphicsFilter aFilter)
gfxCallbackDrawable::MakeSurfaceDrawable(const Filter aFilter)
{
SurfaceFormat format =
gfxPlatform::GetPlatform()->Optimal2DFormatForContent(gfxContentType::COLOR_ALPHA);
@ -141,7 +141,7 @@ bool
gfxCallbackDrawable::Draw(gfxContext* aContext,
const gfxRect& aFillRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const Filter& aFilter,
gfxFloat aOpacity,
const gfxMatrix& aTransform)
{
@ -181,7 +181,7 @@ public:
virtual bool operator()(gfxContext* aContext,
const gfxRect& aFillRect,
const GraphicsFilter& aFilter,
const Filter& aFilter,
const gfxMatrix& aTransform = gfxMatrix())
{
return mDrawable->Draw(aContext, aFillRect, false, aFilter, 1.0,
@ -205,7 +205,7 @@ bool
gfxPatternDrawable::Draw(gfxContext* aContext,
const gfxRect& aFillRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const Filter& aFilter,
gfxFloat aOpacity,
const gfxMatrix& aTransform)
{

View File

@ -9,7 +9,6 @@
#include "nsAutoPtr.h"
#include "gfxRect.h"
#include "gfxMatrix.h"
#include "GraphicsFilter.h"
#include "mozilla/gfx/2D.h"
class gfxContext;
@ -36,14 +35,14 @@ public:
virtual bool Draw(gfxContext* aContext,
const gfxRect& aFillRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const mozilla::gfx::Filter& aFilter,
gfxFloat aOpacity = 1.0,
const gfxMatrix& aTransform = gfxMatrix()) = 0;
virtual bool DrawWithSamplingRect(gfxContext* aContext,
const gfxRect& aFillRect,
const gfxRect& aSamplingRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const mozilla::gfx::Filter& aFilter,
gfxFloat aOpacity = 1.0)
{
return false;
@ -71,14 +70,14 @@ public:
virtual bool Draw(gfxContext* aContext,
const gfxRect& aFillRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const mozilla::gfx::Filter& aFilter,
gfxFloat aOpacity = 1.0,
const gfxMatrix& aTransform = gfxMatrix());
virtual bool DrawWithSamplingRect(gfxContext* aContext,
const gfxRect& aFillRect,
const gfxRect& aSamplingRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const mozilla::gfx::Filter& aFilter,
gfxFloat aOpacity = 1.0);
protected:
@ -86,7 +85,7 @@ protected:
const gfxRect& aFillRect,
const mozilla::gfx::IntRect& aSamplingRect,
bool aRepeat,
const GraphicsFilter& aFilter,
const mozilla::gfx::Filter& aFilter,
gfxFloat aOpacity,
const gfxMatrix& aTransform = gfxMatrix());
@ -113,9 +112,9 @@ public:
* @return whether drawing was successful
*/
virtual bool operator()(gfxContext* aContext,
const gfxRect& aFillRect,
const GraphicsFilter& aFilter,
const gfxMatrix& aTransform = gfxMatrix()) = 0;
const gfxRect& aFillRect,
const mozilla::gfx::Filter& aFilter,
const gfxMatrix& aTransform = gfxMatrix()) = 0;
};
@ -129,14 +128,14 @@ public:
virtual ~gfxCallbackDrawable() {}
virtual bool Draw(gfxContext* aContext,
const gfxRect& aFillRect,
bool aRepeat,
const GraphicsFilter& aFilter,
gfxFloat aOpacity = 1.0,
const gfxMatrix& aTransform = gfxMatrix());
const gfxRect& aFillRect,
bool aRepeat,
const mozilla::gfx::Filter& aFilter,
gfxFloat aOpacity = 1.0,
const gfxMatrix& aTransform = gfxMatrix());
protected:
already_AddRefed<gfxSurfaceDrawable> MakeSurfaceDrawable(const GraphicsFilter aFilter = mozilla::gfx::Filter::LINEAR);
already_AddRefed<gfxSurfaceDrawable> MakeSurfaceDrawable(mozilla::gfx::Filter aFilter = mozilla::gfx::Filter::LINEAR);
nsRefPtr<gfxDrawingCallback> mCallback;
nsRefPtr<gfxSurfaceDrawable> mSurfaceDrawable;
@ -153,11 +152,11 @@ public:
virtual ~gfxPatternDrawable();
virtual bool Draw(gfxContext* aContext,
const gfxRect& aFillRect,
bool aRepeat,
const GraphicsFilter& aFilter,
gfxFloat aOpacity = 1.0,
const gfxMatrix& aTransform = gfxMatrix());
const gfxRect& aFillRect,
bool aRepeat,
const mozilla::gfx::Filter& aFilter,
gfxFloat aOpacity = 1.0,
const gfxMatrix& aTransform = gfxMatrix());
protected:
already_AddRefed<gfxCallbackDrawable> MakeCallbackDrawable();

View File

@ -182,7 +182,7 @@ gfxPattern::IsOpaque()
}
void
gfxPattern::SetFilter(GraphicsFilter filter)
gfxPattern::SetFilter(gfx::Filter filter)
{
if (mGfxPattern.GetPattern()->GetType() != PatternType::SURFACE) {
return;
@ -191,11 +191,11 @@ gfxPattern::SetFilter(GraphicsFilter filter)
static_cast<SurfacePattern*>(mGfxPattern.GetPattern())->mFilter = filter;
}
GraphicsFilter
Filter
gfxPattern::Filter() const
{
if (mGfxPattern.GetPattern()->GetType() != PatternType::SURFACE) {
return Filter::GOOD;
return gfx::Filter::GOOD;
}
return static_cast<const SurfacePattern*>(mGfxPattern.GetPattern())->mFilter;
}

View File

@ -12,7 +12,6 @@
#include "mozilla/Alignment.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/PatternHelpers.h"
#include "GraphicsFilter.h"
#include "nsISupportsImpl.h"
#include "nsAutoPtr.h"
#include "nsTArray.h"
@ -58,8 +57,8 @@ public:
int CairoStatus();
void SetFilter(GraphicsFilter filter);
GraphicsFilter Filter() const;
void SetFilter(mozilla::gfx::Filter filter);
mozilla::gfx::Filter Filter() const;
/* returns TRUE if it succeeded */
bool GetSolidColor(mozilla::gfx::Color& aColorOut);

View File

@ -542,9 +542,9 @@ DeviceToImageTransform(gfxContext* aContext)
/* These heuristics are based on Source/WebCore/platform/graphics/skia/ImageSkia.cpp:computeResamplingMode() */
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
static GraphicsFilter ReduceResamplingFilter(GraphicsFilter aFilter,
int aImgWidth, int aImgHeight,
float aSourceWidth, float aSourceHeight)
static Filter ReduceResamplingFilter(Filter aFilter,
int aImgWidth, int aImgHeight,
float aSourceWidth, float aSourceHeight)
{
// Images smaller than this in either direction are considered "small" and
// are not resampled ever (see below).
@ -598,9 +598,9 @@ static GraphicsFilter ReduceResamplingFilter(GraphicsFilter aFilter,
return aFilter;
}
#else
static GraphicsFilter ReduceResamplingFilter(GraphicsFilter aFilter,
int aImgWidth, int aImgHeight,
int aSourceWidth, int aSourceHeight)
static Filter ReduceResamplingFilter(Filter aFilter,
int aImgWidth, int aImgHeight,
int aSourceWidth, int aSourceHeight)
{
// Just pass the filter through unchanged
return aFilter;
@ -627,7 +627,7 @@ PrescaleAndTileDrawable(gfxDrawable* aDrawable,
gfxContext* aContext,
const ImageRegion& aRegion,
Rect aImageRect,
const GraphicsFilter& aFilter,
const Filter& aFilter,
const SurfaceFormat aFormat,
gfxFloat aOpacity)
{
@ -708,7 +708,7 @@ gfxUtils::DrawPixelSnapped(gfxContext* aContext,
const gfxSize& aImageSize,
const ImageRegion& aRegion,
const SurfaceFormat aFormat,
GraphicsFilter aFilter,
Filter aFilter,
uint32_t aImageFlags,
gfxFloat aOpacity)
{

View File

@ -7,7 +7,6 @@
#define GFX_UTILS_H
#include "gfxTypes.h"
#include "GraphicsFilter.h"
#include "imgIContainer.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
@ -79,7 +78,7 @@ public:
const gfxSize& aImageSize,
const ImageRegion& aRegion,
const mozilla::gfx::SurfaceFormat aFormat,
GraphicsFilter aFilter,
mozilla::gfx::Filter aFilter,
uint32_t aImageFlags = imgIContainer::FLAG_NONE,
gfxFloat aOpacity = 1.0);

View File

@ -49,7 +49,6 @@ EXPORTS += [
'gfxTypes.h',
'gfxUserFontSet.h',
'gfxUtils.h',
'GraphicsFilter.h',
'RoundedRect.h',
'SoftwareVsyncSource.h',
'VsyncSource.h',

View File

@ -109,7 +109,7 @@ public:
virtual bool operator()(gfxContext* aContext,
const gfxRect& aFillRect,
const GraphicsFilter& aFilter,
const Filter& aFilter,
const gfxMatrix& aTransform)
{
MOZ_ASSERT(aTransform.IsIdentity(),
@ -350,7 +350,7 @@ ClippedImage::Draw(gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags)
{
@ -411,7 +411,7 @@ ClippedImage::DrawSingleTile(gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags)
{
@ -470,7 +470,7 @@ ClippedImage::GetOrientation()
nsIntSize
ClippedImage::OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,
GraphicsFilter aFilter, uint32_t aFlags)
Filter aFilter, uint32_t aFlags)
{
if (!ShouldClip()) {
return InnerImage()->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter,

View File

@ -50,7 +50,7 @@ public:
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
gfx::Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags) override;
NS_IMETHOD RequestDiscard() override;
@ -59,7 +59,7 @@ public:
override;
nsIntSize OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
gfx::Filter aFilter,
uint32_t aFlags) override;
protected:
@ -78,7 +78,7 @@ private:
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
gfx::Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags);

View File

@ -218,7 +218,7 @@ DynamicImage::Draw(gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags)
{
@ -324,7 +324,7 @@ DynamicImage::SetAnimationStartTime(const mozilla::TimeStamp& aTime)
nsIntSize
DynamicImage::OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,
GraphicsFilter aFilter, uint32_t aFlags)
Filter aFilter, uint32_t aFlags)
{
IntSize size(mDrawable->Size());
return nsIntSize(size.width, size.height);

View File

@ -74,7 +74,7 @@ FrozenImage::Draw(gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t /* aWhichFrame - ignored */,
GraphicsFilter aFilter,
Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags)
{

View File

@ -50,7 +50,7 @@ public:
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
gfx::Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags) override;
NS_IMETHOD_(void) RequestRefresh(const TimeStamp& aTime) override;

View File

@ -13,6 +13,7 @@
namespace mozilla {
using gfx::DataSourceSurface;
using gfx::Filter;
using gfx::SourceSurface;
using layers::LayerManager;
using layers::ImageContainer;
@ -205,7 +206,7 @@ ImageWrapper::Draw(gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags)
{
@ -304,7 +305,7 @@ ImageWrapper::PropagateUseCounters(nsIDocument* aParentDocument)
nsIntSize
ImageWrapper::OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,
GraphicsFilter aFilter, uint32_t aFlags)
Filter aFilter, uint32_t aFlags)
{
return mInnerImage->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter,
aFlags);

View File

@ -272,7 +272,7 @@ OrientedImage::Draw(gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags)
{
@ -309,7 +309,7 @@ OrientedImage::Draw(gfxContext* aContext,
nsIntSize
OrientedImage::OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,
GraphicsFilter aFilter, uint32_t aFlags)
Filter aFilter, uint32_t aFlags)
{
if (!mOrientation.SwapsWidthAndHeight()) {
return InnerImage()->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter,

View File

@ -47,14 +47,14 @@ public:
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
gfx::Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags) override;
NS_IMETHOD_(nsIntRect) GetImageSpaceInvalidationRect(
const nsIntRect& aRect) override;
nsIntSize OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
gfx::Filter aFilter,
uint32_t aFlags) override;
protected:

View File

@ -1445,7 +1445,7 @@ RasterImage::DrawInternal(DrawableFrameRef&& aFrameRef,
gfxContext* aContext,
const IntSize& aSize,
const ImageRegion& aRegion,
GraphicsFilter aFilter,
Filter aFilter,
uint32_t aFlags)
{
gfxContextMatrixAutoSaveRestore saveMatrix(aContext);
@ -1480,7 +1480,7 @@ RasterImage::DrawInternal(DrawableFrameRef&& aFrameRef,
//******************************************************************************
/* [noscript] void draw(in gfxContext aContext,
* in gfxGraphicsFilter aFilter,
* in Filter aFilter,
* [const] in gfxMatrix aUserSpaceToImageSpace,
* [const] in gfxRect aFill,
* [const] in IntRect aSubimage,
@ -1493,7 +1493,7 @@ RasterImage::Draw(gfxContext* aContext,
const IntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
Filter aFilter,
const Maybe<SVGImageContext>& /*aSVGContext - ignored*/,
uint32_t aFlags)
{
@ -1850,7 +1850,7 @@ RasterImage::PropagateUseCounters(nsIDocument*)
IntSize
RasterImage::OptimalImageSizeForDest(const gfxSize& aDest, uint32_t aWhichFrame,
GraphicsFilter aFilter, uint32_t aFlags)
Filter aFilter, uint32_t aFlags)
{
MOZ_ASSERT(aDest.width >= 0 || ceil(aDest.width) <= INT32_MAX ||
aDest.height >= 0 || ceil(aDest.height) <= INT32_MAX,

View File

@ -253,7 +253,7 @@ private:
gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
GraphicsFilter aFilter,
gfx::Filter aFilter,
uint32_t aFlags);
already_AddRefed<gfx::SourceSurface> CopyFrame(uint32_t aWhichFrame,

View File

@ -263,7 +263,7 @@ public:
{ }
virtual bool operator()(gfxContext* aContext,
const gfxRect& aFillRect,
const GraphicsFilter& aFilter,
const Filter& aFilter,
const gfxMatrix& aTransform);
private:
nsRefPtr<SVGDocumentWrapper> mSVGDocumentWrapper;
@ -276,7 +276,7 @@ private:
bool
SVGDrawingCallback::operator()(gfxContext* aContext,
const gfxRect& aFillRect,
const GraphicsFilter& aFilter,
const Filter& aFilter,
const gfxMatrix& aTransform)
{
MOZ_ASSERT(mSVGDocumentWrapper, "need an SVGDocumentWrapper");
@ -759,7 +759,7 @@ struct SVGDrawingParameters
SVGDrawingParameters(gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
GraphicsFilter aFilter,
Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
float aAnimationTime,
uint32_t aFlags)
@ -784,7 +784,7 @@ struct SVGDrawingParameters
IntSize size;
IntRect imageRect;
ImageRegion region;
GraphicsFilter filter;
Filter filter;
const Maybe<SVGImageContext>& svgContext;
nsIntSize viewportSize;
float animationTime;
@ -797,7 +797,7 @@ struct SVGDrawingParameters
* [const] in nsIntSize aSize,
* [const] in ImageRegion aRegion,
* in uint32_t aWhichFrame,
* in gfxGraphicsFilter aFilter,
* in Filter aFilter,
* [const] in MaybeSVGImageContext aSVGContext,
* in uint32_t aFlags); */
NS_IMETHODIMP_(DrawResult)
@ -805,7 +805,7 @@ VectorImage::Draw(gfxContext* aContext,
const nsIntSize& aSize,
const ImageRegion& aRegion,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
Filter aFilter,
const Maybe<SVGImageContext>& aSVGContext,
uint32_t aFlags)
{
@ -1296,7 +1296,7 @@ VectorImage::ReportUseCounters()
nsIntSize
VectorImage::OptimalImageSizeForDest(const gfxSize& aDest,
uint32_t aWhichFrame,
GraphicsFilter aFilter,
Filter aFilter,
uint32_t aFlags)
{
MOZ_ASSERT(aDest.width >= 0 || ceil(aDest.width) <= INT32_MAX ||

View File

@ -237,7 +237,7 @@ nsresult
imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
const nsIntSize& aSize,
const SurfaceFormat aFormat,
GraphicsFilter aFilter,
Filter aFilter,
uint32_t aImageFlags)
{
// Assert for properties that should be verified by decoders,
@ -545,7 +545,7 @@ imgFrame::SurfaceForDrawing(bool aDoPadding,
}
bool imgFrame::Draw(gfxContext* aContext, const ImageRegion& aRegion,
GraphicsFilter aFilter, uint32_t aImageFlags)
Filter aFilter, uint32_t aImageFlags)
{
PROFILER_LABEL("imgFrame", "Draw",
js::ProfileEntry::Category::GRAPHICS);

View File

@ -108,6 +108,7 @@ class imgFrame
typedef gfx::Color Color;
typedef gfx::DataSourceSurface DataSourceSurface;
typedef gfx::DrawTarget DrawTarget;
typedef gfx::Filter Filter;
typedef gfx::IntSize IntSize;
typedef gfx::SourceSurface SourceSurface;
typedef gfx::SurfaceFormat SurfaceFormat;
@ -154,7 +155,7 @@ public:
nsresult InitWithDrawable(gfxDrawable* aDrawable,
const nsIntSize& aSize,
const SurfaceFormat aFormat,
GraphicsFilter aFilter,
Filter aFilter,
uint32_t aImageFlags);
DrawableFrameRef DrawableRef();
@ -173,7 +174,7 @@ public:
void SetRawAccessOnly();
bool Draw(gfxContext* aContext, const ImageRegion& aRegion,
GraphicsFilter aFilter, uint32_t aImageFlags);
Filter aFilter, uint32_t aImageFlags);
nsresult ImageUpdated(const nsIntRect& aUpdateRect);

View File

@ -10,7 +10,6 @@
#include "gfxContext.h"
#include "gfxMatrix.h"
#include "gfxRect.h"
#include "GraphicsFilter.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/Maybe.h"
#include "mozilla/RefPtr.h"
@ -94,7 +93,7 @@ native DrawResult(mozilla::image::DrawResult);
[ref] native gfxMatrix(gfxMatrix);
[ref] native gfxRect(gfxRect);
[ref] native gfxSize(gfxSize);
native gfxGraphicsFilter(GraphicsFilter);
native Filter(mozilla::gfx::Filter);
[ref] native nsIntRect(nsIntRect);
native nsIntRectByVal(nsIntRect);
[ref] native nsIntSize(nsIntSize);
@ -119,7 +118,7 @@ native nsIntSizeByVal(nsIntSize);
*
* Internally, imgIContainer also manages animation of images.
*/
[scriptable, builtinclass, uuid(4e5a0547-6c54-4051-8b52-1f2fdd667696)]
[scriptable, builtinclass, uuid(7c795421-a79c-43ac-9e20-6d4e8a9dfb76)]
interface imgIContainer : nsISupports
{
/**
@ -165,7 +164,7 @@ interface imgIContainer : nsISupports
*/
[notxpcom, nostdcall] nsIntSizeByVal
optimalImageSizeForDest([const] in gfxSize aDest, in uint32_t aWhichFrame,
in gfxGraphicsFilter aFilter, in uint32_t aFlags);
in Filter aFilter, in uint32_t aFlags);
/**
* Enumerated values for the 'type' attribute (below).
@ -421,7 +420,7 @@ interface imgIContainer : nsISupports
[const] in nsIntSize aSize,
[const] in ImageRegion aRegion,
in uint32_t aWhichFrame,
in gfxGraphicsFilter aFilter,
in Filter aFilter,
[const] in MaybeSVGImageContext aSVGContext,
in uint32_t aFlags);

View File

@ -55,7 +55,6 @@
#include "mozilla/Telemetry.h"
#include "gfxUtils.h"
#include "gfxGradientCache.h"
#include "GraphicsFilter.h"
#include "nsInlineFrame.h"
#include <algorithm>
@ -4958,7 +4957,7 @@ nsImageRenderer::Draw(nsPresContext* aPresContext,
return DrawResult::SUCCESS;
}
GraphicsFilter filter = nsLayoutUtils::GetGraphicsFilterForFrame(mForFrame);
Filter filter = nsLayoutUtils::GetGraphicsFilterForFrame(mForFrame);
switch (mType) {
case eStyleImageType_Image:
@ -5191,14 +5190,13 @@ nsImageRenderer::DrawBorderImageComponent(nsPresContext* aPresContext,
subImage = ImageOps::Clip(image, srcRect);
}
GraphicsFilter graphicsFilter =
nsLayoutUtils::GetGraphicsFilterForFrame(mForFrame);
Filter filter = nsLayoutUtils::GetGraphicsFilterForFrame(mForFrame);
if (!RequiresScaling(aFill, aHFill, aVFill, aUnitSize)) {
nsLayoutUtils::DrawSingleImage(*aRenderingContext.ThebesContext(),
aPresContext,
subImage,
graphicsFilter,
filter,
aFill, aDirtyRect,
nullptr,
imgIContainer::FLAG_NONE);
@ -5209,7 +5207,7 @@ nsImageRenderer::DrawBorderImageComponent(nsPresContext* aPresContext,
nsLayoutUtils::DrawImage(*aRenderingContext.ThebesContext(),
aPresContext,
subImage,
graphicsFilter,
filter,
tile, aFill, tile.TopLeft(), aDirtyRect,
imgIContainer::FLAG_NONE);
return;

View File

@ -5868,10 +5868,10 @@ nsLayoutUtils::GetClosestLayer(nsIFrame* aFrame)
return aFrame->PresContext()->PresShell()->FrameManager()->GetRootFrame();
}
GraphicsFilter
Filter
nsLayoutUtils::GetGraphicsFilterForFrame(nsIFrame* aForFrame)
{
GraphicsFilter defaultFilter = Filter::GOOD;
Filter defaultFilter = Filter::GOOD;
nsStyleContext *sc;
if (nsCSSRendering::IsCanvasFrame(aForFrame)) {
nsCSSRendering::FindBackground(aForFrame, &sc);
@ -6021,7 +6021,7 @@ ComputeSnappedImageDrawingParameters(gfxContext* aCtx,
const nsPoint aAnchor,
const nsRect aDirty,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
uint32_t aImageFlags)
{
if (aDest.IsEmpty() || aFill.IsEmpty())
@ -6203,7 +6203,7 @@ static DrawResult
DrawImageInternal(gfxContext& aContext,
nsPresContext* aPresContext,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
const nsRect& aDest,
const nsRect& aFill,
const nsPoint& aAnchor,
@ -6249,7 +6249,7 @@ DrawImageInternal(gfxContext& aContext,
nsLayoutUtils::DrawSingleUnscaledImage(gfxContext& aContext,
nsPresContext* aPresContext,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
const nsPoint& aDest,
const nsRect* aDirty,
uint32_t aImageFlags,
@ -6287,7 +6287,7 @@ nsLayoutUtils::DrawSingleUnscaledImage(gfxContext& aContext,
nsLayoutUtils::DrawSingleImage(gfxContext& aContext,
nsPresContext* aPresContext,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
const nsRect& aDest,
const nsRect& aDirty,
const SVGImageContext* aSVGContext,
@ -6403,7 +6403,7 @@ nsLayoutUtils::DrawBackgroundImage(gfxContext& aContext,
nsPresContext* aPresContext,
imgIContainer* aImage,
const CSSIntSize& aImageSize,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
const nsRect& aDest,
const nsRect& aFill,
const nsPoint& aAnchor,
@ -6428,7 +6428,7 @@ nsLayoutUtils::DrawBackgroundImage(gfxContext& aContext,
nsLayoutUtils::DrawImage(gfxContext& aContext,
nsPresContext* aPresContext,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
const nsRect& aDest,
const nsRect& aFill,
const nsPoint& aAnchor,

View File

@ -16,7 +16,6 @@
#include "mozilla/layout/FrameChildList.h"
#include "nsThreadUtils.h"
#include "nsIPrincipal.h"
#include "GraphicsFilter.h"
#include "nsCSSPseudoElements.h"
#include "FrameMetrics.h"
#include "nsIWidget.h"
@ -112,7 +111,6 @@ struct DisplayPortMarginsPropertyData {
*/
class nsLayoutUtils
{
typedef ::GraphicsFilter GraphicsFilter;
typedef mozilla::dom::DOMRectList DOMRectList;
typedef mozilla::layers::Layer Layer;
typedef mozilla::ContainerLayerParameters ContainerLayerParameters;
@ -120,6 +118,7 @@ class nsLayoutUtils
typedef mozilla::gfx::SourceSurface SourceSurface;
typedef mozilla::gfx::Color Color;
typedef mozilla::gfx::DrawTarget DrawTarget;
typedef mozilla::gfx::Filter Filter;
typedef mozilla::gfx::Float Float;
typedef mozilla::gfx::Point Point;
typedef mozilla::gfx::Rect Rect;
@ -1705,7 +1704,7 @@ public:
/**
* Gets the graphics filter for the frame
*/
static GraphicsFilter GetGraphicsFilterForFrame(nsIFrame* aFrame);
static Filter GetGraphicsFilterForFrame(nsIFrame* aFrame);
/* N.B. The only difference between variants of the Draw*Image
* functions below is the type of the aImage argument.
@ -1736,7 +1735,7 @@ public:
nsPresContext* aPresContext,
imgIContainer* aImage,
const CSSIntSize& aImageSize,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
const nsRect& aDest,
const nsRect& aFill,
const nsPoint& aAnchor,
@ -1761,7 +1760,7 @@ public:
static DrawResult DrawImage(gfxContext& aContext,
nsPresContext* aPresContext,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
const nsRect& aDest,
const nsRect& aFill,
const nsPoint& aAnchor,
@ -1815,7 +1814,7 @@ public:
static DrawResult DrawSingleUnscaledImage(gfxContext& aContext,
nsPresContext* aPresContext,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
const nsPoint& aDest,
const nsRect* aDirty,
uint32_t aImageFlags,
@ -1846,7 +1845,7 @@ public:
static DrawResult DrawSingleImage(gfxContext& aContext,
nsPresContext* aPresContext,
imgIContainer* aImage,
GraphicsFilter aGraphicsFilter,
Filter aGraphicsFilter,
const nsRect& aDest,
const nsRect& aDirty,
const mozilla::SVGImageContext* aSVGContext,

View File

@ -740,7 +740,7 @@ nsImageFrame::MaybeDecodeForPredictedSize()
// Determine the optimal image size to use.
uint32_t flags = imgIContainer::FLAG_HIGH_QUALITY_SCALING
| imgIContainer::FLAG_ASYNC_NOTIFY;
GraphicsFilter filter = nsLayoutUtils::GetGraphicsFilterForFrame(this);
Filter filter = nsLayoutUtils::GetGraphicsFilterForFrame(this);
gfxSize gfxPredictedScreenSize = gfxSize(predictedScreenIntSize.width,
predictedScreenIntSize.height);
nsIntSize predictedImageSize =

View File

@ -1457,8 +1457,7 @@ nsPluginFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
imglayer->SetScaleToSize(size, ScaleMode::STRETCH);
imglayer->SetContainer(container);
GraphicsFilter filter =
nsLayoutUtils::GetGraphicsFilterForFrame(this);
Filter filter = nsLayoutUtils::GetGraphicsFilterForFrame(this);
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
if (!aManager->IsCompositingCheap()) {
// Pixman just horrible with bilinear filter scaling

View File

@ -618,9 +618,9 @@ public:
, mFlags (aFlags)
{}
virtual bool operator()(gfxContext* aContext,
const gfxRect& aFillRect,
const GraphicsFilter& aFilter,
const gfxMatrix& aTransform) override;
const gfxRect& aFillRect,
const Filter& aFilter,
const gfxMatrix& aTransform) override;
private:
nsIFrame* mFrame;
nsSize mPaintServerSize;
@ -631,7 +631,7 @@ private:
bool
PaintFrameCallback::operator()(gfxContext* aContext,
const gfxRect& aFillRect,
const GraphicsFilter& aFilter,
const Filter& aFilter,
const gfxMatrix& aTransform)
{
if (mFrame->GetStateBits() & NS_FRAME_DRAWING_AS_PAINTSERVER)

View File

@ -7,7 +7,6 @@
#define NSSVGINTEGRATIONUTILS_H_
#include "gfxMatrix.h"
#include "GraphicsFilter.h"
#include "gfxRect.h"
#include "nsAutoPtr.h"