| 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 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1543 | 1543 |
| 1544 bool SkPDFDevice::handleRectAnnotation(const SkRect& r, const SkMatrix& matrix, | 1544 bool SkPDFDevice::handleRectAnnotation(const SkRect& r, const SkMatrix& matrix, |
| 1545 const SkPaint& p) { | 1545 const SkPaint& p) { |
| 1546 SkAnnotation* annotationInfo = p.getAnnotation(); | 1546 SkAnnotation* annotationInfo = p.getAnnotation(); |
| 1547 if (!annotationInfo) { | 1547 if (!annotationInfo) { |
| 1548 return false; | 1548 return false; |
| 1549 } | 1549 } |
| 1550 SkData* urlData = annotationInfo->find(SkAnnotationKeys::URL_Key()); | 1550 SkData* urlData = annotationInfo->find(SkAnnotationKeys::URL_Key()); |
| 1551 if (urlData) { | 1551 if (urlData) { |
| 1552 handleLinkToURL(urlData, r, matrix); | 1552 handleLinkToURL(urlData, r, matrix); |
| 1553 return p.isNoDrawAnnotation(); | 1553 return p.getAnnotation() != NULL; |
| 1554 } | 1554 } |
| 1555 SkData* linkToName = annotationInfo->find(SkAnnotationKeys::Link_Named_Dest_
Key()); | 1555 SkData* linkToName = annotationInfo->find(SkAnnotationKeys::Link_Named_Dest_
Key()); |
| 1556 if (linkToName) { | 1556 if (linkToName) { |
| 1557 handleLinkToNamedDest(linkToName, r, matrix); | 1557 handleLinkToNamedDest(linkToName, r, matrix); |
| 1558 return p.isNoDrawAnnotation(); | 1558 return p.getAnnotation() != NULL; |
| 1559 } | 1559 } |
| 1560 return false; | 1560 return false; |
| 1561 } | 1561 } |
| 1562 | 1562 |
| 1563 bool SkPDFDevice::handlePointAnnotation(const SkPoint* points, size_t count, | 1563 bool SkPDFDevice::handlePointAnnotation(const SkPoint* points, size_t count, |
| 1564 const SkMatrix& matrix, | 1564 const SkMatrix& matrix, |
| 1565 const SkPaint& paint) { | 1565 const SkPaint& paint) { |
| 1566 SkAnnotation* annotationInfo = paint.getAnnotation(); | 1566 SkAnnotation* annotationInfo = paint.getAnnotation(); |
| 1567 if (!annotationInfo) { | 1567 if (!annotationInfo) { |
| 1568 return false; | 1568 return false; |
| 1569 } | 1569 } |
| 1570 SkData* nameData = annotationInfo->find(SkAnnotationKeys::Define_Named_Dest_
Key()); | 1570 SkData* nameData = annotationInfo->find(SkAnnotationKeys::Define_Named_Dest_
Key()); |
| 1571 if (nameData) { | 1571 if (nameData) { |
| 1572 for (size_t i = 0; i < count; i++) { | 1572 for (size_t i = 0; i < count; i++) { |
| 1573 defineNamedDestination(nameData, points[i], matrix); | 1573 defineNamedDestination(nameData, points[i], matrix); |
| 1574 } | 1574 } |
| 1575 return paint.isNoDrawAnnotation(); | 1575 return paint.getAnnotation() != NULL; |
| 1576 } | 1576 } |
| 1577 return false; | 1577 return false; |
| 1578 } | 1578 } |
| 1579 | 1579 |
| 1580 SkPDFDict* SkPDFDevice::createLinkAnnotation(const SkRect& r, const SkMatrix& ma
trix) { | 1580 SkPDFDict* SkPDFDevice::createLinkAnnotation(const SkRect& r, const SkMatrix& ma
trix) { |
| 1581 SkMatrix transform = matrix; | 1581 SkMatrix transform = matrix; |
| 1582 transform.postConcat(fInitialTransform); | 1582 transform.postConcat(fInitialTransform); |
| 1583 SkRect translatedRect; | 1583 SkRect translatedRect; |
| 1584 transform.mapRect(&translatedRect, r); | 1584 transform.mapRect(&translatedRect, r); |
| 1585 | 1585 |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2138 } | 2138 } |
| 2139 | 2139 |
| 2140 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, | 2140 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, |
| 2141 SkCanvas::Config8888) { | 2141 SkCanvas::Config8888) { |
| 2142 return false; | 2142 return false; |
| 2143 } | 2143 } |
| 2144 | 2144 |
| 2145 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { | 2145 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { |
| 2146 return false; | 2146 return false; |
| 2147 } | 2147 } |
| OLD | NEW |