Bug 1211324 (part 3) - Remove GraphicsFilter::FILTER_FAST and replace it with FILTER_BEST. r=mattwoodrow.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 05 Oct 2015 16:59:32 -0700
changeset 301715 3897da20e42dec0bcf73987af1eaac4f8ce950b8
parent 301714 6b027441cbeeec0ba06c89bf9766c76048e05834
child 301716 a7cd4d58ea9e5429aae27f61ebe3e3a46818767e
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1211324
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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.
gfx/ipc/GfxMessageUtils.h
gfx/layers/Layers.cpp
gfx/layers/LayersLogging.cpp
gfx/layers/protobuf/LayerScopePacket.pb.cc
gfx/layers/protobuf/LayerScopePacket.pb.h
gfx/thebes/GraphicsFilter.h
gfx/thebes/gfxDrawable.h
gfx/thebes/gfxUtils.cpp
gfx/thebes/gfxWindowsNativeDrawing.cpp
image/ClippedImage.cpp
image/OrientedImage.cpp
layout/base/nsLayoutUtils.cpp
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -204,17 +204,17 @@ struct ParamTraits<gfxSurfaceType>
              gfxSurfaceType::Image,
              gfxSurfaceType::Max>
 {};
 
 template <>
 struct ParamTraits<mozilla::GraphicsFilterType>
   : public ContiguousEnumSerializer<
              mozilla::GraphicsFilterType,
