| 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 } | 632 } |
| 633 | 633 |
| 634 #include "SkMaskFilter.h" | 634 #include "SkMaskFilter.h" |
| 635 | 635 |
| 636 /////////////////////////////////////////////////////////////////////////////// | 636 /////////////////////////////////////////////////////////////////////////////// |
| 637 | 637 |
| 638 static SkBitmap wrap_texture(GrTexture* texture, int width, int height) { | 638 static SkBitmap wrap_texture(GrTexture* texture, int width, int height) { |
| 639 SkBitmap result; | 639 SkBitmap result; |
| 640 result.setInfo(SkImageInfo::MakeN32Premul(width, height)); | 640 result.setInfo(SkImageInfo::MakeN32Premul(width, height)); |
| 641 result.setPixelRef(new SkGrPixelRef(result.info(), texture))->unref(); | 641 result.setPixelRef(new SkGrPixelRef(result.info(), texture))->unref(); |
| 642 return result; | 642 return skstd::move(result); |
| 643 } | 643 } |
| 644 | 644 |
| 645 void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath, | 645 void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath, |
| 646 const SkPaint& paint, const SkMatrix* prePathMatrix, | 646 const SkPaint& paint, const SkMatrix* prePathMatrix, |
| 647 bool pathIsMutable) { | 647 bool pathIsMutable) { |
| 648 if (!origSrcPath.isInverseFillType() && !paint.getPathEffect() && !prePathMa
trix) { | 648 if (!origSrcPath.isInverseFillType() && !paint.getPathEffect() && !prePathMa
trix) { |
| 649 bool isClosed; | 649 bool isClosed; |
| 650 SkRect rect; | 650 SkRect rect; |
| 651 if (origSrcPath.isRect(&rect, &isClosed) && isClosed) { | 651 if (origSrcPath.isRect(&rect, &isClosed) && isClosed) { |
| 652 this->drawRect(draw, rect, paint); | 652 this->drawRect(draw, rect, paint); |
| (...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1874 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1874 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1875 } | 1875 } |
| 1876 | 1876 |
| 1877 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1877 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1878 // We always return a transient cache, so it is freed after each | 1878 // We always return a transient cache, so it is freed after each |
| 1879 // filter traversal. | 1879 // filter traversal. |
| 1880 return SkGpuDevice::NewImageFilterCache(); | 1880 return SkGpuDevice::NewImageFilterCache(); |
| 1881 } | 1881 } |
| 1882 | 1882 |
| 1883 #endif | 1883 #endif |
| OLD | NEW |