Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Side by Side Diff: src/device/xps/SkXPSDevice.cpp

Issue 18110012: Add canFilterMaskGPU & filterMaskGPU to SkMaskFilter (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: added comments & fixed nits Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698