Bug 1208345 - Remove gfxContext::GraphicsOperator. r=jwatt.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 24 Sep 2015 22:38:58 -0700
changeset 299815 d7001f668518bb12787437beba17bcd6b2acbbd9
parent 299814 32076ec3f4c00b26ae37fd54943a2d76e9a815c5
child 299816 06bcb0eaf47ef4d39831ba2cd5cfbd3298f3555b
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)
reviewersjwatt
bugs1208345
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 1208345 - Remove gfxContext::GraphicsOperator. r=jwatt. Also... - Rename various "operator" identifiers as "op" to match |CompositionOp|. - Rename |nsBackgroundLayerState::mCompositingOp| as |mCompositionOp| to match |CompositionOp|. - Remove some deprecated functions that are no longer needed.
dom/plugins/base/nsPluginInstanceOwner.cpp
gfx/layers/Layers.cpp
gfx/layers/Layers.h
gfx/layers/basic/BasicImplData.h
gfx/layers/basic/BasicLayerManager.cpp
gfx/layers/basic/BasicLayers.h
gfx/layers/basic/BasicLayersImpl.h
gfx/layers/basic/BasicPaintedLayer.cpp
gfx/layers/ipc/ISurfaceAllocator.cpp
gfx/thebes/gfx2DGlue.h
gfx/thebes/gfxContext.cpp
gfx/thebes/gfxContext.h
gfx/thebes/gfxDrawable.cpp
gfx/thebes/gfxTextRun.cpp
gfx/thebes/gfxUtils.cpp
gfx/thebes/gfxXlibNativeRenderer.cpp
image/imgFrame.cpp
layout/base/nsCSSRendering.cpp
layout/base/nsCSSRendering.h
layout/base/nsCSSRenderingBorders.cpp
layout/base/nsDisplayList.cpp
layout/base/nsPresShell.cpp
layout/svg/nsSVGImageFrame.cpp
widget/gtk/nsWindow.cpp
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -2612,17 +2612,17 @@ void nsPluginInstanceOwner::Paint(gfxCon
   event.data.draw.data.bitmap.baseAddr = pluginSurface->Data();
   event.data.draw.data.bitmap.rowBytes = aFrameRect.width * 4;
 
   if (!mInstance)
     return;
 
   mInstance->HandleEvent(&event, nullptr);
 
-  aContext->SetOperator(gfxContext::OPERATOR_SOURCE);
+  aContext->SetOp(gfx::CompositionOp::OP_SOURCE);
   aContext->SetSource(pluginSurface, gfxPoint(aFrameRect.x, aFrameRect.y));
   aContext->Clip(aFrameRect);
   aContext->Paint();
 #endif
 }
 #endif
 
 #if defined(MOZ_X11)
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -931,22 +931,16 @@ Layer::GetEffectiveMixBlendMode()
     c = c->GetParent()) {
     if(c->mMixBlendMode != CompositionOp::OP_OVER)
       return c->mMixBlendMode;
   }
 
   return mMixBlendMode;
 }
 
-gfxContext::GraphicsOperator
-Layer::DeprecatedGetEffectiveMixBlendMode()
-{
-  return ThebesOp(GetEffectiveMixBlendMode());
-}
-
 void
 Layer::ComputeEffectiveTransformForMaskLayers(const gfx::Matrix4x4& aTransformToSurface)
 {
   if (GetMaskLayer()) {
     ComputeEffectiveTransformForMaskLayer(GetMaskLayer(), aTransformToSurface);
   }
   for (size_t i = 0; i < GetAncestorMaskLayerCount(); i++) {
     Layer* maskLayer = GetAncestorMaskLayerAt(i);
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -6,17 +6,17 @@
 #ifndef GFX_LAYERS_H
 #define GFX_LAYERS_H
 
 #include <stdint.h>                     // for uint32_t, uint64_t, uint8_t
 #include <stdio.h>                      // for FILE
 #include <sys/types.h>                  // for int32_t, int64_t
 #include "FrameMetrics.h"               // for FrameMetrics
 #include "Units.h"                      // for LayerMargin, LayerPoint, ParentLayerIntRect
-#include "gfxContext.h"                 // for GraphicsOperator
+#include "gfxContext.h"
 #include "gfxTypes.h"
 #include "gfxColor.h"                   // for gfxRGBA
 #include "GraphicsFilter.h"             // for GraphicsFilter
 #include "gfxPoint.h"                   // for gfxPoint
 #include "gfxRect.h"                    // for gfxRect
 #include "gfx2DGlue.h"
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT_HELPER2, etc
 #include "mozilla/DebugOnly.h"          // for DebugOnly
@@ -973,21 +973,16 @@ public:
   {
     if (mMixBlendMode != aMixBlendMode) {
       MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) MixBlendMode", this));
       mMixBlendMode = aMixBlendMode;
       Mutated();
     }
   }
 
-  void DeprecatedSetMixBlendMode(gfxContext::GraphicsOperator aMixBlendMode)
-  {
-    SetMixBlendMode(gfx::CompositionOpForOp(aMixBlendMode));
-  }
-
   void SetForceIsolatedGroup(bool aForceIsolatedGroup)
   {
     if(mForceIsolatedGroup != aForceIsolatedGroup) {
       MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ForceIsolatedGroup", this));
       mForceIsolatedGroup = aForceIsolatedGroup;
       Mutated();
     }
   }
@@ -1495,17 +1490,16 @@ public:
    * to and excluding the nearest ancestor that has UseIntermediateSurface() set.
    */
   float GetEffectiveOpacity();
 
   /**
    * Returns the blendmode of this layer.
    */
   gfx::CompositionOp GetEffectiveMixBlendMode();
-  gfxContext::GraphicsOperator DeprecatedGetEffectiveMixBlendMode();
 
   /**
    * This returns the effective transform computed by
    * ComputeEffectiveTransforms. Typically this is a transform that transforms
    * this layer all the way to some intermediate surface or destination
    * surface. For non-BasicLayers this will be a transform to the nearest
    * ancestor with UseIntermediateSurface() (or to the root, if there is no
    * such ancestor), but for BasicLayers it's different.
--- a/gfx/layers/basic/BasicImplData.h
+++ b/gfx/layers/basic/BasicImplData.h
@@ -99,20 +99,16 @@ public:
   {
     NS_ASSERTION(aOperator == gfx::CompositionOp::OP_OVER ||
                  aOperator == gfx::CompositionOp::OP_SOURCE,
                  "Bad composition operator");
     mOperator = aOperator;
   }
 
   gfx::CompositionOp GetOperator() const { return mOperator; }
-  gfxContext::GraphicsOperator DeprecatedGetOperator() const
-  {
-    return gfx::ThebesOp(mOperator);
-  }
 
   /**
    * Return a surface for this layer. Will use an existing surface, if
    * possible, or may create a temporary surface.  Implement this
    * method for any layers that might be used as a mask.  Should only
    * return false if a surface cannot be created.  If true is
    * returned, only one of |aSurface| or |aDescriptor| is valid.
    */
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -420,18 +420,18 @@ ApplyDoubleBuffering(Layer* aLayer, cons
       }
       newVisibleRect.IntersectRect(newVisibleRect, cr);
     }
   }
 
   BasicContainerLayer* container =
     static_cast<BasicContainerLayer*>(aLayer->AsContainerLayer());
   // Layers that act as their own backbuffers should be drawn to the destination
