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.

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

mercurial