| 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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
| 9 | 9 |
| 10 #include "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 bool draw_mask(GrContext* context, const SkMatrix& viewMatrix, const SkRect& mas
kRect, | 575 bool draw_mask(GrContext* context, const SkMatrix& viewMatrix, const SkRect& mas
kRect, |
| 576 GrPaint* grp, GrTexture* mask) { | 576 GrPaint* grp, GrTexture* mask) { |
| 577 if (!grp->localCoordChangeInverse(viewMatrix)) { | 577 if (!grp->localCoordChangeInverse(viewMatrix)) { |
| 578 return false; | 578 return false; |
| 579 } | 579 } |
| 580 | 580 |
| 581 SkMatrix matrix; | 581 SkMatrix matrix; |
| 582 matrix.setTranslate(-maskRect.fLeft, -maskRect.fTop); | 582 matrix.setTranslate(-maskRect.fLeft, -maskRect.fTop); |
| 583 matrix.postIDiv(mask->width(), mask->height()); | 583 matrix.postIDiv(mask->width(), mask->height()); |
| 584 | 584 |
| 585 grp->addCoverageProcessor(GrSimpleTextureEffect::Create(mask, matrix))->unre
f(); | 585 grp->addCoverageProcessor(GrSimpleTextureEffect::Create(mask, matrix, |
| 586 kDevice_GrCoordSet))
->unref(); |
| 586 context->drawRect(*grp, SkMatrix::I(), maskRect); | 587 context->drawRect(*grp, SkMatrix::I(), maskRect); |
| 587 return true; | 588 return true; |
| 588 } | 589 } |
| 589 | 590 |
| 590 bool draw_with_mask_filter(GrContext* context, const SkMatrix& viewMatrix, const
SkPath& devPath, | 591 bool draw_with_mask_filter(GrContext* context, const SkMatrix& viewMatrix, const
SkPath& devPath, |
| 591 SkMaskFilter* filter, const SkRegion& clip, | 592 SkMaskFilter* filter, const SkRegion& clip, |
| 592 GrPaint* grp, SkPaint::Style style) { | 593 GrPaint* grp, SkPaint::Style style) { |
| 593 SkMask srcM, dstM; | 594 SkMask srcM, dstM; |
| 594 | 595 |
| 595 if (!SkDraw::DrawToMask(devPath, &clip.getBounds(), filter, &viewMatrix, &sr
cM, | 596 if (!SkDraw::DrawToMask(devPath, &clip.getBounds(), filter, &viewMatrix, &sr
cM, |
| (...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 #endif | 1884 #endif |
| 1884 } | 1885 } |
| 1885 | 1886 |
| 1886 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1887 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1887 // We always return a transient cache, so it is freed after each | 1888 // We always return a transient cache, so it is freed after each |
| 1888 // filter traversal. | 1889 // filter traversal. |
| 1889 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1890 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1890 } | 1891 } |
| 1891 | 1892 |
| 1892 #endif | 1893 #endif |
| OLD | NEW |