Commit b3def22e authored by Andrew Osmond's avatar Andrew Osmond
Browse files

Bug 1728240 - Remove DrawTargetWrapAndRecord and gfx.2d.recording pref. r=jrmuizel

parent 4d1d84fe
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -239,8 +239,6 @@
@RESPATH@/chrome/pdfjs/*
@RESPATH@/chrome/toolkit@JAREXT@
@RESPATH@/chrome/toolkit.manifest
@RESPATH@/chrome/recording.manifest
@RESPATH@/chrome/recording/*
#ifdef MOZ_GTK
@RESPATH@/browser/chrome/icons/default/default16.png
@RESPATH@/browser/chrome/icons/default/default32.png
+0 −8
Original line number Diff line number Diff line
@@ -1839,11 +1839,6 @@ class GFX2D_API Factory {
  static void CopyDataSourceSurface(DataSourceSurface* aSource,
                                    DataSourceSurface* aDest);

  static already_AddRefed<DrawEventRecorder> CreateEventRecorderForFile(
      const char_type* aFilename);

  static void SetGlobalEventRecorder(DrawEventRecorder* aRecorder);

  static uint32_t GetMaxSurfaceSize(BackendType aType);

  static LogForwarder* GetLogForwarder() {
@@ -1972,9 +1967,6 @@ class GFX2D_API Factory {

  friend class DrawTargetD2D1;
#endif  // WIN32

 private:
  static DrawEventRecorder* mRecorder;
};

class MOZ_RAII AutoSerializeWithMoz2D final {
+0 −30
Original line number Diff line number Diff line
@@ -81,12 +81,6 @@ void DrawEventRecorderPrivate::DecrementUnscaledFontRefCount(
  }
}

void DrawEventRecorderFile::RecordEvent(const RecordedEvent& aEvent) {
  aEvent.RecordToStream(mOutputStream);

  Flush();
}

void DrawEventRecorderMemory::RecordEvent(const RecordedEvent& aEvent) {
  aEvent.RecordToStream(mOutputStream);
}
@@ -99,30 +93,6 @@ nsTHashSet<uint64_t>&& DrawEventRecorderMemory::TakeDependentSurfaces() {
  return std::move(mDependentSurfaces);
}

DrawEventRecorderFile::DrawEventRecorderFile(const char_type* aFilename)
    : mOutputStream(aFilename, std::ofstream::binary) {
  WriteHeader(mOutputStream);
}

DrawEventRecorderFile::~DrawEventRecorderFile() { mOutputStream.close(); }

void DrawEventRecorderFile::Flush() { mOutputStream.flush(); }

bool DrawEventRecorderFile::IsOpen() { return mOutputStream.is_open(); }

void DrawEventRecorderFile::OpenNew(const char_type* aFilename) {
  MOZ_ASSERT(!mOutputStream.is_open());

  mOutputStream.open(aFilename, std::ofstream::binary);
  WriteHeader(mOutputStream);
}

void DrawEventRecorderFile::Close() {
  MOZ_ASSERT(mOutputStream.is_open());

  mOutputStream.close();
}

DrawEventRecorderMemory::DrawEventRecorderMemory() {
  WriteHeader(mOutputStream);
}
+0 −36
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@
#include "2D.h"
#include "RecordedEvent.h"
#include "RecordingTypes.h"
#include "mozilla/FStream.h"

#include <unordered_set>
#include <unordered_map>
@@ -167,41 +166,6 @@ class DrawEventRecorderPrivate : public DrawEventRecorder {
  bool mExternalFonts;
};

class DrawEventRecorderFile : public DrawEventRecorderPrivate {
  using char_type = filesystem::Path::value_type;

 public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderFile, override)
  explicit DrawEventRecorderFile(const char_type* aFilename);
  virtual ~DrawEventRecorderFile();

  void RecordEvent(const RecordedEvent& aEvent) override;

  /**
   * Returns whether a recording file is currently open.
   */
  bool IsOpen();

  /**
   * Opens new file with the provided name. The recorder does NOT forget which
   * objects it has recorded. This can be used with Close, so that a recording
   * can be processed in chunks. The file must not already be open.
   */
  void OpenNew(const char_type* aFilename);

  /**
   * Closes the file so that it can be processed. The recorder does NOT forget
   * which objects it has recorded. This can be used with OpenNew, so that a
   * recording can be processed in chunks. The file must be open.
   */
  void Close();

 private:
  void Flush() override;

  mozilla::OFStream mOutputStream;
};

typedef std::function<void(MemStream& aStream,
                           std::vector<RefPtr<ScaledFont>>& aScaledFonts)>
    SerializeResourcesFn;
+0 −753

File deleted.

Preview size limit exceeded, changes collapsed.

Loading