| 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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 } | 718 } |
| 719 inverse.mapVectors(&drawingSize, 1); | 719 inverse.mapVectors(&drawingSize, 1); |
| 720 SkISize size = SkSize::Make(drawingSize.fX, drawingSize.fY).toRound(); | 720 SkISize size = SkSize::Make(drawingSize.fX, drawingSize.fY).toRound(); |
| 721 info = SkImageInfo::MakeUnknown(abs(size.fWidth), abs(size.fHeight)); | 721 info = SkImageInfo::MakeUnknown(abs(size.fWidth), abs(size.fHeight)); |
| 722 } else { | 722 } else { |
| 723 info = SkImageInfo::MakeUnknown(abs(contentSize.fWidth), | 723 info = SkImageInfo::MakeUnknown(abs(contentSize.fWidth), |
| 724 abs(contentSize.fHeight)); | 724 abs(contentSize.fHeight)); |
| 725 } | 725 } |
| 726 | 726 |
| 727 SkBitmap bitmap; | 727 SkBitmap bitmap; |
| 728 bitmap.setInfo(info); | 728 bitmap.setConfig(info); |
| 729 return bitmap; | 729 return bitmap; |
| 730 } | 730 } |
| 731 | 731 |
| 732 // TODO(vandebo) change pageSize to SkSize. | 732 // TODO(vandebo) change pageSize to SkSize. |
| 733 // TODO: inherit from SkBaseDevice instead of SkBitmapDevice | 733 // TODO: inherit from SkBaseDevice instead of SkBitmapDevice |
| 734 SkPDFDevice::SkPDFDevice(const SkISize& pageSize, const SkISize& contentSize, | 734 SkPDFDevice::SkPDFDevice(const SkISize& pageSize, const SkISize& contentSize, |
| 735 const SkMatrix& initialTransform) | 735 const SkMatrix& initialTransform) |
| 736 : SkBitmapDevice(makeContentBitmap(contentSize, &initialTransform)), | 736 : SkBitmapDevice(makeContentBitmap(contentSize, &initialTransform)), |
| 737 fPageSize(pageSize), | 737 fPageSize(pageSize), |
| 738 fContentSize(contentSize), | 738 fContentSize(contentSize), |
| (...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2301 return; | 2301 return; |
| 2302 } | 2302 } |
| 2303 | 2303 |
| 2304 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), | 2304 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), |
| 2305 &content.entry()->fContent); | 2305 &content.entry()->fContent); |
| 2306 } | 2306 } |
| 2307 | 2307 |
| 2308 bool SkPDFDevice::allowImageFilter(const SkImageFilter*) { | 2308 bool SkPDFDevice::allowImageFilter(const SkImageFilter*) { |
| 2309 return false; | 2309 return false; |
| 2310 } | 2310 } |
| OLD | NEW |