aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFUtils.h
diff options
context:
space:
mode:
authorGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-21 19:59:04 +0000
committerGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-21 19:59:04 +0000
commitbd960c7f1915c73ceec1c1ee7cd23b48107cb0bd (patch)
tree4d64156fcda4716ed005756de5921d204ae3466f /src/pdf/SkPDFUtils.h
parent6970557055acaed619d7bb89451868e1570249b2 (diff)
[PDF] Move most of the headers to be private.
Compute font stats in SkPDFDocument in order to make more of the headers private. Previous review: https://codereview.appspot.com/5865048/ Review URL: https://codereview.appspot.com/5868049 git-svn-id: http://skia.googlecode.com/svn/trunk@3457 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf/SkPDFUtils.h')
-rw-r--r--src/pdf/SkPDFUtils.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/pdf/SkPDFUtils.h b/src/pdf/SkPDFUtils.h
new file mode 100644
index 0000000000..5b9d74e321
--- /dev/null
+++ b/src/pdf/SkPDFUtils.h
@@ -0,0 +1,54 @@
+
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+
+#ifndef SkPDFUtils_DEFINED
+#define SkPDFUtils_DEFINED
+
+#include "SkPath.h"
+
+class SkMatrix;
+class SkPath;
+class SkPDFArray;
+struct SkRect;
+
+#if 0
+#define PRINT_NOT_IMPL(str) fprintf(stderr, str)
+#else
+#define PRINT_NOT_IMPL(str)
+#endif
+
+#define NOT_IMPLEMENTED(condition, assert) \
+ do { \
+ if (condition) { \
+ PRINT_NOT_IMPL("NOT_IMPLEMENTED: " #condition "\n"); \
+ SkDEBUGCODE(SkASSERT(!assert);) \
+ } \
+ } while (0)
+
+class SkPDFUtils {
+public:
+ static SkPDFArray* MatrixToArray(const SkMatrix& matrix);
+ static void AppendTransform(const SkMatrix& matrix, SkWStream* content);
+
+ static void MoveTo(SkScalar x, SkScalar y, SkWStream* content);
+ static void AppendLine(SkScalar x, SkScalar y, SkWStream* content);
+ static void AppendCubic(SkScalar ctl1X, SkScalar ctl1Y,
+ SkScalar ctl2X, SkScalar ctl2Y,
+ SkScalar dstX, SkScalar dstY, SkWStream* content);
+ static void AppendRectangle(const SkRect& rect, SkWStream* content);
+ static void EmitPath(const SkPath& path, SkWStream* content);
+ static void ClosePath(SkWStream* content);
+ static void PaintPath(SkPaint::Style style, SkPath::FillType fill,
+ SkWStream* content);
+ static void StrokePath(SkWStream* content);
+ static void DrawFormXObject(int objectIndex, SkWStream* content);
+ static void ApplyGraphicState(int objectIndex, SkWStream* content);
+};
+
+#endif