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 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 * and that non-texture portion of the GrPaint has already been setup. | 1272 * and that non-texture portion of the GrPaint has already been setup. |
1273 */ | 1273 */ |
1274 void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, | 1274 void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap, |
1275 const SkMatrix& viewMatrix, | 1275 const SkMatrix& viewMatrix, |
1276 const SkRect& srcRect, | 1276 const SkRect& srcRect, |
1277 const GrTextureParams& params, | 1277 const GrTextureParams& params, |
1278 const SkPaint& paint, | 1278 const SkPaint& paint, |
1279 SkCanvas::SrcRectConstraint constraint, | 1279 SkCanvas::SrcRectConstraint constraint, |
1280 bool bicubic, | 1280 bool bicubic, |
1281 bool needsTextureDomain) { | 1281 bool needsTextureDomain) { |
1282 SkASSERT(bitmap.width() <= fContext->caps()->maxTileSize() && | 1282 // We should have already handled bitmaps larger than the max texture size. |
1283 bitmap.height() <= fContext->caps()->maxTileSize()); | 1283 SkASSERT(bitmap.width() <= fContext->caps()->maxTextureSize() && |
| 1284 bitmap.height() <= fContext->caps()->maxTextureSize()); |
| 1285 // Unless the bitmap is inherently texture-backed, we should be respecting t
he max tile size |
| 1286 // by the time we get here. |
| 1287 SkASSERT(bitmap.getTexture() || |
| 1288 (bitmap.width() <= fContext->caps()->maxTileSize() && |
| 1289 bitmap.height() <= fContext->caps()->maxTileSize())); |
1284 | 1290 |
1285 GrTexture* texture; | 1291 GrTexture* texture; |
1286 AutoBitmapTexture abt(fContext, bitmap, params, &texture); | 1292 AutoBitmapTexture abt(fContext, bitmap, params, &texture); |
1287 if (nullptr == texture) { | 1293 if (nullptr == texture) { |
1288 return; | 1294 return; |
1289 } | 1295 } |
1290 | 1296 |
1291 SkRect dstRect = {0, 0, srcRect.width(), srcRect.height() }; | 1297 SkRect dstRect = {0, 0, srcRect.width(), srcRect.height() }; |
1292 SkRect paintRect; | 1298 SkRect paintRect; |
1293 SkScalar wInv = SkScalarInvert(SkIntToScalar(texture->width())); | 1299 SkScalar wInv = SkScalarInvert(SkIntToScalar(texture->width())); |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2025 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
2020 } | 2026 } |
2021 | 2027 |
2022 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2028 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
2023 // We always return a transient cache, so it is freed after each | 2029 // We always return a transient cache, so it is freed after each |
2024 // filter traversal. | 2030 // filter traversal. |
2025 return SkGpuDevice::NewImageFilterCache(); | 2031 return SkGpuDevice::NewImageFilterCache(); |
2026 } | 2032 } |
2027 | 2033 |
2028 #endif | 2034 #endif |
OLD | NEW |