Commit 0a29054e authored by longsonr's avatar longsonr
Browse files

Bug 1647101 - Move SVGTextFrame SVGViewFrame SVGFEContainerFrame...

Bug 1647101 - Move SVGTextFrame SVGViewFrame SVGFEContainerFrame SVGFEImageFrame SVGFELeafFrame SVGFEUnstyledLeafFrame into the mozilla namespace r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D80383
parent 366e3067
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -10,19 +10,19 @@
#include "SVGFilters.h"
#include "SVGAnimatedPreserveAspectRatio.h"

class SVGFEImageFrame;

nsresult NS_NewSVGFEImageElement(
    nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);

namespace mozilla {
class SVGFEImageFrame;

namespace dom {

typedef SVGFE SVGFEImageElementBase;

class SVGFEImageElement final : public SVGFEImageElementBase,
                                public nsImageLoadingContent {
  friend class ::SVGFEImageFrame;
  friend class mozilla::SVGFEImageFrame;

 protected:
  friend nsresult(::NS_NewSVGFEImageElement(
+3 −3
Original line number Diff line number Diff line
@@ -12,10 +12,10 @@
#include "SVGAnimatedEnumeration.h"
#include "SVGAnimatedLength.h"

class SVGTextFrame;

namespace mozilla {

class SVGTextFrame;

namespace dom {

struct DOMPointInit;
@@ -25,7 +25,7 @@ class SVGRect;
typedef SVGGraphicsElement SVGTextContentElementBase;

class SVGTextContentElement : public SVGTextContentElementBase {
  friend class ::SVGTextFrame;
  friend class mozilla::SVGTextFrame;

 public:
  using FragmentOrElement::TextLength;
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ static const uint16_t TEXTPATH_SIDETYPE_RIGHT = 2;
typedef SVGTextContentElement SVGTextPathElementBase;

class SVGTextPathElement final : public SVGTextPathElementBase {
  friend class ::SVGTextFrame;
  friend class mozilla::SVGTextFrame;

 protected:
  friend nsresult(::NS_NewSVGTextPathElement(
+2 −2
Original line number Diff line number Diff line
@@ -11,11 +11,11 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/EffectCompositor.h"
#include "mozilla/StaticPrefs_gfx.h"
#include "mozilla/SVGGeometryFrame.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/Logging.h"
#include "mozilla/gfx/Types.h"
#include "mozilla/layout/SVGGeometryFrame.h"
#include "mozilla/layers/AnimationHelper.h"
#include "mozilla/layers/ClipManager.h"
#include "mozilla/layers/ImageClient.h"
@@ -1113,7 +1113,7 @@ static bool IsItemProbablyActive(
      return true;
    }
    case DisplayItemType::TYPE_SVG_GEOMETRY: {
      auto* svgItem = static_cast<nsDisplaySVGGeometry*>(aItem);
      auto* svgItem = static_cast<DisplaySVGGeometry*>(aItem);
      return svgItem->ShouldBeActive(aBuilder, aResources, aSc, aManager,
                                     aDisplayListBuilder);
    }
+15 −12
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include "mozilla/StaticPrefs_image.h"
#include "mozilla/StaticPrefs_layers.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/SVGTextFrame.h"
#include "mozilla/Unused.h"
#include "mozilla/ViewportFrame.h"
#include "mozilla/ViewportUtils.h"
@@ -108,7 +109,6 @@
#include "nsSVGIntegrationUtils.h"
#include "nsSVGUtils.h"
#include "SVGImageContext.h"
#include "SVGTextFrame.h"
#include "nsStyleStructInlines.h"
#include "nsStyleTransformMatrix.h"
#include "nsIFrameInlines.h"
@@ -860,21 +860,22 @@ static nsRect GetDisplayPortFromMarginsData(
    posAlignment = ScreenSize(1, 1);
    sizeAlignment = ScreenSize(1, 1);
  } else if (useWebRender) {
    // With WebRender we benefit from updating the displaylist and scene less often.
    // For this we need to move the displayport less often which we achieve by using
    // larger alignments for the displayport's position.
    // With WebRender we benefit from updating the displaylist and scene less
    // often. For this we need to move the displayport less often which we
    // achieve by using larger alignments for the displayport's position.
    float w = screenRect.width;
    float h = screenRect.height;
    // Scale the alignment so that we never move by more than a quarter of the total
    // unaligned displayport size. At most (1.0) we move by a screenful of content.
    // Scale the alignment so that we never move by more than a quarter of the
    // total unaligned displayport size. At most (1.0) we move by a screenful of
    // content.
    float sx = fmin(1.0, (aMarginsData->mMargins.LeftRight() + w) / w * 0.25);
    float sy = fmin(1.0, (aMarginsData->mMargins.TopBottom() + h) / h * 0.25);
    posAlignment.width = fmax(128.0, 512.0 * round(sx * w / 512.0));
    posAlignment.height = fmax(128.0, 512.0 * round(sy * h / 512.0));
    // tscrollx is very sensitive to the size of the displayport. We could just accept
    // the regression and change it to something larger if need be, however smaller
    // displayports also means less CPU work for most stages in webrender so we generally
    // want to avoid very large displayports.
    // tscrollx is very sensitive to the size of the displayport. We could just
    // accept the regression and change it to something larger if need be,
    // however smaller displayports also means less CPU work for most stages in
    // webrender so we generally want to avoid very large displayports.
    sizeAlignment = ScreenSize(128, 128);
  } else if (StaticPrefs::layers_enable_tiles_AtStartup()) {
    // Don't align to tiles if they are too large, because we could expand
@@ -963,8 +964,10 @@ static nsRect GetDisplayPortFromMarginsData(
  screenRect += scrollPosScreen;
  float x = posAlignment.width * floor(screenRect.x / posAlignment.width);
  float y = posAlignment.height * floor(screenRect.y / posAlignment.height);
  float w = sizeAlignment.width * ceil(screenRect.width / sizeAlignment.width + 1);
  float h = sizeAlignment.height * ceil(screenRect.height / sizeAlignment.height + 1);
  float w =
      sizeAlignment.width * ceil(screenRect.width / sizeAlignment.width + 1);
  float h =
      sizeAlignment.height * ceil(screenRect.height / sizeAlignment.height + 1);
  screenRect = ScreenRect(x, y, w, h);
  screenRect -= scrollPosScreen;

Loading