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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 ////////////////////////////////////////////////////////////////////////////// | 88 ////////////////////////////////////////////////////////////////////////////// |
89 | 89 |
90 void SkGpuDevice::drawTextureProducer(GrTextureProducer* producer, | 90 void SkGpuDevice::drawTextureProducer(GrTextureProducer* producer, |
91 const SkRect* srcRect, | 91 const SkRect* srcRect, |
92 const SkRect* dstRect, | 92 const SkRect* dstRect, |
93 SkCanvas::SrcRectConstraint constraint, | 93 SkCanvas::SrcRectConstraint constraint, |
94 const SkMatrix& viewMatrix, | 94 const SkMatrix& viewMatrix, |
95 const GrClip& clip, | 95 const GrClip& clip, |
96 const SkPaint& paint) { | 96 const SkPaint& paint) { |
| 97 // This is the funnel for all non-tiled bitmap/image draw calls. Log a histo
gram entry. |
| 98 SK_HISTOGRAM_BOOLEAN("DrawTiled", false); |
| 99 |
97 // Figure out the actual dst and src rect by clipping the src rect to the bo
unds of the | 100 // Figure out the actual dst and src rect by clipping the src rect to the bo
unds of the |
98 // adjuster. If the src rect is clipped then the dst rect must be recomputed
. Also determine | 101 // adjuster. If the src rect is clipped then the dst rect must be recomputed
. Also determine |
99 // the matrix that maps the src rect to the dst rect. | 102 // the matrix that maps the src rect to the dst rect. |
100 SkRect clippedSrcRect; | 103 SkRect clippedSrcRect; |
101 SkRect clippedDstRect; | 104 SkRect clippedDstRect; |
102 const SkRect srcBounds = SkRect::MakeIWH(producer->width(), producer->height
()); | 105 const SkRect srcBounds = SkRect::MakeIWH(producer->width(), producer->height
()); |
103 SkMatrix srcToDstMatrix; | 106 SkMatrix srcToDstMatrix; |
104 if (srcRect) { | 107 if (srcRect) { |
105 if (!dstRect) { | 108 if (!dstRect) { |
106 dstRect = &srcBounds; | 109 dstRect = &srcBounds; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 rrect)) { | 233 rrect)) { |
231 return; | 234 return; |
232 } | 235 } |
233 SkPath rectPath; | 236 SkPath rectPath; |
234 rectPath.addRect(clippedDstRect); | 237 rectPath.addRect(clippedDstRect); |
235 rectPath.setIsVolatile(true); | 238 rectPath.setIsVolatile(true); |
236 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip, | 239 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip, |
237 rectPath, &grPaint, viewMatrix, mf, pain
t.getPathEffect(), | 240 rectPath, &grPaint, viewMatrix, mf, pain
t.getPathEffect(), |
238 GrStrokeInfo::FillInfo(), true); | 241 GrStrokeInfo::FillInfo(), true); |
239 } | 242 } |
OLD | NEW |