0

Don't call deprecated SkPaint::getBlendMode()

Bug: skia:12173
Change-Id: I4697eb32756d1438c0e55d21d20058b13ca70cf9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3015778
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#900441}
This commit is contained in:
Mike Reed
2021-07-12 12:40:44 +00:00
committed by Chromium LUCI CQ
parent c42570b94f
commit b7a7f359f8
3 changed files with 8 additions and 7 deletions
skia
third_party/blink/renderer/platform/graphics

@ -205,8 +205,6 @@ SK_API void SkDebugf_FileLine(const char* file,
// Max. verb count for paths rendered by the edge-AA tessellating path renderer.
#define GR_AA_TESSELLATOR_MAX_VERB_COUNT 100
#define SK_SUPPORT_LEGACY_GETBLENDMODE
#define GR_DISABLE_TESSELLATION_ON_ES2
#define SK_SUPPORT_LEGACY_AAA_CHOICE

@ -192,9 +192,9 @@ std::unique_ptr<base::Value> AsValue(const SkPaint& paint) {
val->SetString("Style", gStyleStrings[paint.getStyle()]);
}
if (paint.getBlendMode() != default_paint.getBlendMode()) {
val->SetKey("Xfermode",
base::Value::FromUniquePtrValue(AsValue(paint.getBlendMode())));
if (paint.asBlendMode() != default_paint.asBlendMode()) {
val->SetKey("Xfermode", base::Value::FromUniquePtrValue(AsValue(
paint.getBlendMode_or(SkBlendMode::kSrcOver))));
}
if (paint.isAntiAlias() || paint.isDither()) {

@ -340,8 +340,11 @@ std::unique_ptr<JSONObject> ObjectForSkPaint(const SkPaint& paint) {
paint_item->SetString("strokeCap", StrokeCapName(paint.getStrokeCap()));
paint_item->SetString("strokeJoin", StrokeJoinName(paint.getStrokeJoin()));
paint_item->SetString("styleName", StyleName(paint.getStyle()));
if (paint.getBlendMode() != SkBlendMode::kSrcOver)
paint_item->SetString("blendMode", SkBlendMode_Name(paint.getBlendMode()));
const auto bm = paint.asBlendMode();
if (bm != SkBlendMode::kSrcOver) {
paint_item->SetString("blendMode",
bm ? SkBlendMode_Name(bm.value()) : "custom");
}
if (paint.getImageFilter())
paint_item->SetString("imageFilter", "SkImageFilter");
return paint_item;