-             GraphicsFilter::FILTER_FAST,
+             GraphicsFilter::FILTER_GOOD,
              GraphicsFilter::FILTER_SENTINEL>
 {};
 
 template <>
 struct ParamTraits<mozilla::layers::LayersBackend>
   : public ContiguousEnumSerializer<
              mozilla::layers::LayersBackend,
              mozilla::layers::LayersBackend::LAYERS_NONE,
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -2143,19 +2143,16 @@ CanvasLayer::PrintInfo(std::stringstream
 
 // This help function is used to assign the correct enum value
 // to the packet
 static void
 DumpFilter(layerscope::LayersPacket::Layer* aLayer, const GraphicsFilter& aFilter)
 {
   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;
     case GraphicsFilter::FILTER_BEST:
       aLayer->set_filter(LayersPacket::Layer::FILTER_BEST);
       break;
     case GraphicsFilter::FILTER_NEAREST:
       aLayer->set_filter(LayersPacket::Layer::FILTER_NEAREST);
--- a/gfx/layers/LayersLogging.cpp
+++ b/gfx/layers/LayersLogging.cpp
@@ -29,17 +29,16 @@ AppendToString(std::stringstream& aStrea
 }
 
 void
 AppendToString(std::stringstream& aStream, const GraphicsFilter& f,
                const char* pfx, const char* sfx)
 {
   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;
   default:
     NS_ERROR("unknown filter type");
     aStream << "???";
   }
   aStream << sfx;
--- a/gfx/layers/protobuf/LayerScopePacket.pb.cc
+++ b/gfx/layers/protobuf/LayerScopePacket.pb.cc
@@ -1181,17 +1181,16 @@ bool LayersPacket_Layer_Filter_IsValid(i
     case 6:
       return true;
     default:
       return false;
   }
 }
 
 #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;
 const LayersPacket_Layer_Filter LayersPacket_Layer::FILTER_SENTINEL;
 #endif  // _MSC_VER
 #ifndef _MSC_VER
 const int LayersPacket_Layer_Size::kWFieldNumber;
 const int LayersPacket_Layer_Size::kHFieldNumber;
--- a/gfx/layers/protobuf/LayerScopePacket.pb.h
+++ b/gfx/layers/protobuf/LayerScopePacket.pb.h
@@ -1149,17 +1149,16 @@ class LayersPacket_Layer : public ::goog
   static const ScrollingDirect ScrollingDirect_MIN =
     LayersPacket_Layer_ScrollingDirect_ScrollingDirect_MIN;
   static const ScrollingDirect ScrollingDirect_MAX =
     LayersPacket_Layer_ScrollingDirect_ScrollingDirect_MAX;
   static const int ScrollingDirect_ARRAYSIZE =
     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;
   static const Filter FILTER_SENTINEL = LayersPacket_Layer_Filter_FILTER_SENTINEL;
   static inline bool Filter_IsValid(int value) {
     return LayersPacket_Layer_Filter_IsValid(value);
   }
 
--- a/gfx/thebes/GraphicsFilter.h
+++ b/gfx/thebes/GraphicsFilter.h
@@ -2,17 +2,16 @@
  * 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
 
 enum class GraphicsFilter : int {
-  FILTER_FAST,
   FILTER_GOOD,
   FILTER_BEST,
   FILTER_NEAREST,
   FILTER_SENTINEL
 };
 
 #endif
 
--- a/gfx/thebes/gfxDrawable.h
+++ b/gfx/thebes/gfxDrawable.h
@@ -131,17 +131,17 @@ public:
     virtual bool Draw(gfxContext* aContext,
                         const gfxRect& aFillRect,
                         bool aRepeat,
                         const GraphicsFilter& aFilter,
                         gfxFloat aOpacity = 1.0,
                         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;
 };
 
 /**
  * gfxPatternDrawable
  * A convenience implementation of gfxDrawable for patterns.
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -449,17 +449,17 @@ CreateSamplingRestrictedDrawable(gfxDraw
       gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(size, aFormat);
     if (!target) {
       return nullptr;
     }
 
     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()));
     return drawable.forget();
 }
 #endif // !MOZ_GFX_OPTIMIZE_MOBILE
 
 // working around cairo/pixman bug (bug 364968)
--- a/gfx/thebes/gfxWindowsNativeDrawing.cpp
+++ b/gfx/thebes/gfxWindowsNativeDrawing.cpp
@@ -283,17 +283,17 @@ gfxWindowsNativeDrawing::PaintToContext(
 
         nsRefPtr<gfxPattern> pat = new gfxPattern(source, Matrix());
 
         gfxMatrix m;
         m.Scale(mScale.width, mScale.height);
         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);
         mContext->Fill();
         mContext->Restore();
 
         mRenderState = RENDER_STATE_DONE;
     } else {
--- a/image/ClippedImage.cpp
+++ b/image/ClippedImage.cpp
@@ -286,17 +286,17 @@ ClippedImage::GetFrameInternal(const nsI
       new DrawSingleTileCallback(this, aSize, aSVGContext, aWhichFrame, aFlags);
     nsRefPtr<gfxDrawable> drawable =
       new gfxCallbackDrawable(drawTileCallback, aSize);
 
     // Actually draw. The callback will end up invoking DrawSingleTile.
     gfxUtils::DrawPixelSnapped(ctx, drawable, aSize,
                                ImageRegion::Create(aSize),
                                SurfaceFormat::B8G8R8A8,
-                               GraphicsFilter::FILTER_FAST,
+                               GraphicsFilter::FILTER_BEST,
                                imgIContainer::FLAG_CLAMP);
 
     // Cache the resulting surface.
     mCachedSurface =
       new ClippedImageCachedSurface(target->Snapshot(), aSize, aSVGContext,
                                     frameToDraw, aFlags,
                                     drawTileCallback->GetDrawResult());
   }
--- a/image/OrientedImage.cpp
+++ b/image/OrientedImage.cpp
@@ -112,17 +112,17 @@ OrientedImage::GetFrame(uint32_t aWhichF
   nsRefPtr<gfxDrawable> drawable =
     new gfxSurfaceDrawable(innerSurface, size);
 
   // Draw.
   nsRefPtr<gfxContext> ctx = new gfxContext(target);
   ctx->Multiply(OrientationMatrix(size));
   gfxUtils::DrawPixelSnapped(ctx, drawable, size,
                              ImageRegion::Create(size),
-                             surfaceFormat, GraphicsFilter::FILTER_FAST);
+                             surfaceFormat, GraphicsFilter::FILTER_BEST);
 
   return target->Snapshot();
 }
 
 NS_IMETHODIMP_(already_AddRefed<SourceSurface>)
 OrientedImage::GetFrameAtSize(const IntSize& aSize,
                               uint32_t aWhichFrame,
                               uint32_t aFlags)
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -5876,17 +5876,17 @@ nsLayoutUtils::GetGraphicsFilterForFrame
   if (nsCSSRendering::IsCanvasFrame(aForFrame)) {
     nsCSSRendering::FindBackground(aForFrame, &sc);
   } else {
     sc = aForFrame->StyleContext();
   }
 
   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:
     return GraphicsFilter::FILTER_NEAREST;
   default:
     return defaultFilter;
   }
 }