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

Side by Side Diff: src/core/SkDraw.cpp

Issue 2155213002: check for culled-out paths inside SkDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | 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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #define __STDC_LIMIT_MACROS 7 #define __STDC_LIMIT_MACROS
8 8
9 #include "SkDraw.h" 9 #include "SkDraw.h"
10 #include "SkBlitter.h" 10 #include "SkBlitter.h"
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 if (scale > 0) { 1010 if (scale > 0) {
1011 return scale; 1011 return scale;
1012 } 1012 }
1013 } 1013 }
1014 } 1014 }
1015 return 1; 1015 return 1;
1016 } 1016 }
1017 1017
1018 void SkDraw::drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawC overage, 1018 void SkDraw::drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawC overage,
1019 SkBlitter* customBlitter, bool doFill) const { 1019 SkBlitter* customBlitter, bool doFill) const {
1020 // Do a quick-reject test, since a looper or other modifier may have moved u s out of range.
1021 {
1022 // outset 1 in case we're antialiasing
1023 SkRect clipBounds = SkRect::Make(fRC->getBounds()).makeOffset(1, 1);
f(malita) 2016/07/18 16:34:15 makeOutset()
1024
1025 if (paint.getMaskFilter()) {
1026 paint.getMaskFilter()->computeFastBounds(clipBounds, &clipBounds);
1027 }
1028 if (!clipBounds.intersects(devPath.getBounds())) {
1029 return;
1030 }
1031 }
1032
1020 SkBlitter* blitter = nullptr; 1033 SkBlitter* blitter = nullptr;
1021 SkAutoBlitterChoose blitterStorage; 1034 SkAutoBlitterChoose blitterStorage;
1022 if (nullptr == customBlitter) { 1035 if (nullptr == customBlitter) {
1023 blitterStorage.choose(fDst, *fMatrix, paint, drawCoverage); 1036 blitterStorage.choose(fDst, *fMatrix, paint, drawCoverage);
1024 blitter = blitterStorage.get(); 1037 blitter = blitterStorage.get();
1025 } else { 1038 } else {
1026 blitter = customBlitter; 1039 blitter = customBlitter;
1027 } 1040 }
1028 1041
1029 if (paint.getMaskFilter()) { 1042 if (paint.getMaskFilter()) {
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2084 mask->fImage = SkMask::AllocImage(size); 2097 mask->fImage = SkMask::AllocImage(size);
2085 memset(mask->fImage, 0, mask->computeImageSize()); 2098 memset(mask->fImage, 0, mask->computeImageSize());
2086 } 2099 }
2087 2100
2088 if (SkMask::kJustComputeBounds_CreateMode != mode) { 2101 if (SkMask::kJustComputeBounds_CreateMode != mode) {
2089 draw_into_mask(*mask, devPath, style); 2102 draw_into_mask(*mask, devPath, style);
2090 } 2103 }
2091 2104
2092 return true; 2105 return true;
2093 } 2106 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698