| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 clippedDstRect = *dstRect; | 130 clippedDstRect = *dstRect; |
| 131 if (!srcToDstMatrix.setRectToRect(srcBounds, *dstRect, SkMatrix::kFi
ll_ScaleToFit)) { | 131 if (!srcToDstMatrix.setRectToRect(srcBounds, *dstRect, SkMatrix::kFi
ll_ScaleToFit)) { |
| 132 return; | 132 return; |
| 133 } | 133 } |
| 134 } else { | 134 } else { |
| 135 clippedDstRect = srcBounds; | 135 clippedDstRect = srcBounds; |
| 136 srcToDstMatrix.reset(); | 136 srcToDstMatrix.reset(); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 // Now that we have both the view and srcToDst matrices, log our scale facto
r. |
| 141 LogDrawScaleFactor(SkMatrix::Concat(viewMatrix, srcToDstMatrix), paint.getFi
lterQuality()); |
| 142 |
| 140 this->drawTextureProducerImpl(producer, clippedSrcRect, clippedDstRect, cons
traint, viewMatrix, | 143 this->drawTextureProducerImpl(producer, clippedSrcRect, clippedDstRect, cons
traint, viewMatrix, |
| 141 srcToDstMatrix, clip, paint); | 144 srcToDstMatrix, clip, paint); |
| 142 } | 145 } |
| 143 | 146 |
| 144 void SkGpuDevice::drawTextureProducerImpl(GrTextureProducer* producer, | 147 void SkGpuDevice::drawTextureProducerImpl(GrTextureProducer* producer, |
| 145 const SkRect& clippedSrcRect, | 148 const SkRect& clippedSrcRect, |
| 146 const SkRect& clippedDstRect, | 149 const SkRect& clippedDstRect, |
| 147 SkCanvas::SrcRectConstraint constraint
, | 150 SkCanvas::SrcRectConstraint constraint
, |
| 148 const SkMatrix& viewMatrix, | 151 const SkMatrix& viewMatrix, |
| 149 const SkMatrix& srcToDstMatrix, | 152 const SkMatrix& srcToDstMatrix, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 rrect)) { | 236 rrect)) { |
| 234 return; | 237 return; |
| 235 } | 238 } |
| 236 SkPath rectPath; | 239 SkPath rectPath; |
| 237 rectPath.addRect(clippedDstRect); | 240 rectPath.addRect(clippedDstRect); |
| 238 rectPath.setIsVolatile(true); | 241 rectPath.setIsVolatile(true); |
| 239 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip, | 242 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip, |
| 240 rectPath, &grPaint, viewMatrix, mf, pain
t.getPathEffect(), | 243 rectPath, &grPaint, viewMatrix, mf, pain
t.getPathEffect(), |
| 241 GrStrokeInfo::FillInfo(), true); | 244 GrStrokeInfo::FillInfo(), true); |
| 242 } | 245 } |
| OLD | NEW |