gfx/skia/trunk/src/pdf/SkPDFDeviceFlattener.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /*
     2  * Copyright 2013 Google Inc.
     3  *
     4  * Use of this source code is governed by a BSD-style license that can be
     5  * found in the LICENSE file.
     6  */
     8 #ifndef SkPDFDeviceFlattener_DEFINED
     9 #define SkPDFDeviceFlattener_DEFINED
    11 #include "SkPDFDevice.h"
    14 /** \class SkPDFDeviceFlattener
    16     The PDF Device Flattener is used to flatten features without native support in PDF.
    17     For now, the only one implemented is Perspective.
    19     TODO(edisonn): Rename the class once we know all the things it will do.
    20 */
    21 class SkPDFDeviceFlattener : public SkPDFDevice {
    22 private:
    23     typedef SkPDFDevice INHERITED;
    25     SK_API SkPDFDeviceFlattener(const SkSize& pageSize, const SkRect* trimBox = NULL);
    27 public:
    28     SK_API virtual ~SkPDFDeviceFlattener();
    30     virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode,
    31                             size_t count, const SkPoint[],
    32                             const SkPaint& paint) SK_OVERRIDE;
    33     virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint);
    34     virtual void drawPath(const SkDraw&, const SkPath& origpath,
    35                           const SkPaint& paint, const SkMatrix* prePathMatrix,
    36                           bool pathIsMutable) SK_OVERRIDE;
    37     virtual void drawText(const SkDraw&, const void* text, size_t len,
    38                           SkScalar x, SkScalar y, const SkPaint&) SK_OVERRIDE;
    39     virtual void drawPosText(const SkDraw&, const void* text, size_t len,
    40                              const SkScalar pos[], SkScalar constY,
    41                              int scalarsPerPos, const SkPaint&) SK_OVERRIDE;
    42     virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len,
    43                                 const SkPath& path, const SkMatrix* matrix,
    44                                 const SkPaint& paint) SK_OVERRIDE;
    45 private:
    47     bool mustFlatten(const SkDraw& d) const;
    48     bool mustPathText(const SkDraw& d, const SkPaint& paint);
    50     friend class SkDocument_PDF;
    51 };
    53 #endif  // SkPDFDeviceFlattener_DEFINED

mercurial