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" |
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 return this->drawBitmapNine(draw, bitmap, center, dst, paint); | 1486 return this->drawBitmapNine(draw, bitmap, center, dst, paint); |
1487 } | 1487 } |
1488 | 1488 |
1489 void SkGpuDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, con
st SkIRect& center, | 1489 void SkGpuDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, con
st SkIRect& center, |
1490 const SkRect& dst, const SkPaint& paint) { | 1490 const SkRect& dst, const SkPaint& paint) { |
1491 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawBitmapNine", fContext); | 1491 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawBitmapNine", fContext); |
1492 | 1492 |
1493 CHECK_FOR_ANNOTATION(paint); | 1493 CHECK_FOR_ANNOTATION(paint); |
1494 CHECK_SHOULD_DRAW(draw); | 1494 CHECK_SHOULD_DRAW(draw); |
1495 | 1495 |
1496 bool useFallback = paint.getMaskFilter() || paint.isAntiAlias(); | 1496 bool useFallback = paint.getMaskFilter() || paint.isAntiAlias() || |
| 1497 fRenderTarget->isUnifiedMultisampled(); |
1497 bool doBicubic; | 1498 bool doBicubic; |
1498 GrTextureParams::FilterMode textureFilterMode = | 1499 GrTextureParams::FilterMode textureFilterMode = |
1499 GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), *draw.fMat
rix, SkMatrix::I(), | 1500 GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), *draw.fMat
rix, SkMatrix::I(), |
1500 &doBicubic); | 1501 &doBicubic); |
1501 | 1502 |
1502 // TODO handle bilerp | 1503 // TODO handle bilerp(vie texture domains), MSAA(via snapping) |
1503 if (useFallback || doBicubic || GrTextureParams::kNone_FilterMode != texture
FilterMode) { | 1504 if (useFallback || doBicubic || GrTextureParams::kNone_FilterMode != texture
FilterMode) { |
1504 SkNinePatchIter iter(bitmap.width(), bitmap.height(), center, dst); | 1505 SkNinePatchIter iter(bitmap.width(), bitmap.height(), center, dst); |
1505 | 1506 |
1506 SkRect srcR, dstR; | 1507 SkRect srcR, dstR; |
1507 while (iter.next(&srcR, &dstR)) { | 1508 while (iter.next(&srcR, &dstR)) { |
1508 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, | 1509 this->drawBitmapRect(draw, bitmap, &srcR, dstR, paint, |
1509 SkCanvas::kStrict_SrcRectConstraint); | 1510 SkCanvas::kStrict_SrcRectConstraint); |
1510 } | 1511 } |
1511 return; | 1512 return; |
1512 } | 1513 } |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1878 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1878 } | 1879 } |
1879 | 1880 |
1880 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1881 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1881 // We always return a transient cache, so it is freed after each | 1882 // We always return a transient cache, so it is freed after each |
1882 // filter traversal. | 1883 // filter traversal. |
1883 return SkGpuDevice::NewImageFilterCache(); | 1884 return SkGpuDevice::NewImageFilterCache(); |
1884 } | 1885 } |
1885 | 1886 |
1886 #endif | 1887 #endif |
OLD | NEW |