| 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 "GrBlurUtils.h" | 8 #include "GrBlurUtils.h" |
| 9 #include "GrDrawContext.h" | 9 #include "GrDrawContext.h" |
| 10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
| 11 #include "GrContext.h" | 11 #include "GrContext.h" |
| 12 #include "effects/GrSimpleTextureEffect.h" | 12 #include "effects/GrSimpleTextureEffect.h" |
| 13 #include "GrStrokeInfo.h" | 13 #include "GrStrokeInfo.h" |
| 14 #include "GrTexture.h" | 14 #include "GrTexture.h" |
| 15 #include "GrTextureProvider.h" | 15 #include "GrTextureProvider.h" |
| 16 #include "SkDraw.h" | 16 #include "SkDraw.h" |
| 17 #include "SkGr.h" | 17 #include "SkGrPriv.h" |
| 18 #include "SkMaskFilter.h" | 18 #include "SkMaskFilter.h" |
| 19 #include "SkPaint.h" | 19 #include "SkPaint.h" |
| 20 | 20 |
| 21 static bool clip_bounds_quick_reject(const SkIRect& clipBounds, const SkIRect& r
ect) { | 21 static bool clip_bounds_quick_reject(const SkIRect& clipBounds, const SkIRect& r
ect) { |
| 22 return clipBounds.isEmpty() || rect.isEmpty() || !SkIRect::Intersects(clipBo
unds, rect); | 22 return clipBounds.isEmpty() || rect.isEmpty() || !SkIRect::Intersects(clipBo
unds, rect); |
| 23 } | 23 } |
| 24 | 24 |
| 25 // Draw a mask using the supplied paint. Since the coverage/geometry | 25 // Draw a mask using the supplied paint. Since the coverage/geometry |
| 26 // is already burnt into the mask this boils down to a rect draw. | 26 // is already burnt into the mask this boils down to a rect draw. |
| 27 // Return true if the mask was successfully drawn. | 27 // Return true if the mask was successfully drawn. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // should I push prePathMatrix on our MV stack temporarily, instead | 190 // should I push prePathMatrix on our MV stack temporarily, instead |
| 191 // of applying it here? See SkDraw.cpp | 191 // of applying it here? See SkDraw.cpp |
| 192 pathPtr->transform(*prePathMatrix, result); | 192 pathPtr->transform(*prePathMatrix, result); |
| 193 pathPtr = result; | 193 pathPtr = result; |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 // at this point we're done with prePathMatrix | 196 // at this point we're done with prePathMatrix |
| 197 SkDEBUGCODE(prePathMatrix = (const SkMatrix*)0x50FF8001;) | 197 SkDEBUGCODE(prePathMatrix = (const SkMatrix*)0x50FF8001;) |
| 198 | 198 |
| 199 GrPaint grPaint; | 199 GrPaint grPaint; |
| 200 if (!SkPaint2GrPaint(context, paint, viewMatrix, true, &grPaint)) { | 200 if (!SkPaintToGrPaint(context, paint, viewMatrix, &grPaint)) { |
| 201 return; | 201 return; |
| 202 } | 202 } |
| 203 | 203 |
| 204 const SkRect* cullRect = nullptr; // TODO: what is our bounds? | 204 const SkRect* cullRect = nullptr; // TODO: what is our bounds? |
| 205 if (!strokeInfo.isDashed() && pathEffect && pathEffect->filterPath(effectPat
h.init(), *pathPtr, | 205 if (!strokeInfo.isDashed() && pathEffect && pathEffect->filterPath(effectPat
h.init(), *pathPtr, |
| 206 &strokeIn
fo, cullRect)) { | 206 &strokeIn
fo, cullRect)) { |
| 207 pathPtr = effectPath.get(); | 207 pathPtr = effectPath.get(); |
| 208 pathIsMutable = true; | 208 pathIsMutable = true; |
| 209 } | 209 } |
| 210 | 210 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 SkPaint::kFill_Sty
le; | 292 SkPaint::kFill_Sty
le; |
| 293 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar
get, | 293 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar
get, |
| 294 clip, viewMatrix, *devPathPtr, | 294 clip, viewMatrix, *devPathPtr, |
| 295 paint.getMaskFilter(), clipBounds, &grPaint, style
); | 295 paint.getMaskFilter(), clipBounds, &grPaint, style
); |
| 296 return; | 296 return; |
| 297 } | 297 } |
| 298 | 298 |
| 299 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str
okeInfo); | 299 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str
okeInfo); |
| 300 } | 300 } |
| 301 | 301 |
| OLD | NEW |