| 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 #ifndef UNICODE | 8 #ifndef UNICODE |
| 9 #define UNICODE | 9 #define UNICODE |
| 10 #endif | 10 #endif |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 //swap current canvas to new canvas | 1535 //swap current canvas to new canvas |
| 1536 this->fCurrentXpsCanvas.swap(newCanvas); | 1536 this->fCurrentXpsCanvas.swap(newCanvas); |
| 1537 | 1537 |
| 1538 return S_OK; | 1538 return S_OK; |
| 1539 } | 1539 } |
| 1540 | 1540 |
| 1541 void SkXPSDevice::convertToPpm(const SkMaskFilter* filter, | 1541 void SkXPSDevice::convertToPpm(const SkMaskFilter* filter, |
| 1542 SkMatrix* matrix, | 1542 SkMatrix* matrix, |
| 1543 SkVector* ppuScale, | 1543 SkVector* ppuScale, |
| 1544 const SkIRect& clip, SkIRect* clipIRect) { | 1544 const SkIRect& clip, SkIRect* clipIRect) { |
| 1545 //TODO: currently ignoring the ppm if blur ignoring transform. | |
| 1546 if (filter) { | |
| 1547 SkMaskFilter::BlurInfo blurInfo; | |
| 1548 SkMaskFilter::BlurType blurType = filter->asABlur(&blurInfo); | |
| 1549 | |
| 1550 if (SkMaskFilter::kNone_BlurType != blurType | |
| 1551 && blurInfo.fIgnoreTransform) { | |
| 1552 | |
| 1553 ppuScale->fX = SK_Scalar1; | |
| 1554 ppuScale->fY = SK_Scalar1; | |
| 1555 *clipIRect = clip; | |
| 1556 return; | |
| 1557 } | |
| 1558 } | |
| 1559 | |
| 1560 //This action is in unit space, but the ppm is specified in physical space. | 1545 //This action is in unit space, but the ppm is specified in physical space. |
| 1561 ppuScale->fX = SkScalarDiv(this->fCurrentPixelsPerMeter.fX, | 1546 ppuScale->fX = SkScalarDiv(this->fCurrentPixelsPerMeter.fX, |
| 1562 this->fCurrentUnitsPerMeter.fX); | 1547 this->fCurrentUnitsPerMeter.fX); |
| 1563 ppuScale->fY = SkScalarDiv(this->fCurrentPixelsPerMeter.fY, | 1548 ppuScale->fY = SkScalarDiv(this->fCurrentPixelsPerMeter.fY, |
| 1564 this->fCurrentUnitsPerMeter.fY); | 1549 this->fCurrentUnitsPerMeter.fY); |
| 1565 | 1550 |
| 1566 matrix->postScale(ppuScale->fX, ppuScale->fY); | 1551 matrix->postScale(ppuScale->fX, ppuScale->fY); |
| 1567 | 1552 |
| 1568 const SkIRect& irect = clip; | 1553 const SkIRect& irect = clip; |
| 1569 SkRect clipRect = SkRect::MakeLTRB( | 1554 SkRect clipRect = SkRect::MakeLTRB( |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2462 IID_PPV_ARGS(&this->fXpsFactory)), | 2447 IID_PPV_ARGS(&this->fXpsFactory)), |
| 2463 "Could not create factory for layer."); | 2448 "Could not create factory for layer."); |
| 2464 | 2449 |
| 2465 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), | 2450 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), |
| 2466 "Could not create canvas for layer."); | 2451 "Could not create canvas for layer."); |
| 2467 } | 2452 } |
| 2468 | 2453 |
| 2469 bool SkXPSDevice::allowImageFilter(SkImageFilter*) { | 2454 bool SkXPSDevice::allowImageFilter(SkImageFilter*) { |
| 2470 return false; | 2455 return false; |
| 2471 } | 2456 } |
| OLD | NEW |