Bug 1211324 (part 3) - Remove GraphicsFilter::FILTER_FAST and replace it with FILTER_BEST. r=mattwoodrow.

This may sound like an odd change but it's what the current code effectively
already does due to the way ToFilter() and ThebesFilter() are defined.
This commit is contained in:
Nicholas Nethercote 2015-10-05 16:59:32 -07:00
parent 147a5bb519
commit 4461b88439
12 changed files with 7 additions and 14 deletions

View File

@ -209,7 +209,7 @@ template <>
struct ParamTraits<mozilla::GraphicsFilterType>
: public ContiguousEnumSerializer<
mozilla::GraphicsFilterType,
GraphicsFilter::FILTER_FAST,
GraphicsFilter::FILTER_GOOD,
GraphicsFilter::FILTER_SENTINEL>
{};

View File

@ -2148,9 +2148,6 @@ DumpFilter(layerscope::LayersPacket::Layer* aLayer, const GraphicsFilter& aFilte
{
using namespace layerscope;
switch (aFilter) {
case GraphicsFilter::FILTER_FAST:
aLayer->set_filter(LayersPacket::Layer::FILTER_FAST);
break;
case GraphicsFilter::FILTER_GOOD:
aLayer->set_filter(LayersPacket::Layer::FILTER_GOOD);
break;

View File

@ -34,7 +34,6 @@ AppendToString(std::stringstream& aStream, const GraphicsFilter& f,
{
aStream << pfx;
switch (f) {
case GraphicsFilter::FILTER_FAST: aStream << "fast"; break;
case GraphicsFilter::FILTER_GOOD: aStream << "good"; break;
case GraphicsFilter::FILTER_BEST: aStream << "best"; break;
case GraphicsFilter::FILTER_NEAREST: aStream << "nearest"; break;

View File

@ -1186,7 +1186,6 @@ bool LayersPacket_Layer_Filter_IsValid(int value) {
}
#ifndef _MSC_VER
const LayersPacket_Layer_Filter LayersPacket_Layer::FILTER_FAST;
const LayersPacket_Layer_Filter LayersPacket_Layer::FILTER_GOOD;
const LayersPacket_Layer_Filter LayersPacket_Layer::FILTER_BEST;
const LayersPacket_Layer_Filter LayersPacket_Layer::FILTER_NEAREST;

View File

@ -1154,7 +1154,6 @@ class LayersPacket_Layer : public ::google::protobuf::MessageLite {
LayersPacket_Layer_ScrollingDirect_ScrollingDirect_ARRAYSIZE;
typedef LayersPacket_Layer_Filter Filter;
static const Filter FILTER_FAST = LayersPacket_Layer_Filter_FILTER_FAST;
static const Filter FILTER_GOOD = LayersPacket_Layer_Filter_FILTER_GOOD;
static const Filter FILTER_BEST = LayersPacket_Layer_Filter_FILTER_BEST;
static const Filter FILTER_NEAREST = LayersPacket_Layer_Filter_FILTER_NEAREST;

View File

@ -7,7 +7,6 @@
#define GraphicsFilter_h
enum class GraphicsFilter : int {
FILTER_FAST,
FILTER_GOOD,
FILTER_BEST,
FILTER_NEAREST,

View File

@ -136,7 +136,7 @@ public:
const gfxMatrix& aTransform = gfxMatrix());
protected:
already_AddRefed<gfxSurfaceDrawable> MakeSurfaceDrawable(const GraphicsFilter aFilter = GraphicsFilter::FILTER_FAST);
already_AddRefed<gfxSurfaceDrawable> MakeSurfaceDrawable(const GraphicsFilter aFilter = GraphicsFilter::FILTER_BEST);
nsRefPtr<gfxDrawingCallback> mCallback;
nsRefPtr<gfxSurfaceDrawable> mSurfaceDrawable;

View File

@ -454,7 +454,7 @@ CreateSamplingRestrictedDrawable(gfxDrawable* aDrawable,
nsRefPtr<gfxContext> tmpCtx = new gfxContext(target);
tmpCtx->SetOp(OptimalFillOp());
aDrawable->Draw(tmpCtx, needed - needed.TopLeft(), true,
GraphicsFilter::FILTER_FAST, 1.0, gfxMatrix::Translation(needed.TopLeft()));
GraphicsFilter::FILTER_BEST, 1.0, gfxMatrix::Translation(needed.TopLeft()));
RefPtr<SourceSurface> surface = target->Snapshot();
nsRefPtr<gfxDrawable> drawable = new gfxSurfaceDrawable(surface, size, gfxMatrix::Translation(-needed.TopLeft()));

View File

@ -288,7 +288,7 @@ gfxWindowsNativeDrawing::PaintToContext()
pat->SetMatrix(m);
if (mNativeDrawFlags & DO_NEAREST_NEIGHBOR_FILTERING)
pat->SetFilter(GraphicsFilter::FILTER_FAST);
pat->SetFilter(GraphicsFilter::FILTER_BEST);
pat->SetExtend(ExtendMode::CLAMP);
mContext->SetPattern(pat);

View File

@ -291,7 +291,7 @@ ClippedImage::GetFrameInternal(const nsIntSize& aSize,
gfxUtils::DrawPixelSnapped(ctx, drawable, aSize,
ImageRegion::Create(aSize),
SurfaceFormat::B8G8R8A8,
GraphicsFilter::FILTER_FAST,
GraphicsFilter::FILTER_BEST,
imgIContainer::FLAG_CLAMP);
// Cache the resulting surface.

View File

@ -117,7 +117,7 @@ OrientedImage::GetFrame(uint32_t aWhichFrame,
ctx->Multiply(OrientationMatrix(size));
gfxUtils::DrawPixelSnapped(ctx, drawable, size,
ImageRegion::Create(size),
surfaceFormat, GraphicsFilter::FILTER_FAST);
surfaceFormat, GraphicsFilter::FILTER_BEST);
return target->Snapshot();
}

View File

@ -5881,7 +5881,7 @@ nsLayoutUtils::GetGraphicsFilterForFrame(nsIFrame* aForFrame)
switch (sc->StyleSVG()->mImageRendering) {
case NS_STYLE_IMAGE_RENDERING_OPTIMIZESPEED:
return GraphicsFilter::FILTER_FAST;
return GraphicsFilter::FILTER_BEST;
case NS_STYLE_IMAGE_RENDERING_OPTIMIZEQUALITY:
return GraphicsFilter::FILTER_BEST;
case NS_STYLE_IMAGE_RENDERING_CRISPEDGES: