| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkBlurMaskFilter.h" | 8 #include "SkBlurMaskFilter.h" |
| 9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkGpuBlurUtils.h" | 10 #include "SkGpuBlurUtils.h" |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 SkRRect::kLowerRight_Corner, SkRRect::kLowerLeft_Corner }) { | 1114 SkRRect::kLowerRight_Corner, SkRRect::kLowerLeft_Corner }) { |
| 1115 SkASSERT(SkScalarIsInt(rrectToDraw.radii(c).fX) && SkScalarIsInt(rrectTo
Draw.radii(c).fY)); | 1115 SkASSERT(SkScalarIsInt(rrectToDraw.radii(c).fX) && SkScalarIsInt(rrectTo
Draw.radii(c).fY)); |
| 1116 builder[index++] = SkScalarCeilToInt(rrectToDraw.radii(c).fX); | 1116 builder[index++] = SkScalarCeilToInt(rrectToDraw.radii(c).fX); |
| 1117 builder[index++] = SkScalarCeilToInt(rrectToDraw.radii(c).fY); | 1117 builder[index++] = SkScalarCeilToInt(rrectToDraw.radii(c).fY); |
| 1118 } | 1118 } |
| 1119 builder.finish(); | 1119 builder.finish(); |
| 1120 | 1120 |
| 1121 sk_sp<GrTexture> mask(context->textureProvider()->findAndRefTextureByUniqueK
ey(key)); | 1121 sk_sp<GrTexture> mask(context->textureProvider()->findAndRefTextureByUniqueK
ey(key)); |
| 1122 if (!mask) { | 1122 if (!mask) { |
| 1123 // TODO: this could be approx but the texture coords will need to be upd
ated | 1123 // TODO: this could be approx but the texture coords will need to be upd
ated |
| 1124 sk_sp<GrDrawContext> dc(context->makeDrawContext(SkBackingFit::kExact, | 1124 sk_sp<GrDrawContext> dc(context->makeDrawContextWithFallback(SkBackingFi
t::kExact, |
| 1125 size.fWidth, size.fHeig
ht, | 1125 size.fWidth
, size.fHeight, |
| 1126 kAlpha_8_GrPixelConfig,
nullptr)); | 1126 kAlpha_8_Gr
PixelConfig, |
| 1127 nullptr)); |
| 1127 if (!dc) { | 1128 if (!dc) { |
| 1128 return nullptr; | 1129 return nullptr; |
| 1129 } | 1130 } |
| 1130 | 1131 |
| 1131 GrPaint grPaint; | 1132 GrPaint grPaint; |
| 1132 grPaint.setAntiAlias(doAA); | 1133 grPaint.setAntiAlias(doAA); |
| 1133 | 1134 |
| 1134 dc->clear(nullptr, 0x0, true); | 1135 dc->clear(nullptr, 0x0, true); |
| 1135 dc->drawRRect(GrNoClip(), grPaint, SkMatrix::I(), rrectToDraw, GrStyle::
SimpleFill()); | 1136 dc->drawRRect(GrNoClip(), grPaint, SkMatrix::I(), rrectToDraw, GrStyle::
SimpleFill()); |
| 1136 | 1137 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 } else { | 1563 } else { |
| 1563 str->append("None"); | 1564 str->append("None"); |
| 1564 } | 1565 } |
| 1565 str->append("))"); | 1566 str->append("))"); |
| 1566 } | 1567 } |
| 1567 #endif | 1568 #endif |
| 1568 | 1569 |
| 1569 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1570 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
| 1570 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1571 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
| 1571 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1572 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |