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 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 tileR.roundOut(&iTileR); | 1221 tileR.roundOut(&iTileR); |
1222 SkPoint offset = SkPoint::Make(SkIntToScalar(iTileR.fLeft), | 1222 SkPoint offset = SkPoint::Make(SkIntToScalar(iTileR.fLeft), |
1223 SkIntToScalar(iTileR.fTop)); | 1223 SkIntToScalar(iTileR.fTop)); |
1224 | 1224 |
1225 // Adjust the context matrix to draw at the right x,y in device spac
e | 1225 // Adjust the context matrix to draw at the right x,y in device spac
e |
1226 SkMatrix tmpM; | 1226 SkMatrix tmpM; |
1227 GrContext::AutoMatrix am; | 1227 GrContext::AutoMatrix am; |
1228 tmpM.setTranslate(offset.fX - srcRect.fLeft, offset.fY - srcRect.fTo
p); | 1228 tmpM.setTranslate(offset.fX - srcRect.fLeft, offset.fY - srcRect.fTo
p); |
1229 am.setPreConcat(fContext, tmpM); | 1229 am.setPreConcat(fContext, tmpM); |
1230 | 1230 |
1231 if (SkPaint::kNone_FilterLevel != paint.getFilterLevel() || bicubic)
{ | 1231 if (GrTextureParams::kNone_FilterMode != params.filterMode() || bicu
bic) { |
1232 SkIRect iClampRect; | 1232 SkIRect iClampRect; |
1233 | 1233 |
1234 if (SkCanvas::kBleed_DrawBitmapRectFlag & flags) { | 1234 if (SkCanvas::kBleed_DrawBitmapRectFlag & flags) { |
1235 // In bleed mode we want to always expand the tile on all ed
ges | 1235 // In bleed mode we want to always expand the tile on all ed
ges |
1236 // but stay within the bitmap bounds | 1236 // but stay within the bitmap bounds |
1237 iClampRect = SkIRect::MakeWH(bitmap.width(), bitmap.height()
); | 1237 iClampRect = SkIRect::MakeWH(bitmap.width(), bitmap.height()
); |
1238 } else { | 1238 } else { |
1239 // In texture-domain/clamp mode we only want to expand the | 1239 // In texture-domain/clamp mode we only want to expand the |
1240 // tile on edges interior to "srcRect" (i.e., we want to | 1240 // tile on edges interior to "srcRect" (i.e., we want to |
1241 // not bleed across the original clamped edges) | 1241 // not bleed across the original clamped edges) |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 return true; | 1841 return true; |
1842 } | 1842 } |
1843 | 1843 |
1844 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1844 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1845 // We always return a transient cache, so it is freed after each | 1845 // We always return a transient cache, so it is freed after each |
1846 // filter traversal. | 1846 // filter traversal. |
1847 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1847 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1848 } | 1848 } |
1849 | 1849 |
1850 #endif | 1850 #endif |
OLD | NEW |