ctguil@chromium.org | f966fd3 | 2011-03-04 21:47:04 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 Google Inc. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef SkPDFUtils_DEFINED |
| 18 | #define SkPDFUtils_DEFINED |
| 19 | |
| 20 | #define NOT_IMPLEMENTED(condition, assert) \ |
| 21 | do { \ |
| 22 | if (condition) { \ |
| 23 | fprintf(stderr, "NOT_IMPLEMENTED: " #condition "\n"); \ |
| 24 | SkDEBUGCODE(SkASSERT(!assert);) \ |
| 25 | } \ |
| 26 | } while(0) |
| 27 | |
| 28 | class SkMatrix; |
| 29 | class SkPath; |
| 30 | class SkPDFArray; |
| 31 | |
| 32 | class SkPDFUtils { |
| 33 | public: |
| 34 | static SkPDFArray* MatrixToArray(const SkMatrix& matrix); |
vandebo@chromium.org | cae5fba | 2011-03-28 19:03:50 +0000 | [diff] [blame^] | 35 | |
| 36 | static void MoveTo(SkScalar x, SkScalar y, SkWStream* content); |
| 37 | static void AppendLine(SkScalar x, SkScalar y, SkWStream* content); |
ctguil@chromium.org | f966fd3 | 2011-03-04 21:47:04 +0000 | [diff] [blame] | 38 | static void AppendCubic(SkScalar ctl1X, SkScalar ctl1Y, |
| 39 | SkScalar ctl2X, SkScalar ctl2Y, |
vandebo@chromium.org | cae5fba | 2011-03-28 19:03:50 +0000 | [diff] [blame^] | 40 | SkScalar dstX, SkScalar dstY, SkWStream* content); |
ctguil@chromium.org | f966fd3 | 2011-03-04 21:47:04 +0000 | [diff] [blame] | 41 | static void AppendRectangle(SkScalar x, SkScalar y, SkScalar w, SkScalar h, |
vandebo@chromium.org | cae5fba | 2011-03-28 19:03:50 +0000 | [diff] [blame^] | 42 | SkWStream* content); |
| 43 | static void EmitPath(const SkPath& path, SkWStream* content); |
| 44 | static void ClosePath(SkWStream* content); |
ctguil@chromium.org | f966fd3 | 2011-03-04 21:47:04 +0000 | [diff] [blame] | 45 | static void PaintPath(SkPaint::Style style, SkPath::FillType fill, |
vandebo@chromium.org | cae5fba | 2011-03-28 19:03:50 +0000 | [diff] [blame^] | 46 | SkWStream* content); |
| 47 | static void StrokePath(SkWStream* content); |
ctguil@chromium.org | f966fd3 | 2011-03-04 21:47:04 +0000 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | #endif |