-  // using OPERATOR_SOURCE to ensure that alpha values in a transparent window
-  // are cleared. This can also be faster than OPERATOR_OVER.
+  // using OP_SOURCE to ensure that alpha values in a transparent window are
+  // cleared. This can also be faster than OP_OVER.
   if (!container) {
     data->SetOperator(CompositionOp::OP_SOURCE);
     data->SetDrawAtomically(true);
   } else {
     if (container->UseIntermediateSurface() ||
         !container->ChildrenPartitionVisibleRegion(newVisibleRect)) {
       // We need to double-buffer this container.
       data->SetOperator(CompositionOp::OP_SOURCE);
@@ -841,17 +841,17 @@ BasicLayerManager::FlushGroup(PaintLayer
   // for the window.
   if (!mTransactionIncomplete) {
     if (aNeedsClipToVisibleRegion) {
       gfxUtils::ClipToRegion(aPaintContext.mTarget,
                              aPaintContext.mLayer->GetEffectiveVisibleRegion());
     }
 
     CompositionOp op = GetEffectiveOperator(aPaintContext.mLayer);
-    AutoSetOperator setOperator(aPaintContext.mTarget, ThebesOp(op));
+    AutoSetOperator setOperator(aPaintContext.mTarget, op);
 
     PaintWithMask(aPaintContext.mTarget, aPaintContext.mLayer->GetEffectiveOpacity(),
                   aPaintContext.mLayer->GetMaskLayer());
   }
 }
 
 /**
  * Install the clip applied to the layer on the given gfxContext.  The
--- a/gfx/layers/basic/BasicLayers.h
+++ b/gfx/layers/basic/BasicLayers.h
@@ -79,17 +79,17 @@ public:
    * Set the default target context that will be used when BeginTransaction
    * is called. This can only be called outside a transaction.
    * 
    * aDoubleBuffering can request double-buffering for drawing to the
    * default target. When BUFFERED, the layer manager avoids blitting
    * temporary results to aContext and then overpainting them with final
    * results, by using a temporary buffer when necessary. In BUFFERED
    * mode we always completely overwrite the contents of aContext's
-   * destination surface (within the clip region) using OPERATOR_SOURCE.
+   * destination surface (within the clip region) using OP_SOURCE.
    */
   void SetDefaultTarget(gfxContext* aContext);
   virtual void SetDefaultTargetConfiguration(BufferMode aDoubleBuffering, ScreenRotation aRotation);
   gfxContext* GetDefaultTarget() { return mDefaultTarget; }
 
   nsIWidget* GetRetainerWidget() { return mWidget; }
   void ClearRetainerWidget() { mWidget = nullptr; }
 
--- a/gfx/layers/basic/BasicLayersImpl.h
+++ b/gfx/layers/basic/BasicLayersImpl.h
@@ -23,26 +23,27 @@ class DrawTarget;
 } // namespace gfx
 
 namespace layers {
 
 class AutoMoz2DMaskData;
 class Layer;
 
 class AutoSetOperator {
+  typedef mozilla::gfx::CompositionOp CompositionOp;
 public:
-  AutoSetOperator(gfxContext* aContext, gfxContext::GraphicsOperator aOperator) {
-    if (aOperator != gfxContext::OPERATOR_OVER) {
-      aContext->SetOperator(aOperator);
+  AutoSetOperator(gfxContext* aContext, CompositionOp aOperator) {
+    if (aOperator != CompositionOp::OP_OVER) {
+      aContext->SetOp(aOperator);
       mContext = aContext;
     }
   }
   ~AutoSetOperator() {
     if (mContext) {
-      mContext->SetOperator(gfxContext::OPERATOR_OVER);
+      mContext->SetOp(CompositionOp::OP_OVER);
     }
   }
 private:
   nsRefPtr<gfxContext> mContext;
 };
 
 class BasicReadbackLayer : public ReadbackLayer,
                            public BasicImplData
--- a/gfx/layers/basic/BasicPaintedLayer.cpp
+++ b/gfx/layers/basic/BasicPaintedLayer.cpp
@@ -93,17 +93,17 @@ BasicPaintedLayer::PaintThebes(gfxContex
       SetAntialiasingFlags(this, groupContext->GetDrawTarget());
       aCallback(this, groupContext, toDraw, toDraw,
                 DrawRegionClip::NONE, nsIntRegion(), aCallbackData);
       if (needsGroup) {
         aContext->PopGroupToSource();
         if (needsClipToVisibleRegion) {
           gfxUtils::ClipToRegion(aContext, toDraw);
         }
-        AutoSetOperator setOptimizedOperator(aContext, ThebesOp(effectiveOperator));
+        AutoSetOperator setOptimizedOperator(aContext, effectiveOperator);
         PaintWithMask(aContext, opacity, aMaskLayer);
       }
 
       aContext->Restore();
     }
 
     RenderTraceInvalidateEnd(this, "FFFF00");
     return;
@@ -207,18 +207,17 @@ BasicPaintedLayer::Validate(LayerManager
     nsRefPtr<gfxContext> ctx =
       update.mLayer->GetSink()->BeginUpdate(update.mUpdateRect + offset,
                                             update.mSequenceCounter);
     if (ctx) {
       NS_ASSERTION(GetEffectiveOpacity() == 1.0, "Should only read back opaque layers");
       NS_ASSERTION(!GetMaskLayer(), "Should only read back layers without masks");
       ctx->SetMatrix(ctx->CurrentMatrix().Translate(offset.x, offset.y));
       mContentClient->DrawTo(this, ctx->GetDrawTarget(), 1.0,
-                             CompositionOpForOp(ctx->CurrentOperator()),
-                             nullptr, nullptr);
+                             ctx->CurrentOp(), nullptr, nullptr);
       update.mLayer->GetSink()->EndUpdate(ctx, update.mUpdateRect + offset);
     }
   }
 }
 
 already_AddRefed<PaintedLayer>
 BasicLayerManager::CreatePaintedLayer()
 {
--- a/gfx/layers/ipc/ISurfaceAllocator.cpp
+++ b/gfx/layers/ipc/ISurfaceAllocator.cpp
@@ -117,17 +117,17 @@ ISurfaceAllocator::AllocSurfaceDescripto
   if (IsSameProcess()) {
     uint8_t *data = new (std::nothrow) uint8_t[size];
     if (!data) {
       return false;
     }
     GfxMemoryImageReporter::DidAlloc(data);
 #ifdef XP_MACOSX
     // Workaround a bug in Quartz where drawing an a8 surface to another a8
-    // surface with OPERATOR_SOURCE still requires the destination to be clear.
+    // surface with OP_SOURCE still requires the destination to be clear.
     if (format == gfx::SurfaceFormat::A8) {
       memset(data, 0, size);
     }
 #endif
     *aBuffer = SurfaceDescriptorMemory((uintptr_t)data, format);
   } else {
 
     mozilla::ipc::SharedMemory::SharedMemoryType shmemType = OptimalShmemType();
--- a/gfx/thebes/gfx2DGlue.h
+++ b/gfx/thebes/gfx2DGlue.h
@@ -202,124 +202,12 @@ inline gfxContentType ContentForFormat(c
     return gfxContentType::ALPHA;
   case SurfaceFormat::B8G8R8A8:
   case SurfaceFormat::R8G8B8A8:
   default:
     return gfxContentType::COLOR_ALPHA;
   }
 }
 
-inline CompositionOp CompositionOpForOp(gfxContext::GraphicsOperator aOp)
-{
-  switch (aOp) {
-  case gfxContext::OPERATOR_ADD:
-    return CompositionOp::OP_ADD;
-  case gfxContext::OPERATOR_ATOP:
-    return CompositionOp::OP_ATOP;
-  case gfxContext::OPERATOR_IN:
-    return CompositionOp::OP_IN;
-  case gfxContext::OPERATOR_OUT:
-    return CompositionOp::OP_OUT;
-  case gfxContext::OPERATOR_SOURCE:
-    return CompositionOp::OP_SOURCE;
-  case gfxContext::OPERATOR_DEST_IN:
-    return CompositionOp::OP_DEST_IN;
-  case gfxContext::OPERATOR_DEST_OUT:
-    return CompositionOp::OP_DEST_OUT;
-  case gfxContext::OPERATOR_DEST_ATOP:
-    return CompositionOp::OP_DEST_ATOP;
-  case gfxContext::OPERATOR_XOR:
-    return CompositionOp::OP_XOR;
-  case gfxContext::OPERATOR_MULTIPLY:
-    return CompositionOp::OP_MULTIPLY;
-  case gfxContext::OPERATOR_SCREEN:
-    return CompositionOp::OP_SCREEN;
-  case gfxContext::OPERATOR_OVERLAY:
-    return CompositionOp::OP_OVERLAY;
-  case gfxContext::OPERATOR_DARKEN:
-    return CompositionOp::OP_DARKEN;
-  case gfxContext::OPERATOR_LIGHTEN:
-    return CompositionOp::OP_LIGHTEN;
-  case gfxContext::OPERATOR_COLOR_DODGE:
-    return CompositionOp::OP_COLOR_DODGE;
-  case gfxContext::OPERATOR_COLOR_BURN:
-    return CompositionOp::OP_COLOR_BURN;
-  case gfxContext::OPERATOR_HARD_LIGHT:
-    return CompositionOp::OP_HARD_LIGHT;
-  case gfxContext::OPERATOR_SOFT_LIGHT:
-    return CompositionOp::OP_SOFT_LIGHT;
-  case gfxContext::OPERATOR_DIFFERENCE:
-    return CompositionOp::OP_DIFFERENCE;
-  case gfxContext::OPERATOR_EXCLUSION:
-    return CompositionOp::OP_EXCLUSION;
-  case gfxContext::OPERATOR_HUE:
-    return CompositionOp::OP_HUE;
-  case gfxContext::OPERATOR_SATURATION:
-    return CompositionOp::OP_SATURATION;
-  case gfxContext::OPERATOR_COLOR:
-    return CompositionOp::OP_COLOR;
-  case gfxContext::OPERATOR_LUMINOSITY:
-    return CompositionOp::OP_LUMINOSITY;
-  default:
-    return CompositionOp::OP_OVER;
-  }
-}
-
-inline gfxContext::GraphicsOperator ThebesOp(CompositionOp aOp)
-{
-  switch (aOp) {
-  case CompositionOp::OP_ADD:
-    return gfxContext::OPERATOR_ADD;
-  case CompositionOp::OP_ATOP:
-    return gfxContext::OPERATOR_ATOP;
-  case CompositionOp::OP_IN:
-    return gfxContext::OPERATOR_IN;
-  case CompositionOp::OP_OUT:
-    return gfxContext::OPERATOR_OUT;
-  case CompositionOp::OP_SOURCE:
-    return gfxContext::OPERATOR_SOURCE;
-  case CompositionOp::OP_DEST_IN:
-    return gfxContext::OPERATOR_DEST_IN;
-  case CompositionOp::OP_DEST_OUT:
-    return gfxContext::OPERATOR_DEST_OUT;
-  case CompositionOp::OP_DEST_ATOP:
-    return gfxContext::OPERATOR_DEST_ATOP;
-  case CompositionOp::OP_XOR:
-    return gfxContext::OPERATOR_XOR;
-  case CompositionOp::OP_MULTIPLY:
-    return gfxContext::OPERATOR_MULTIPLY;
-  case CompositionOp::OP_SCREEN:
-    return gfxContext::OPERATOR_SCREEN;
-  case CompositionOp::OP_OVERLAY:
-    return gfxContext::OPERATOR_OVERLAY;
-  case CompositionOp::OP_DARKEN:
-    return gfxContext::OPERATOR_DARKEN;
-  case CompositionOp::OP_LIGHTEN:
-    return gfxContext::OPERATOR_LIGHTEN;
-  case CompositionOp::OP_COLOR_DODGE:
-    return gfxContext::OPERATOR_COLOR_DODGE;
-  case CompositionOp::OP_COLOR_BURN:
-    return gfxContext::OPERATOR_COLOR_BURN;
-  case CompositionOp::OP_HARD_LIGHT:
-    return gfxContext::OPERATOR_HARD_LIGHT;
-  case CompositionOp::OP_SOFT_LIGHT:
-    return gfxContext::OPERATOR_SOFT_LIGHT;
-  case CompositionOp::OP_DIFFERENCE:
-    return gfxContext::OPERATOR_DIFFERENCE;
-  case CompositionOp::OP_EXCLUSION:
-    return gfxContext::OPERATOR_EXCLUSION;
-  case CompositionOp::OP_HUE:
-    return gfxContext::OPERATOR_HUE;
-  case CompositionOp::OP_SATURATION:
-    return gfxContext::OPERATOR_SATURATION;
-  case CompositionOp::OP_COLOR:
-    return gfxContext::OPERATOR_COLOR;
-  case CompositionOp::OP_LUMINOSITY:
-    return gfxContext::OPERATOR_LUMINOSITY;
-  default:
-    return gfxContext::OPERATOR_OVER;
-  }
-}
-
 } // namespace gfx
 } // namespace mozilla
 
 #endif
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -489,25 +489,25 @@ gfxContext::SetLineWidth(gfxFloat width)
 
 gfxFloat
 gfxContext::CurrentLineWidth() const
 {
   return CurrentState().strokeOptions.mLineWidth;
 }
 
 void
-gfxContext::SetOperator(GraphicsOperator op)
+gfxContext::SetOp(CompositionOp aOp)
 {
-  CurrentState().op = CompositionOpForOp(op);
+  CurrentState().op = aOp;
 }
 
-gfxContext::GraphicsOperator
-gfxContext::CurrentOperator() const
+CompositionOp
+gfxContext::CurrentOp() const
 {
-  return ThebesOp(CurrentState().op);
+  return CurrentState().op;
 }
 
 void
 gfxContext::SetLineCap(CapStyle cap)
 {
   CurrentState().strokeOptions.mLineCap = cap;
 }
 
--- a/gfx/thebes/gfxContext.h
+++ b/gfx/thebes/gfxContext.h
@@ -41,16 +41,17 @@ class ClipExporter;
  * When a path is drawn (stroked or filled), it is filled/stroked with a
  * pattern set by SetPattern, SetColor or SetSource.
  *
  * Note that the gfxContext takes coordinates in device pixels,
  * as opposed to app units.
  */
 class gfxContext final {
     typedef mozilla::gfx::CapStyle CapStyle;
+    typedef mozilla::gfx::CompositionOp CompositionOp;
     typedef mozilla::gfx::JoinStyle JoinStyle;
     typedef mozilla::gfx::FillRule FillRule;
     typedef mozilla::gfx::Path Path;
     typedef mozilla::gfx::Pattern Pattern;
     typedef mozilla::gfx::Rect Rect;
     typedef mozilla::gfx::RectCornerRadii RectCornerRadii;
 
     NS_INLINE_DECL_REFCOUNTING(gfxContext)
@@ -366,62 +367,23 @@ public:
     /**
      ** Fill Properties
      **/
 
     void SetFillRule(FillRule rule);
     FillRule CurrentFillRule() const;
 
     /**
-     ** Operators and Rendering control
-     **/
-
-    // define enum for operators (clear, src, dst, etc)
-    enum GraphicsOperator {
-        OPERATOR_SOURCE,
-
-        OPERATOR_OVER,
-        OPERATOR_IN,
-        OPERATOR_OUT,
-        OPERATOR_ATOP,
-
-        OPERATOR_DEST,
-        OPERATOR_DEST_OVER,
-        OPERATOR_DEST_IN,
-        OPERATOR_DEST_OUT,
-        OPERATOR_DEST_ATOP,
-
-        OPERATOR_XOR,
-        OPERATOR_ADD,
-        OPERATOR_SATURATE,
-
-        OPERATOR_MULTIPLY,
-        OPERATOR_SCREEN,
-        OPERATOR_OVERLAY,
-        OPERATOR_DARKEN,
-        OPERATOR_LIGHTEN,
-        OPERATOR_COLOR_DODGE,
-        OPERATOR_COLOR_BURN,
-        OPERATOR_HARD_LIGHT,
-        OPERATOR_SOFT_LIGHT,
-        OPERATOR_DIFFERENCE,
-        OPERATOR_EXCLUSION,
-        OPERATOR_HUE,
-        OPERATOR_SATURATION,
-        OPERATOR_COLOR,
-        OPERATOR_LUMINOSITY
-    };
-    /**
      * Sets the operator used for all further drawing. The operator affects
      * how drawing something will modify the destination. For example, the
      * OVER operator will do alpha blending of source and destination, while
      * SOURCE will replace the destination with the source.
      */
-    void SetOperator(GraphicsOperator op);
-    GraphicsOperator CurrentOperator() const;
+    void SetOp(CompositionOp op);
+    CompositionOp CurrentOp() const;
 
     void SetAntialiasMode(mozilla::gfx::AntialiasMode mode);
     mozilla::gfx::AntialiasMode CurrentAntialiasMode() const;
 
     /**
      ** Clipping
      **/
 
@@ -472,17 +434,17 @@ public:
      * Like PushGroup, but if the current surface is gfxContentType::COLOR and
      * content is gfxContentType::COLOR_ALPHA, makes the pushed surface gfxContentType::COLOR
      * instead and copies the contents of the current surface to the pushed
      * surface. This is good for pushing opacity groups, since blending the
      * group back to the current surface with some alpha applied will give
      * the correct results and using an opaque pushed surface gives better
      * quality and performance.
      * This API really only makes sense if you do a PopGroupToSource and
-     * immediate Paint with OPERATOR_OVER.
+     * immediate Paint with OP_OVER.
      */
     void PushGroupAndCopyBackground(gfxContentType content = gfxContentType::COLOR);
     already_AddRefed<gfxPattern> PopGroup();
     void PopGroupToSource();
 
     already_AddRefed<mozilla::gfx::SourceSurface>
     PopGroupToSurface(mozilla::gfx::Matrix* aMatrix);
 
@@ -520,17 +482,16 @@ private:
   friend class PatternFromState;
   friend class GlyphBufferAzure;
 
   typedef mozilla::gfx::Matrix Matrix;
   typedef mozilla::gfx::DrawTarget DrawTarget;
   typedef mozilla::gfx::Color Color;
   typedef mozilla::gfx::StrokeOptions StrokeOptions;
   typedef mozilla::gfx::Float Float;
-  typedef mozilla::gfx::CompositionOp CompositionOp;
   typedef mozilla::gfx::PathBuilder PathBuilder;
   typedef mozilla::gfx::SourceSurface SourceSurface;
   
   struct AzureState {
     AzureState()
       : op(mozilla::gfx::CompositionOp::OP_OVER)
       , color(0, 0, 0, 1.0f)
       , clipWasReset(false)
--- a/gfx/thebes/gfxDrawable.cpp
+++ b/gfx/thebes/gfxDrawable.cpp
@@ -92,25 +92,24 @@ gfxSurfaceDrawable::DrawInternal(gfxCont
     patternTransform.Invert();
 
     SurfacePattern pattern(mSourceSurface, extend,
                            patternTransform, ToFilter(aFilter), aSamplingRect);
 
     Rect fillRect = ToRect(aFillRect);
     DrawTarget* dt = aContext->GetDrawTarget();
 
-    if (aContext->CurrentOperator() == gfxContext::OPERATOR_SOURCE &&
+    if (aContext->CurrentOp() == CompositionOp::OP_SOURCE &&
         aOpacity == 1.0) {
         // Emulate cairo operator source which is bound by mask!
         dt->ClearRect(fillRect);
         dt->FillRect(fillRect, pattern);
     } else {
         dt->FillRect(fillRect, pattern,
-                     DrawOptions(aOpacity,
-                                 CompositionOpForOp(aContext->CurrentOperator()),
+                     DrawOptions(aOpacity, aContext->CurrentOp(),
                                  aContext->CurrentAntialiasMode()));
     }
 }
 
 gfxCallbackDrawable::gfxCallbackDrawable(gfxDrawingCallback* aCallback,
                                          const IntSize aSize)
  : gfxDrawable(aSize)
  , mCallback(aCallback)
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -551,17 +551,17 @@ struct BufferAlphaColor {
         mContext->PushGroup(gfxContentType::COLOR_ALPHA);
         mAlpha = aAlphaColor.a;
     }
 
     void PopAlpha()
     {
         // pop the text, using the color alpha as the opacity
         mContext->PopGroupToSource();
-        mContext->SetOperator(gfxContext::OPERATOR_OVER);
+        mContext->SetOp(CompositionOp::OP_OVER);
         mContext->Paint(mAlpha);
         mContext->Restore();
     }
 
     gfxContext *mContext;
     gfxFloat mAlpha;
 };
 
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -392,30 +392,27 @@ IsSafeImageTransformComponent(gfxFloat a
 }
 
 #if !defined(MOZ_GFX_OPTIMIZE_MOBILE)
 /**
  * This returns the fastest operator to use for solid surfaces which have no
  * alpha channel or their alpha channel is uniformly opaque.
  * This differs per render mode.
  */
-static gfxContext::GraphicsOperator
-OptimalFillOperator()
+static CompositionOp
+OptimalFillOp()
 {
 #ifdef XP_WIN
     if (gfxWindowsPlatform::GetPlatform()->GetRenderMode() ==
         gfxWindowsPlatform::RENDER_DIRECT2D) {
         // D2D -really- hates operator source.
-        return gfxContext::OPERATOR_OVER;
-    } else {
-#endif
-        return gfxContext::OPERATOR_SOURCE;
-#ifdef XP_WIN
+        return CompositionOp::OP_OVER;
     }
 #endif
+    return CompositionOp::OP_SOURCE;
 }
 
 // EXTEND_PAD won't help us here; we have to create a temporary surface to hold
 // the subimage of pixels we're allowed to sample.
 static already_AddRefed<gfxDrawable>
 CreateSamplingRestrictedDrawable(gfxDrawable* aDrawable,
                                  gfxContext* aContext,
                                  const ImageRegion& aRegion,
@@ -450,17 +447,17 @@ CreateSamplingRestrictedDrawable(gfxDraw
 
     RefPtr<DrawTarget> target =
       gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(size, aFormat);
     if (!target) {
       return nullptr;
     }
 
     nsRefPtr<gfxContext> tmpCtx = new gfxContext(target);
-    tmpCtx->SetOperator(OptimalFillOperator());
+    tmpCtx->SetOp(OptimalFillOp());
     aDrawable->Draw(tmpCtx, needed - needed.TopLeft(), true,
                     GraphicsFilter::FILTER_FAST, 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
@@ -501,17 +498,17 @@ struct MOZ_STACK_CLASS AutoCairoPixmanBu
         // transformed fill area. This is the area for the group we
         // want to push.
         mContext->SetMatrix(gfxMatrix());
         gfxRect bounds = currentMatrix.TransformBounds(aFill);
         bounds.RoundOut();
         mContext->Clip(bounds);
         mContext->SetMatrix(currentMatrix);
         mContext->PushGroup(gfxContentType::COLOR_ALPHA);
-        mContext->SetOperator(gfxContext::OPERATOR_OVER);
+        mContext->SetOp(CompositionOp::OP_OVER);
 
         mPushedGroup = true;
     }
 
     ~AutoCairoPixmanBugWorkaround()
     {
         if (mPushedGroup) {
             mContext->PopGroupToSource();
@@ -689,19 +686,18 @@ PrescaleAndTileDrawable(gfxDrawable* aDr
     gfxContextMatrixAutoSaveRestore autoSR(aContext);
     Matrix withoutScale = ToMatrix(aContext->CurrentMatrix());
     DrawTarget* destDrawTarget = aContext->GetDrawTarget();
 
     // The translation still is in scaled units
     withoutScale.PreScale(1.0 / scaleFactor.width, 1.0 / scaleFactor.height);
     aContext->SetMatrix(ThebesMatrix(withoutScale));
 
-    DrawOptions drawOptions(aOpacity,
-        CompositionOpForOp(aContext->CurrentOperator()),
-        aContext->CurrentAntialiasMode());
+    DrawOptions drawOptions(aOpacity, aContext->CurrentOp(),
+                            aContext->CurrentAntialiasMode());
 
     SurfacePattern scaledImagePattern(scaledImage, ExtendMode::REPEAT,
                                       Matrix(), ToFilter(aFilter));
     destDrawTarget->FillRect(scaledNeededRect, scaledImagePattern, drawOptions);
   }
   return true;
 }
 #endif // MOZ_WIDGET_COCOA
--- a/gfx/thebes/gfxXlibNativeRenderer.cpp
+++ b/gfx/thebes/gfxXlibNativeRenderer.cpp
@@ -469,17 +469,17 @@ gfxXlibNativeRenderer::Draw(gfxContext* 
     gfxMatrix matrix = ctx->CurrentMatrix();
 
     // We can only draw direct or onto a copied background if pixels align and
     // native drawing is compatible with the current operator.  (The matrix is
     // actually also pixel-exact for flips and right-angle rotations, which
     // would permit copying the background but not drawing direct.)
     bool matrixIsIntegerTranslation = !matrix.HasNonIntegerTranslation();
     bool canDrawOverBackground = matrixIsIntegerTranslation &&
-        ctx->CurrentOperator() == gfxContext::OPERATOR_OVER;
+         ctx->CurrentOp() == CompositionOp::OP_OVER;
 
     // The padding of 0.5 for non-pixel-exact transformations used here is
     // the same as what _cairo_pattern_analyze_filter uses.
     const gfxFloat filterRadius = 0.5;
     gfxRect affectedRect(0.0, 0.0, size.width, size.height);
     if (!matrixIsIntegerTranslation) {
         // The filter footprint means that the affected rectangle is a
         // little larger than the drawingRect;
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -569,18 +569,17 @@ bool imgFrame::Draw(gfxContext* aContext
 
   if (mSinglePixel && !doPadding && !doPartialDecode) {
     if (mSinglePixelColor.a == 0.0) {
       return true;
     }
     RefPtr<DrawTarget> dt = aContext->GetDrawTarget();
     dt->FillRect(ToRect(aRegion.Rect()),
                  ColorPattern(mSinglePixelColor),
-                 DrawOptions(1.0f,
-                             CompositionOpForOp(aContext->CurrentOperator())));
+                 DrawOptions(1.0f, aContext->CurrentOp()));
     return true;
   }
 
   RefPtr<SourceSurface> surf = GetSurfaceInternal();
   if (!surf && !mSinglePixel) {
     return false;
   }
 
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -3001,34 +3001,34 @@ nsCSSRendering::PaintBackgroundWithSC(ns
           }
         }
       }
       if ((aLayer < 0 || i == (uint32_t)startLayer) &&
           !clipState.mDirtyRectGfx.IsEmpty()) {
         nsBackgroundLayerState state = PrepareBackgroundLayer(aPresContext, aForFrame,
             aFlags, paintBorderArea, clipState.mBGClipArea, layer);
         if (!state.mFillArea.IsEmpty()) {
-          if (state.mCompositingOp != gfxContext::OPERATOR_OVER) {
-            NS_ASSERTION(ctx->CurrentOperator() == gfxContext::OPERATOR_OVER,
-                         "It is assumed the initial operator is OPERATOR_OVER, when it is restored later");
-            ctx->SetOperator(state.mCompositingOp);
+          if (state.mCompositionOp != CompositionOp::OP_OVER) {
+            NS_ASSERTION(ctx->CurrentOp() == CompositionOp::OP_OVER,
+                         "It is assumed the initial op is OP_OVER, when it is restored later");
+            ctx->SetOp(state.mCompositionOp);
           }
 
           DrawResult resultForLayer =
             state.mImageRenderer.DrawBackground(aPresContext, aRenderingContext,
                                                 state.mDestArea, state.mFillArea,
                                                 state.mAnchor + paintBorderArea.TopLeft(),
                                                 clipState.mDirtyRect);
 
           if (result == DrawResult::SUCCESS) {
             result = resultForLayer;
           }
 
-          if (state.mCompositingOp != gfxContext::OPERATOR_OVER) {
-            ctx->SetOperator(gfxContext::OPERATOR_OVER);
+          if (state.mCompositionOp != CompositionOp::OP_OVER) {
+            ctx->SetOp(CompositionOp::OP_OVER);
           }
         }
       }
     }
   }
 
   return result;
 }
@@ -3322,17 +3322,17 @@ nsCSSRendering::PrepareBackgroundLayer(n
     state.mFillArea.width = bgClipRect.width;
   }
   if (repeatY == NS_STYLE_BG_REPEAT_REPEAT) {
     state.mFillArea.y = bgClipRect.y;
     state.mFillArea.height = bgClipRect.height;
   }
   state.mFillArea.IntersectRect(state.mFillArea, bgClipRect);
 
-  state.mCompositingOp = GetGFXBlendMode(aLayer.mBlendMode);
+  state.mCompositionOp = GetGFXBlendMode(aLayer.mBlendMode);
 
   return state;
 }
 
 nsRect
 nsCSSRendering::GetBackgroundLayerRect(nsPresContext* aPresContext,
                                        nsIFrame* aForFrame,
                                        const nsRect& aBorderArea,
@@ -4982,29 +4982,29 @@ nsImageRenderer::Draw(nsPresContext*    
       nsRefPtr<gfxDrawable> drawable = DrawableForElement(aDest,
                                                           aRenderingContext);
       if (!drawable) {
         NS_WARNING("Could not create drawable for element");
         return DrawResult::TEMPORARY_ERROR;
       }
 
       gfxContext* ctx = aRenderingContext.ThebesContext();
-      gfxContext::GraphicsOperator op = ctx->CurrentOperator();
-      if (op != gfxContext::OPERATOR_OVER) {
+      CompositionOp op = ctx->CurrentOp();
+      if (op != CompositionOp::OP_OVER) {
         ctx->PushGroup(gfxContentType::COLOR_ALPHA);
-        ctx->SetOperator(gfxContext::OPERATOR_OVER);
+        ctx->SetOp(CompositionOp::OP_OVER);
       }
 
       nsCOMPtr<imgIContainer> image(ImageOps::CreateFromDrawable(drawable));
       nsLayoutUtils::DrawImage(*aRenderingContext.ThebesContext(),
                                aPresContext, image,
                                filter, aDest, aFill, aAnchor, aDirtyRect,
                                ConvertImageRendererToDrawFlags(mFlags));
 
-      if (op != gfxContext::OPERATOR_OVER) {
+      if (op != CompositionOp::OP_OVER) {
         ctx->PopGroupToSource();
         ctx->Paint();
       }
 
       return DrawResult::SUCCESS;
     }
     case eStyleImageType_Null:
     default:
--- a/layout/base/nsCSSRendering.h
+++ b/layout/base/nsCSSRendering.h
@@ -292,21 +292,26 @@ private:
 };
 
 /**
  * A struct representing all the information needed to paint a background
  * image to some target, taking into account all CSS background-* properties.
  * See PrepareBackgroundLayer.
  */
 struct nsBackgroundLayerState {
+  typedef mozilla::gfx::CompositionOp CompositionOp;
+
   /**
    * @param aFlags some combination of nsCSSRendering::PAINTBG_* flags
    */
-  nsBackgroundLayerState(nsIFrame* aForFrame, const nsStyleImage* aImage, uint32_t aFlags)
-    : mImageRenderer(aForFrame, aImage, aFlags), mCompositingOp(gfxContext::OPERATOR_OVER) {}
+  nsBackgroundLayerState(nsIFrame* aForFrame, const nsStyleImage* aImage,
+                         uint32_t aFlags)
+    : mImageRenderer(aForFrame, aImage, aFlags)
+    , mCompositionOp(CompositionOp::OP_OVER)
+  {}
 
   /**
    * The nsImageRenderer that will be used to draw the background.
    */
   nsImageRenderer mImageRenderer;
   /**
    * A rectangle that one copy of the image tile is mapped onto. Same
    * coordinate system as aBorderArea/aBGClipRect passed into
@@ -321,22 +326,23 @@ struct nsBackgroundLayerState {
   nsRect mFillArea;
   /**
    * The anchor point that should be snapped to a pixel corner. Same
    * coordinate system as aBorderArea/aBGClipRect passed into
    * PrepareBackgroundLayer.
    */
   nsPoint mAnchor;
   /**
-   * The compositing operation that the image should use
+   * The composition operation that the image should use.
    */
-  gfxContext::GraphicsOperator mCompositingOp;
+  CompositionOp mCompositionOp;
 };
 
 struct nsCSSRendering {
+  typedef mozilla::gfx::CompositionOp CompositionOp;
   typedef mozilla::gfx::DrawTarget DrawTarget;
   typedef mozilla::gfx::Float Float;
   typedef mozilla::gfx::Point Point;
   typedef mozilla::gfx::Rect Rect;
   typedef mozilla::gfx::Size Size;
   typedef mozilla::gfx::RectCornerRadii RectCornerRadii;
   typedef mozilla::image::DrawResult DrawResult;
   typedef nsIFrame::Sides Sides;
@@ -751,38 +757,36 @@ struct nsCSSRendering {
                                       const gfxSize& aLineSize,
                                       const gfxFloat aAscent,
                                       const gfxFloat aOffset,
                                       const uint8_t aDecoration,
                                       const uint8_t aStyle,
                                       bool aVertical,
                                       const gfxFloat aDescentLimit = -1.0);
 
-  static gfxContext::GraphicsOperator GetGFXBlendMode(uint8_t mBlendMode) {
+  static CompositionOp GetGFXBlendMode(uint8_t mBlendMode) {
     switch (mBlendMode) {
-      case NS_STYLE_BLEND_NORMAL:      return gfxContext::OPERATOR_OVER;
-      case NS_STYLE_BLEND_MULTIPLY:    return gfxContext::OPERATOR_MULTIPLY;
-      case NS_STYLE_BLEND_SCREEN:      return gfxContext::OPERATOR_SCREEN;
-      case NS_STYLE_BLEND_OVERLAY:     return gfxContext::OPERATOR_OVERLAY;
-      case NS_STYLE_BLEND_DARKEN:      return gfxContext::OPERATOR_DARKEN;
-      case NS_STYLE_BLEND_LIGHTEN:     return gfxContext::OPERATOR_LIGHTEN;
-      case NS_STYLE_BLEND_COLOR_DODGE: return gfxContext::OPERATOR_COLOR_DODGE;
-      case NS_STYLE_BLEND_COLOR_BURN:  return gfxContext::OPERATOR_COLOR_BURN;
-      case NS_STYLE_BLEND_HARD_LIGHT:  return gfxContext::OPERATOR_HARD_LIGHT;
-      case NS_STYLE_BLEND_SOFT_LIGHT:  return gfxContext::OPERATOR_SOFT_LIGHT;
-      case NS_STYLE_BLEND_DIFFERENCE:  return gfxContext::OPERATOR_DIFFERENCE;
-      case NS_STYLE_BLEND_EXCLUSION:   return gfxContext::OPERATOR_EXCLUSION;
-      case NS_STYLE_BLEND_HUE:         return gfxContext::OPERATOR_HUE;
-      case NS_STYLE_BLEND_SATURATION:  return gfxContext::OPERATOR_SATURATION;
-      case NS_STYLE_BLEND_COLOR:       return gfxContext::OPERATOR_COLOR;
-      case NS_STYLE_BLEND_LUMINOSITY:  return gfxContext::OPERATOR_LUMINOSITY;
-      default:                         MOZ_ASSERT(false); return gfxContext::OPERATOR_OVER;
+      case NS_STYLE_BLEND_NORMAL:      return CompositionOp::OP_OVER;
+      case NS_STYLE_BLEND_MULTIPLY:    return CompositionOp::OP_MULTIPLY;
+      case NS_STYLE_BLEND_SCREEN:      return CompositionOp::OP_SCREEN;
+      case NS_STYLE_BLEND_OVERLAY:     return CompositionOp::OP_OVERLAY;
+      case NS_STYLE_BLEND_DARKEN:      return CompositionOp::OP_DARKEN;
+      case NS_STYLE_BLEND_LIGHTEN:     return CompositionOp::OP_LIGHTEN;
+      case NS_STYLE_BLEND_COLOR_DODGE: return CompositionOp::OP_COLOR_DODGE;
+      case NS_STYLE_BLEND_COLOR_BURN:  return CompositionOp::OP_COLOR_BURN;
+      case NS_STYLE_BLEND_HARD_LIGHT:  return CompositionOp::OP_HARD_LIGHT;
+      case NS_STYLE_BLEND_SOFT_LIGHT:  return CompositionOp::OP_SOFT_LIGHT;
+      case NS_STYLE_BLEND_DIFFERENCE:  return CompositionOp::OP_DIFFERENCE;
+      case NS_STYLE_BLEND_EXCLUSION:   return CompositionOp::OP_EXCLUSION;
+      case NS_STYLE_BLEND_HUE:         return CompositionOp::OP_HUE;
+      case NS_STYLE_BLEND_SATURATION:  return CompositionOp::OP_SATURATION;
+      case NS_STYLE_BLEND_COLOR:       return CompositionOp::OP_COLOR;
+      case NS_STYLE_BLEND_LUMINOSITY:  return CompositionOp::OP_LUMINOSITY;
+      default:      MOZ_ASSERT(false); return CompositionOp::OP_OVER;
     }
-
-    return gfxContext::OPERATOR_OVER;
   }
 
 protected:
   static gfxRect GetTextDecorationRectInternal(const gfxPoint& aPt,
                                                const gfxSize& aLineSize,
                                                const gfxFloat aAscent,
                                                const gfxFloat aOffset,
                                                const uint8_t aDecoration,
--- a/layout/base/nsCSSRenderingBorders.cpp
+++ b/layout/base/nsCSSRenderingBorders.cpp
@@ -1685,17 +1685,17 @@ nsCSSBorderRenderer::DrawBorders()
       !mAvoidStroke)
   {
     // Easy enough to deal with.
     DrawRectangularCompositeColors();
     return;
   }
 
   // If we have composite colors -and- border radius,
-  // then use separate corners so we get OPERATOR_ADD for the corners.
+  // then use separate corners so we get OP_ADD for the corners.
   // Otherwise, we'll get artifacts as we draw stacked 1px-wide curves.
   if (allBordersSame && mCompositeColors[0] != nullptr && !mNoBorderRadius)
     forceSeparateCorners = true;
 
   PrintAsString(" mOuterRect: "), PrintAsString(mOuterRect), PrintAsStringNewline();
   PrintAsString(" mInnerRect: "), PrintAsString(mInnerRect), PrintAsStringNewline();
   PrintAsFormatString(" mBorderColors: 0x%08x 0x%08x 0x%08x 0x%08x\n", mBorderColors[0], mBorderColors[1], mBorderColors[2], mBorderColors[3]);
 
@@ -1793,17 +1793,17 @@ nsCSSBorderRenderer::DrawBorders()
       // clip to the corner
       mDrawTarget->PushClipRect(GetCornerRect(corner));
 
       if (simpleCornerStyle) {
         // we don't need a group for this corner, the sides are the same,
         // but we weren't able to render just a solid block for the corner.
         DrawBorderSides(sideBits);
       } else {
-        // Sides are different.  We could draw using OPERATOR_ADD to
+        // Sides are different.  We could draw using OP_ADD to
         // get correct color blending behaviour at the seam.  We'd need
         // to do it in an offscreen surface to ensure that we're
         // always compositing on transparent black.  If the colors
         // don't have transparency and the current destination surface
         // has an alpha channel, we could just clear the region and
         // avoid the temporary, but that situation doesn't happen all
         // that often in practice (we double buffer to no-alpha
         // surfaces). We choose just to seam though, as the performance
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -668,18 +668,17 @@ static void MarkFrameForDisplay(nsIFrame
       break;
     }
   }
 }
 
 void nsDisplayListBuilder::SetContainsBlendMode(uint8_t aBlendMode)
 {
   MOZ_ASSERT(aBlendMode != NS_STYLE_BLEND_NORMAL);
-  gfxContext::GraphicsOperator op = nsCSSRendering::GetGFXBlendMode(aBlendMode);
-  mContainedBlendModes += gfx::CompositionOpForOp(op);
+  mContainedBlendModes += nsCSSRendering::GetGFXBlendMode(aBlendMode);
 }
 
 bool nsDisplayListBuilder::NeedToForceTransparentSurfaceForItem(nsDisplayItem* aItem)
 {
   return aItem == mGlassDisplayItem || aItem->ClearsBackground();
 }
 
 void nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
@@ -4015,21 +4014,21 @@ nsRegion nsDisplayMixBlendMode::GetOpaqu
   return nsRegion();
 }
 
 LayerState
 nsDisplayMixBlendMode::GetLayerState(nsDisplayListBuilder* aBuilder,
                                      LayerManager* aManager,
                                      const ContainerLayerParameters& aParameters)
 {
-  gfxContext::GraphicsOperator op = nsCSSRendering::GetGFXBlendMode(mFrame->StyleDisplay()->mMixBlendMode);
-  if (aManager->SupportsMixBlendMode(gfx::CompositionOpForOp(op))) {
-    return LAYER_ACTIVE;
-  }
-  return LAYER_INACTIVE;
+  CompositionOp op =
+    nsCSSRendering::GetGFXBlendMode(mFrame->StyleDisplay()->mMixBlendMode);
+  return aManager->SupportsMixBlendMode(op)
+       ? LAYER_ACTIVE
+       : LAYER_INACTIVE;
 }
 
 // nsDisplayMixBlendMode uses layers for rendering
 already_AddRefed<Layer>
 nsDisplayMixBlendMode::BuildLayer(nsDisplayListBuilder* aBuilder,
                                   LayerManager* aManager,
                                   const ContainerLayerParameters& aContainerParameters) {
   ContainerLayerParameters newContainerParameters = aContainerParameters;
@@ -4037,17 +4036,17 @@ nsDisplayMixBlendMode::BuildLayer(nsDisp
 
   nsRefPtr<Layer> container = aManager->GetLayerBuilder()->
   BuildContainerLayerFor(aBuilder, aManager, mFrame, this, &mList,
                          newContainerParameters, nullptr);
   if (!container) {
     return nullptr;
   }
 
-  container->DeprecatedSetMixBlendMode(nsCSSRendering::GetGFXBlendMode(mFrame->StyleDisplay()->mMixBlendMode));
+  container->SetMixBlendMode(nsCSSRendering::GetGFXBlendMode(mFrame->StyleDisplay()->mMixBlendMode));
 
   return container.forget();
 }
 
 bool nsDisplayMixBlendMode::ComputeVisibility(nsDisplayListBuilder* aBuilder,
                                               nsRegion* aVisibleRegion) {
   // Our children are need their backdrop so we should not allow them to subtract
   // area from aVisibleRegion. We do need to find out what is visible under
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -4643,44 +4643,44 @@ PresShell::RenderDocument(const nsRect& 
     // Nothing to paint, just fill the rect
     aThebesContext->SetColor(Color::FromABGR(aBackgroundColor));
     aThebesContext->Fill();
     return NS_OK;
   }
 
   gfxContextAutoSaveRestore save(aThebesContext);
 
-  gfxContext::GraphicsOperator oldOperator = aThebesContext->CurrentOperator();
-  if (oldOperator == gfxContext::OPERATOR_OVER) {
+  CompositionOp oldOp = aThebesContext->CurrentOp();
+  if (oldOp == CompositionOp::OP_OVER) {
     // Clip to the destination rectangle before we push the group,
     // to limit the size of the temporary surface
     aThebesContext->Clip();
   }
 
   // we want the window to be composited as a single image using
-  // whatever operator was set; set OPERATOR_OVER here, which is
+  // whatever operator was set; set OP_OVER here, which is
   // either already the case, or overrides the operator in a group.
   // the original operator will be present when we PopGroup.
-  // we can avoid using a temporary surface if we're using OPERATOR_OVER
-  bool needsGroup = oldOperator != gfxContext::OPERATOR_OVER;
+  // we can avoid using a temporary surface if we're using OP_OVER
+  bool needsGroup = oldOp != CompositionOp::OP_OVER;
 
   if (needsGroup) {
     aThebesContext->PushGroup(NS_GET_A(aBackgroundColor) == 0xff ?
                               gfxContentType::COLOR :
                               gfxContentType::COLOR_ALPHA);
     aThebesContext->Save();
 
-    if (oldOperator != gfxContext::OPERATOR_OVER) {
+    if (oldOp != CompositionOp::OP_OVER) {
       // Clip now while we paint to the temporary surface. For
       // non-source-bounded operators (e.g., SOURCE), we need to do clip
       // here after we've pushed the group, so that eventually popping
       // the group and painting it will be able to clear the entire
       // destination surface.
       aThebesContext->Clip();
-      aThebesContext->SetOperator(gfxContext::OPERATOR_OVER);
+      aThebesContext->SetOp(CompositionOp::OP_OVER);
     }
   }
 
   nsDeviceContext* devCtx = mPresContext->DeviceContext();
 
   gfxPoint offset(-nsPresContext::AppUnitsToFloatCSSPixels(aRect.x),
                   -nsPresContext::AppUnitsToFloatCSSPixels(aRect.y));
   gfxFloat scale = gfxFloat(devCtx->AppUnitsPerDevPixel())/nsPresContext::AppUnitsPerCSSPixel();
--- a/layout/svg/nsSVGImageFrame.cpp
+++ b/layout/svg/nsSVGImageFrame.cpp
@@ -400,17 +400,17 @@ nsSVGImageFrame::PaintSVG(gfxContext& aC
         nsLayoutUtils::GetGraphicsFilterForFrame(this),
         nsPoint(0, 0),
         aDirtyRect ? &dirtyRect : nullptr,
         drawFlags);
     }
 
     if (opacity != 1.0f || StyleDisplay()->mMixBlendMode != NS_STYLE_BLEND_NORMAL) {
       aContext.PopGroupToSource();
-      aContext.SetOperator(gfxContext::OPERATOR_OVER);
+      aContext.SetOp(CompositionOp::OP_OVER);
       aContext.Paint(opacity);
     }
     // gfxContextAutoSaveRestore goes out of scope & cleans up our gfxContext
   }
 
   return rv;
 }
 
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -2232,17 +2232,17 @@ nsWindow::OnExposeEvent(cairo_t *cr)
     // operations below if that happened - it will lead to XError and exit().
     if (shaped) {
         if (MOZ_LIKELY(!mIsDestroyed)) {
             if (painted) {
                 nsRefPtr<gfxPattern> pattern = ctx->PopGroup();
 
                 UpdateAlpha(pattern, boundsRect);
 
-                ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
+                ctx->SetOp(CompositionOp::OP_SOURCE);
                 ctx->SetPattern(pattern);
                 ctx->Paint();
             }
         }
     }
 #  ifdef MOZ_HAVE_SHMIMAGE
     if (mShmImage && MOZ_LIKELY(!mIsDestroyed)) {
       mShmImage->Put(mXDisplay, mXWindow, region);