gfx/skia/trunk/src/pdf/SkPDFUtils.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.

     2 /*
     3  * Copyright 2011 Google Inc.
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef SkPDFUtils_DEFINED
    11 #define SkPDFUtils_DEFINED
    13 #include "SkPaint.h"
    14 #include "SkPath.h"
    16 class SkMatrix;
    17 class SkPath;
    18 class SkPDFArray;
    19 struct SkRect;
    20 class SkWStream;
    22 #if 0
    23 #define PRINT_NOT_IMPL(str) fprintf(stderr, str)
    24 #else
    25 #define PRINT_NOT_IMPL(str)
    26 #endif
    28 #define NOT_IMPLEMENTED(condition, assert)                         \
    29     do {                                                           \
    30         if ((bool)(condition)) {                                   \
    31             PRINT_NOT_IMPL("NOT_IMPLEMENTED: " #condition "\n");   \
    32             SkDEBUGCODE(SkASSERT(!assert);)                        \
    33         }                                                          \
    34     } while (0)
    36 class SkPDFUtils {
    37 public:
    38     static SkPDFArray* RectToArray(const SkRect& rect);
    39     static SkPDFArray* MatrixToArray(const SkMatrix& matrix);
    40     static void AppendTransform(const SkMatrix& matrix, SkWStream* content);
    42     static void MoveTo(SkScalar x, SkScalar y, SkWStream* content);
    43     static void AppendLine(SkScalar x, SkScalar y, SkWStream* content);
    44     static void AppendCubic(SkScalar ctl1X, SkScalar ctl1Y,
    45                             SkScalar ctl2X, SkScalar ctl2Y,
    46                             SkScalar dstX, SkScalar dstY, SkWStream* content);
    47     static void AppendRectangle(const SkRect& rect, SkWStream* content);
    48     static void EmitPath(const SkPath& path, SkPaint::Style paintStyle,
    49                          SkWStream* content);
    50     static void ClosePath(SkWStream* content);
    51     static void PaintPath(SkPaint::Style style, SkPath::FillType fill,
    52                           SkWStream* content);
    53     static void StrokePath(SkWStream* content);
    54     static void DrawFormXObject(int objectIndex, SkWStream* content);
    55     static void ApplyGraphicState(int objectIndex, SkWStream* content);
    56     static void ApplyPattern(int objectIndex, SkWStream* content);
    57 };
    59 #endif

mercurial