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 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 | 1600 |
1601 bool SkPDFDevice::handleRectAnnotation(const SkRect& r, const SkMatrix& matrix, | 1601 bool SkPDFDevice::handleRectAnnotation(const SkRect& r, const SkMatrix& matrix, |
1602 const SkPaint& p) { | 1602 const SkPaint& p) { |
1603 SkAnnotation* annotationInfo = p.getAnnotation(); | 1603 SkAnnotation* annotationInfo = p.getAnnotation(); |
1604 if (!annotationInfo) { | 1604 if (!annotationInfo) { |
1605 return false; | 1605 return false; |
1606 } | 1606 } |
1607 SkData* urlData = annotationInfo->find(SkAnnotationKeys::URL_Key()); | 1607 SkData* urlData = annotationInfo->find(SkAnnotationKeys::URL_Key()); |
1608 if (urlData) { | 1608 if (urlData) { |
1609 handleLinkToURL(urlData, r, matrix); | 1609 handleLinkToURL(urlData, r, matrix); |
1610 return p.isNoDrawAnnotation(); | 1610 return p.getAnnotation() != NULL; |
1611 } | 1611 } |
1612 SkData* linkToName = annotationInfo->find( | 1612 SkData* linkToName = annotationInfo->find( |
1613 SkAnnotationKeys::Link_Named_Dest_Key()); | 1613 SkAnnotationKeys::Link_Named_Dest_Key()); |
1614 if (linkToName) { | 1614 if (linkToName) { |
1615 handleLinkToNamedDest(linkToName, r, matrix); | 1615 handleLinkToNamedDest(linkToName, r, matrix); |
1616 return p.isNoDrawAnnotation(); | 1616 return p.getAnnotation() != NULL; |
1617 } | 1617 } |
1618 return false; | 1618 return false; |
1619 } | 1619 } |
1620 | 1620 |
1621 bool SkPDFDevice::handlePointAnnotation(const SkPoint* points, size_t count, | 1621 bool SkPDFDevice::handlePointAnnotation(const SkPoint* points, size_t count, |
1622 const SkMatrix& matrix, | 1622 const SkMatrix& matrix, |
1623 const SkPaint& paint) { | 1623 const SkPaint& paint) { |
1624 SkAnnotation* annotationInfo = paint.getAnnotation(); | 1624 SkAnnotation* annotationInfo = paint.getAnnotation(); |
1625 if (!annotationInfo) { | 1625 if (!annotationInfo) { |
1626 return false; | 1626 return false; |
1627 } | 1627 } |
1628 SkData* nameData = annotationInfo->find( | 1628 SkData* nameData = annotationInfo->find( |
1629 SkAnnotationKeys::Define_Named_Dest_Key()); | 1629 SkAnnotationKeys::Define_Named_Dest_Key()); |
1630 if (nameData) { | 1630 if (nameData) { |
1631 for (size_t i = 0; i < count; i++) { | 1631 for (size_t i = 0; i < count; i++) { |
1632 defineNamedDestination(nameData, points[i], matrix); | 1632 defineNamedDestination(nameData, points[i], matrix); |
1633 } | 1633 } |
1634 return paint.isNoDrawAnnotation(); | 1634 return paint.getAnnotation() != NULL; |
1635 } | 1635 } |
1636 return false; | 1636 return false; |
1637 } | 1637 } |
1638 | 1638 |
1639 SkPDFDict* SkPDFDevice::createLinkAnnotation(const SkRect& r, | 1639 SkPDFDict* SkPDFDevice::createLinkAnnotation(const SkRect& r, |
1640 const SkMatrix& matrix) { | 1640 const SkMatrix& matrix) { |
1641 SkMatrix transform = matrix; | 1641 SkMatrix transform = matrix; |
1642 transform.postConcat(fInitialTransform); | 1642 transform.postConcat(fInitialTransform); |
1643 SkRect translatedRect; | 1643 SkRect translatedRect; |
1644 transform.mapRect(&translatedRect, r); | 1644 transform.mapRect(&translatedRect, r); |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2267 } | 2267 } |
2268 | 2268 |
2269 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, | 2269 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, |
2270 SkCanvas::Config8888) { | 2270 SkCanvas::Config8888) { |
2271 return false; | 2271 return false; |
2272 } | 2272 } |
2273 | 2273 |
2274 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { | 2274 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { |
2275 return false; | 2275 return false; |
2276 } | 2276 } |
OLD | NEW |