Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Side by Side Diff: src/effects/SkBlurMaskFilter.cpp

Issue 2316153002: Cherry pick fix for skbug.com/5734 to M54 (Closed)
Patch Set: Cherry pick of fix for skbug.com/5734 to M54 Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 for (auto c : { SkRRect::kUpperLeft_Corner, SkRRect::kUpperRight_Corner, 1113 for (auto c : { SkRRect::kUpperLeft_Corner, SkRRect::kUpperRight_Corner,
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 GrPixelConfig config;
1124 if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) {
1125 config = kAlpha_8_GrPixelConfig;
1126 } else {
1127 config = kRGBA_8888_GrPixelConfig;
1128 }
1129
1123 // TODO: this could be approx but the texture coords will need to be upd ated 1130 // TODO: this could be approx but the texture coords will need to be upd ated
1124 sk_sp<GrDrawContext> dc(context->makeDrawContext(SkBackingFit::kExact, 1131 sk_sp<GrDrawContext> dc(context->makeDrawContext(SkBackingFit::kExact,
1125 size.fWidth, size.fHeig ht, 1132 size.fWidth, size.fHeig ht,
1126 kAlpha_8_GrPixelConfig, nullptr)); 1133 config, nullptr));
1127 if (!dc) { 1134 if (!dc) {
1128 return nullptr; 1135 return nullptr;
1129 } 1136 }
1130 1137
1131 GrPaint grPaint; 1138 GrPaint grPaint;
1132 grPaint.setAntiAlias(doAA); 1139 grPaint.setAntiAlias(doAA);
1133 1140
1134 dc->clear(nullptr, 0x0, true); 1141 dc->clear(nullptr, 0x0, true);
1135 dc->drawRRect(GrNoClip(), grPaint, SkMatrix::I(), rrectToDraw, GrStyle:: SimpleFill()); 1142 dc->drawRRect(GrNoClip(), grPaint, SkMatrix::I(), rrectToDraw, GrStyle:: SimpleFill());
1136 1143
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 } else { 1569 } else {
1563 str->append("None"); 1570 str->append("None");
1564 } 1571 }
1565 str->append("))"); 1572 str->append("))");
1566 } 1573 }
1567 #endif 1574 #endif
1568 1575
1569 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1576 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1570 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1577 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1571 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1578 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698