| 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 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 SkRect::MakeXYWH(0, | 1216 SkRect::MakeXYWH(0, |
| 1217 0, | 1217 0, |
| 1218 SK_Scalar1 * w / texture->widt
h(), | 1218 SK_Scalar1 * w / texture->widt
h(), |
| 1219 SK_Scalar1 * h / texture->heig
ht())); | 1219 SK_Scalar1 * h / texture->heig
ht())); |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, | 1222 void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, |
| 1223 const SkRect* src, const SkRect& origDst, | 1223 const SkRect* src, const SkRect& origDst, |
| 1224 const SkPaint& paint, SkCanvas::SrcRectConstrai
nt constraint) { | 1224 const SkPaint& paint, SkCanvas::SrcRectConstrai
nt constraint) { |
| 1225 ASSERT_SINGLE_OWNER | 1225 ASSERT_SINGLE_OWNER |
| 1226 CHECK_SHOULD_DRAW(draw); |
| 1226 if (bitmap.getTexture()) { | 1227 if (bitmap.getTexture()) { |
| 1227 CHECK_SHOULD_DRAW(draw); | |
| 1228 GrBitmapTextureAdjuster adjuster(&bitmap); | 1228 GrBitmapTextureAdjuster adjuster(&bitmap); |
| 1229 this->drawTextureProducer(&adjuster, src, &origDst, constraint, *draw.fM
atrix, fClip, | 1229 this->drawTextureProducer(&adjuster, src, &origDst, constraint, *draw.fM
atrix, fClip, |
| 1230 paint); | 1230 paint); |
| 1231 return; | 1231 return; |
| 1232 } | 1232 } |
| 1233 // The src rect is inferred to be the bmp bounds if not provided. Otherwise,
the src rect must | 1233 // The src rect is inferred to be the bmp bounds if not provided. Otherwise,
the src rect must |
| 1234 // be clipped to the bmp bounds. To determine tiling parameters we need the
filter mode which | 1234 // be clipped to the bmp bounds. To determine tiling parameters we need the
filter mode which |
| 1235 // in turn requires knowing the src-to-dst mapping. If the src was clipped t
o the bmp bounds | 1235 // in turn requires knowing the src-to-dst mapping. If the src was clipped t
o the bmp bounds |
| 1236 // then we use the src-to-dst mapping to compute a new clipped dst rect. | 1236 // then we use the src-to-dst mapping to compute a new clipped dst rect. |
| 1237 const SkRect* dst = &origDst; | 1237 const SkRect* dst = &origDst; |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1908 } | 1908 } |
| 1909 | 1909 |
| 1910 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1910 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1911 ASSERT_SINGLE_OWNER | 1911 ASSERT_SINGLE_OWNER |
| 1912 // We always return a transient cache, so it is freed after each | 1912 // We always return a transient cache, so it is freed after each |
| 1913 // filter traversal. | 1913 // filter traversal. |
| 1914 return SkGpuDevice::NewImageFilterCache(); | 1914 return SkGpuDevice::NewImageFilterCache(); |
| 1915 } | 1915 } |
| 1916 | 1916 |
| 1917 #endif | 1917 #endif |
| OLD | NEW |