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 "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
11 #include "GrContext.h" | 11 #include "GrContext.h" |
12 #include "SkDraw.h" | 12 #include "SkDraw.h" |
13 #include "GrGpu.h" | 13 #include "GrGpu.h" |
14 #include "GrGpuResourcePriv.h" | 14 #include "GrGpuResourcePriv.h" |
15 #include "GrImageIDTextureAdjuster.h" | 15 #include "GrImageIDTextureAdjuster.h" |
16 #include "GrStyle.h" | 16 #include "GrStyle.h" |
17 #include "GrTracing.h" | 17 #include "GrTracing.h" |
18 #include "SkCanvasPriv.h" | 18 #include "SkCanvasPriv.h" |
19 #include "SkErrorInternals.h" | 19 #include "SkErrorInternals.h" |
20 #include "SkGlyphCache.h" | 20 #include "SkGlyphCache.h" |
21 #include "SkGr.h" | 21 #include "SkGr.h" |
22 #include "SkGrPriv.h" | 22 #include "SkGrPriv.h" |
23 #include "SkImage_Base.h" | 23 #include "SkImage_Base.h" |
24 #include "SkImageCacherator.h" | 24 #include "SkImageCacherator.h" |
25 #include "SkImageFilter.h" | 25 #include "SkImageFilter.h" |
26 #include "SkImageFilterCache.h" | 26 #include "SkImageFilterCache.h" |
| 27 #include "SkLatticeIter.h" |
27 #include "SkMaskFilter.h" | 28 #include "SkMaskFilter.h" |
28 #include "SkNinePatchIter.h" | |
29 #include "SkPathEffect.h" | 29 #include "SkPathEffect.h" |
30 #include "SkPicture.h" | 30 #include "SkPicture.h" |
31 #include "SkPictureData.h" | 31 #include "SkPictureData.h" |
32 #include "SkRasterClip.h" | 32 #include "SkRasterClip.h" |
33 #include "SkRRect.h" | 33 #include "SkRRect.h" |
34 #include "SkRecord.h" | 34 #include "SkRecord.h" |
35 #include "SkSpecialImage.h" | 35 #include "SkSpecialImage.h" |
36 #include "SkStroke.h" | 36 #include "SkStroke.h" |
37 #include "SkSurface.h" | 37 #include "SkSurface.h" |
38 #include "SkSurface_Gpu.h" | 38 #include "SkSurface_Gpu.h" |
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 | 1439 |
1440 CHECK_SHOULD_DRAW(draw); | 1440 CHECK_SHOULD_DRAW(draw); |
1441 | 1441 |
1442 bool useFallback = paint.getMaskFilter() || paint.isAntiAlias() || | 1442 bool useFallback = paint.getMaskFilter() || paint.isAntiAlias() || |
1443 fDrawContext->isUnifiedMultisampled(); | 1443 fDrawContext->isUnifiedMultisampled(); |
1444 bool doBicubic; | 1444 bool doBicubic; |
1445 GrTextureParams::FilterMode textureFilterMode = | 1445 GrTextureParams::FilterMode textureFilterMode = |
1446 GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), *draw.fMatrix,
SkMatrix::I(), | 1446 GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), *draw.fMatrix,
SkMatrix::I(), |
1447 &doBicubic); | 1447 &doBicubic); |
1448 if (useFallback || doBicubic || GrTextureParams::kNone_FilterMode != texture
FilterMode) { | 1448 if (useFallback || doBicubic || GrTextureParams::kNone_FilterMode != texture
FilterMode) { |
1449 SkNinePatchIter iter(producer->width(), producer->height(), center, dst)
; | 1449 SkLatticeIter iter(producer->width(), producer->height(), center, dst); |
1450 | 1450 |
1451 SkRect srcR, dstR; | 1451 SkRect srcR, dstR; |
1452 while (iter.next(&srcR, &dstR)) { | 1452 while (iter.next(&srcR, &dstR)) { |
1453 this->drawTextureProducer(producer, &srcR, &dstR, SkCanvas::kStrict_
SrcRectConstraint, | 1453 this->drawTextureProducer(producer, &srcR, &dstR, SkCanvas::kStrict_
SrcRectConstraint, |
1454 *draw.fMatrix, fClip, paint); | 1454 *draw.fMatrix, fClip, paint); |
1455 } | 1455 } |
1456 return; | 1456 return; |
1457 } | 1457 } |
1458 | 1458 |
1459 static const GrTextureParams::FilterMode kMode = GrTextureParams::kNone_Filt
erMode; | 1459 static const GrTextureParams::FilterMode kMode = GrTextureParams::kNone_Filt
erMode; |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 } | 1776 } |
1777 | 1777 |
1778 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { | 1778 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { |
1779 ASSERT_SINGLE_OWNER | 1779 ASSERT_SINGLE_OWNER |
1780 // We always return a transient cache, so it is freed after each | 1780 // We always return a transient cache, so it is freed after each |
1781 // filter traversal. | 1781 // filter traversal. |
1782 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); | 1782 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); |
1783 } | 1783 } |
1784 | 1784 |
1785 #endif | 1785 #endif |
OLD | NEW |