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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 bool usePath = doStroke && width > 0 && | 469 bool usePath = doStroke && width > 0 && |
470 (paint.getStrokeJoin() == SkPaint::kRound_Join || | 470 (paint.getStrokeJoin() == SkPaint::kRound_Join || |
471 (paint.getStrokeJoin() == SkPaint::kBevel_Join && rect.isEmp
ty())); | 471 (paint.getStrokeJoin() == SkPaint::kBevel_Join && rect.isEmp
ty())); |
472 | 472 |
473 // a few other reasons we might need to call drawPath... | 473 // a few other reasons we might need to call drawPath... |
474 if (paint.getMaskFilter() || paint.getPathEffect() || | 474 if (paint.getMaskFilter() || paint.getPathEffect() || |
475 paint.getStyle() == SkPaint::kStrokeAndFill_Style) { // we can't both st
roke and fill rects | 475 paint.getStyle() == SkPaint::kStrokeAndFill_Style) { // we can't both st
roke and fill rects |
476 usePath = true; | 476 usePath = true; |
477 } | 477 } |
478 | 478 |
479 if (!usePath && paint.isAntiAlias() && !draw.fMatrix->rectStaysRect()) { | |
480 usePath = true; | |
481 } | |
482 | |
483 if (usePath) { | 479 if (usePath) { |
484 SkPath path; | 480 SkPath path; |
485 path.setIsVolatile(true); | 481 path.setIsVolatile(true); |
486 path.addRect(rect); | 482 path.addRect(rect); |
487 GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext, | 483 GrBlurUtils::drawPathWithMaskFilter(fContext, fDrawContext, |
488 fClip, path, paint, | 484 fClip, path, paint, |
489 *draw.fMatrix, nullptr, | 485 *draw.fMatrix, nullptr, |
490 draw.fClip->getBounds(), true); | 486 draw.fClip->getBounds(), true); |
491 return; | 487 return; |
492 } | 488 } |
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1873 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1869 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1874 } | 1870 } |
1875 | 1871 |
1876 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1872 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1877 // We always return a transient cache, so it is freed after each | 1873 // We always return a transient cache, so it is freed after each |
1878 // filter traversal. | 1874 // filter traversal. |
1879 return SkGpuDevice::NewImageFilterCache(); | 1875 return SkGpuDevice::NewImageFilterCache(); |
1880 } | 1876 } |
1881 | 1877 |
1882 #endif | 1878 #endif |
OLD | NEW |