Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 1551883003: Move path fallback for AA rect out of SkGpuDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698