| 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 | 979 |
| 980 SkMatrix matrix; | 980 SkMatrix matrix; |
| 981 matrix.setIDiv(bitmapPtr->width(), bitmapPtr->height()); | 981 matrix.setIDiv(bitmapPtr->width(), bitmapPtr->height()); |
| 982 | 982 |
| 983 SkMatrix dstRectToSrcRect; | 983 SkMatrix dstRectToSrcRect; |
| 984 if (!srcRectToDstRect.invert(&dstRectToSrcRect)) { | 984 if (!srcRectToDstRect.invert(&dstRectToSrcRect)) { |
| 985 return; | 985 return; |
| 986 } | 986 } |
| 987 matrix.preConcat(dstRectToSrcRect); | 987 matrix.preConcat(dstRectToSrcRect); |
| 988 | 988 |
| 989 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateFillAA(grPaint.get
Color(), | 989 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateAAFill(grPaint.get
Color(), |
| 990 viewMatrix, | 990 viewMatrix, |
| 991 matrix, | 991 matrix, |
| 992 dstRect, | 992 dstRect, |
| 993 devRect)); | 993 devRect)); |
| 994 | 994 |
| 995 drawContext->drawBatch(renderTarget, clip, grPaint, batch); | 995 drawContext->drawBatch(renderTarget, clip, grPaint, batch); |
| 996 } | 996 } |
| 997 | 997 |
| 998 void SkGpuDevice::drawBitmapCommon(const SkDraw& draw, | 998 void SkGpuDevice::drawBitmapCommon(const SkDraw& draw, |
| 999 const SkBitmap& bitmap, | 999 const SkBitmap& bitmap, |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1900 #endif | 1900 #endif |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1903 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1904 // We always return a transient cache, so it is freed after each | 1904 // We always return a transient cache, so it is freed after each |
| 1905 // filter traversal. | 1905 // filter traversal. |
| 1906 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1906 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1907 } | 1907 } |
| 1908 | 1908 |
| 1909 #endif | 1909 #endif |
| OLD | NEW |