tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PrintTargetRecording.h (1242B)


      1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
      2 * This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #ifndef MOZILLA_GFX_PRINTTARGETRECORDING_H
      7 #define MOZILLA_GFX_PRINTTARGETRECORDING_H
      8 
      9 #include "PrintTarget.h"
     10 
     11 namespace mozilla {
     12 namespace gfx {
     13 
     14 /**
     15 * Recording printing target.
     16 *
     17 * This exists for use on e10s's content process in order to record print
     18 * output, send it over to the parent process, and replay it on a DrawTarget
     19 * there for printing.
     20 */
     21 class PrintTargetRecording final : public PrintTarget {
     22 public:
     23  static already_AddRefed<PrintTargetRecording> CreateOrNull(
     24      const IntSize& aSize);
     25 
     26  already_AddRefed<DrawTarget> MakeDrawTarget(
     27      const IntSize& aSize, DrawEventRecorder* aRecorder = nullptr) override;
     28 
     29 private:
     30  PrintTargetRecording(cairo_surface_t* aCairoSurface, const IntSize& aSize);
     31 
     32  already_AddRefed<DrawTarget> CreateWrapAndRecordDrawTarget(
     33      DrawEventRecorder* aRecorder, DrawTarget* aDrawTarget);
     34 };
     35 
     36 }  // namespace gfx
     37 }  // namespace mozilla
     38 
     39 #endif /* MOZILLA_GFX_PRINTTARGETRECORDING_H */