OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), viewMatrix, sr
cToDstMatrix, | 164 GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), viewMatrix, sr
cToDstMatrix, |
165 &doBicubic); | 165 &doBicubic); |
166 const GrTextureParams::FilterMode* filterMode = doBicubic ? nullptr : &fm; | 166 const GrTextureParams::FilterMode* filterMode = doBicubic ? nullptr : &fm; |
167 | 167 |
168 GrTextureAdjuster::FilterConstraint constraintMode; | 168 GrTextureAdjuster::FilterConstraint constraintMode; |
169 if (SkCanvas::kFast_SrcRectConstraint == constraint) { | 169 if (SkCanvas::kFast_SrcRectConstraint == constraint) { |
170 constraintMode = GrTextureAdjuster::kNo_FilterConstraint; | 170 constraintMode = GrTextureAdjuster::kNo_FilterConstraint; |
171 } else { | 171 } else { |
172 constraintMode = GrTextureAdjuster::kYes_FilterConstraint; | 172 constraintMode = GrTextureAdjuster::kYes_FilterConstraint; |
173 } | 173 } |
174 | 174 |
175 // If we have to outset for AA then we will generate texture coords outside
the src rect. The | 175 // If we have to outset for AA then we will generate texture coords outside
the src rect. The |
176 // same happens for any mask filter that extends the bounds rendered in the
dst. | 176 // same happens for any mask filter that extends the bounds rendered in the
dst. |
177 // This is conservative as a mask filter does not have to expand the bounds
rendered. | 177 // This is conservative as a mask filter does not have to expand the bounds
rendered. |
178 bool coordsAllInsideSrcRect = !paint.isAntiAlias() && !mf; | 178 bool coordsAllInsideSrcRect = !paint.isAntiAlias() && !mf; |
179 | 179 |
180 // Check for optimization to drop the src rect constraint when on bilerp. | 180 // Check for optimization to drop the src rect constraint when on bilerp. |
181 if (filterMode && GrTextureParams::kBilerp_FilterMode == *filterMode && | 181 if (filterMode && GrTextureParams::kBilerp_FilterMode == *filterMode && |
182 GrTextureAdjuster::kYes_FilterConstraint == constraintMode && coordsAllI
nsideSrcRect) { | 182 GrTextureAdjuster::kYes_FilterConstraint == constraintMode && coordsAllI
nsideSrcRect) { |
183 SkMatrix combinedMatrix; | 183 SkMatrix combinedMatrix; |
184 combinedMatrix.setConcat(viewMatrix, srcToDstMatrix); | 184 combinedMatrix.setConcat(viewMatrix, srcToDstMatrix); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 rrect)) { | 233 rrect)) { |
234 return; | 234 return; |
235 } | 235 } |
236 SkPath rectPath; | 236 SkPath rectPath; |
237 rectPath.addRect(clippedDstRect); | 237 rectPath.addRect(clippedDstRect); |
238 rectPath.setIsVolatile(true); | 238 rectPath.setIsVolatile(true); |
239 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip, | 239 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip, |
240 rectPath, &grPaint, viewMatrix, mf, pain
t.getPathEffect(), | 240 rectPath, &grPaint, viewMatrix, mf, pain
t.getPathEffect(), |
241 GrStrokeInfo::FillInfo(), true); | 241 GrStrokeInfo::FillInfo(), true); |
242 } | 242 } |
OLD | NEW |