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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap, | 927 void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap, |
928 const SkMatrix& viewMatrix, | 928 const SkMatrix& viewMatrix, |
929 const SkRect& srcRect, | 929 const SkRect& srcRect, |
930 const SkIRect& clippedSrcIRect, | 930 const SkIRect& clippedSrcIRect, |
931 const GrTextureParams& params, | 931 const GrTextureParams& params, |
932 const SkPaint& origPaint, | 932 const SkPaint& origPaint, |
933 SkCanvas::SrcRectConstraint constraint, | 933 SkCanvas::SrcRectConstraint constraint, |
934 int tileSize, | 934 int tileSize, |
935 bool bicubic) { | 935 bool bicubic) { |
936 ASSERT_SINGLE_OWNER | 936 ASSERT_SINGLE_OWNER |
| 937 |
| 938 // This is the funnel for all paths that draw tiled bitmaps/images. Log hist
ogram entry. |
| 939 SK_HISTOGRAM_BOOLEAN("DrawTiled", true); |
| 940 |
937 // The following pixel lock is technically redundant, but it is desirable | 941 // The following pixel lock is technically redundant, but it is desirable |
938 // to lock outside of the tile loop to prevent redecoding the whole image | 942 // to lock outside of the tile loop to prevent redecoding the whole image |
939 // at each tile in cases where 'bitmap' holds an SkDiscardablePixelRef that | 943 // at each tile in cases where 'bitmap' holds an SkDiscardablePixelRef that |
940 // is larger than the limit of the discardable memory pool. | 944 // is larger than the limit of the discardable memory pool. |
941 SkAutoLockPixels alp(bitmap); | 945 SkAutoLockPixels alp(bitmap); |
942 | 946 |
943 const SkPaint* paint = &origPaint; | 947 const SkPaint* paint = &origPaint; |
944 SkPaint tempPaint; | 948 SkPaint tempPaint; |
945 if (origPaint.isAntiAlias() && !fRenderTarget->isUnifiedMultisampled()) { | 949 if (origPaint.isAntiAlias() && !fRenderTarget->isUnifiedMultisampled()) { |
946 // Drop antialiasing to avoid seams at tile boundaries. | 950 // Drop antialiasing to avoid seams at tile boundaries. |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 } | 1904 } |
1901 | 1905 |
1902 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1906 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1903 ASSERT_SINGLE_OWNER | 1907 ASSERT_SINGLE_OWNER |
1904 // We always return a transient cache, so it is freed after each | 1908 // We always return a transient cache, so it is freed after each |
1905 // filter traversal. | 1909 // filter traversal. |
1906 return SkGpuDevice::NewImageFilterCache(); | 1910 return SkGpuDevice::NewImageFilterCache(); |
1907 } | 1911 } |
1908 | 1912 |
1909 #endif | 1913 #endif |
OLD | NEW |