| 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 | |
| 143 this->drawTextureProducerImpl(producer, clippedSrcRect, clippedDstRect, cons
traint, viewMatrix, | 140 this->drawTextureProducerImpl(producer, clippedSrcRect, clippedDstRect, cons
traint, viewMatrix, |
| 144 srcToDstMatrix, clip, paint); | 141 srcToDstMatrix, clip, paint); |
| 145 } | 142 } |
| 146 | 143 |
| 147 void SkGpuDevice::drawTextureProducerImpl(GrTextureProducer* producer, | 144 void SkGpuDevice::drawTextureProducerImpl(GrTextureProducer* producer, |
| 148 const SkRect& clippedSrcRect, | 145 const SkRect& clippedSrcRect, |
| 149 const SkRect& clippedDstRect, | 146 const SkRect& clippedDstRect, |
| 150 SkCanvas::SrcRectConstraint constraint
, | 147 SkCanvas::SrcRectConstraint constraint
, |
| 151 const SkMatrix& viewMatrix, | 148 const SkMatrix& viewMatrix, |
| 152 const SkMatrix& srcToDstMatrix, | 149 const SkMatrix& srcToDstMatrix, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 rrect)) { | 233 rrect)) { |
| 237 return; | 234 return; |
| 238 } | 235 } |
| 239 SkPath rectPath; | 236 SkPath rectPath; |
| 240 rectPath.addRect(clippedDstRect); | 237 rectPath.addRect(clippedDstRect); |
| 241 rectPath.setIsVolatile(true); | 238 rectPath.setIsVolatile(true); |
| 242 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip, | 239 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip, |
| 243 rectPath, &grPaint, viewMatrix, mf, pain
t.getPathEffect(), | 240 rectPath, &grPaint, viewMatrix, mf, pain
t.getPathEffect(), |
| 244 GrStrokeInfo::FillInfo(), true); | 241 GrStrokeInfo::FillInfo(), true); |
| 245 } | 242 } |
| OLD | NEW |