| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkPDFDevice.h" | 8 #include "SkPDFDevice.h" |
| 9 | 9 |
| 10 #include "SkAnnotation.h" | 10 #include "SkAnnotation.h" |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 enum_must_match_value); | 578 enum_must_match_value); |
| 579 SK_COMPILE_ASSERT(SkPaint::kStrokeAndFill_Style == 2, | 579 SK_COMPILE_ASSERT(SkPaint::kStrokeAndFill_Style == 2, |
| 580 enum_must_match_value); | 580 enum_must_match_value); |
| 581 fContentStream->writeDecAsText(state.fTextFill); | 581 fContentStream->writeDecAsText(state.fTextFill); |
| 582 fContentStream->writeText(" Tr\n"); | 582 fContentStream->writeText(" Tr\n"); |
| 583 currentEntry()->fTextFill = state.fTextFill; | 583 currentEntry()->fTextFill = state.fTextFill; |
| 584 } | 584 } |
| 585 } | 585 } |
| 586 } | 586 } |
| 587 | 587 |
| 588 SkBaseDevice* SkPDFDevice::onCreateCompatibleDevice(SkBitmap::Config config, | 588 SkBaseDevice* SkPDFDevice::onCreateDevice(const SkImageInfo& info, Usage usage)
{ |
| 589 int width, int height, | |
| 590 bool isOpaque, | |
| 591 Usage usage) { | |
| 592 SkMatrix initialTransform; | 589 SkMatrix initialTransform; |
| 593 initialTransform.reset(); | 590 initialTransform.reset(); |
| 594 SkISize size = SkISize::Make(width, height); | 591 SkISize size = SkISize::Make(info.width(), info.height()); |
| 595 return SkNEW_ARGS(SkPDFDevice, (size, size, initialTransform)); | 592 return SkNEW_ARGS(SkPDFDevice, (size, size, initialTransform)); |
| 596 } | 593 } |
| 597 | 594 |
| 598 | 595 |
| 599 struct ContentEntry { | 596 struct ContentEntry { |
| 600 GraphicStateEntry fState; | 597 GraphicStateEntry fState; |
| 601 SkDynamicMemoryWStream fContent; | 598 SkDynamicMemoryWStream fContent; |
| 602 SkAutoTDelete<ContentEntry> fNext; | 599 SkAutoTDelete<ContentEntry> fNext; |
| 603 | 600 |
| 604 // If the stack is too deep we could get Stack Overflow. | 601 // If the stack is too deep we could get Stack Overflow. |
| (...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2325 } | 2322 } |
| 2326 | 2323 |
| 2327 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, | 2324 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, |
| 2328 SkCanvas::Config8888) { | 2325 SkCanvas::Config8888) { |
| 2329 return false; | 2326 return false; |
| 2330 } | 2327 } |
| 2331 | 2328 |
| 2332 bool SkPDFDevice::allowImageFilter(const SkImageFilter*) { | 2329 bool SkPDFDevice::allowImageFilter(const SkImageFilter*) { |
| 2333 return false; | 2330 return false; |
| 2334 } | 2331 } |
| OLD | NEW |