From cf7d09a2c0ddcabb1afbfcf00d1438fadc894b8c Mon Sep 17 00:00:00 2001 From: Julia Lavrova Date: Fri, 28 Apr 2023 10:06:59 -0400 Subject: [PATCH] Clearer names for foreground/background text style Skia bug: https://buganizer.corp.google.com/issues/279950321 Change-Id: I69ec00a8a6080abbe48f7c9539b4577a93bb246b Change-Id: I1f173b2e701cc0ff7d369e20daea60bd80fdfe36 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/686016 Reviewed-by: Ben Wagner Commit-Queue: Julia Lavrova --- modules/skparagraph/include/TextStyle.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/skparagraph/include/TextStyle.h b/modules/skparagraph/include/TextStyle.h index e6f0ae46302d..b4608389bb68 100644 --- a/modules/skparagraph/include/TextStyle.h +++ b/modules/skparagraph/include/TextStyle.h @@ -173,10 +173,12 @@ class TextStyle { ParagraphPainter::SkPaintOrID getForegroundPaintOrID() const { return fForeground; } - void setForegroundColor(SkPaint paint) { + void setForegroundPaint(SkPaint paint) { fHasForeground = true; fForeground = std::move(paint); } + // DEPRECATED: prefer `setForegroundPaint`. + void setForegroundColor(SkPaint paint) { setForegroundPaint(paint); } // Set the foreground to a paint ID. This is intended for use by clients // that implement a custom ParagraphPainter that can not accept an SkPaint. void setForegroundPaintID(ParagraphPainter::PaintID paintID) { @@ -193,10 +195,12 @@ class TextStyle { ParagraphPainter::SkPaintOrID getBackgroundPaintOrID() const { return fBackground; } - void setBackgroundColor(SkPaint paint) { + void setBackgroundPaint(SkPaint paint) { fHasBackground = true; fBackground = std::move(paint); } + // DEPRECATED: prefer `setBackgroundPaint`. + void setBackgroundColor(SkPaint paint) { setBackgroundPaint(paint); } void setBackgroundPaintID(ParagraphPainter::PaintID paintID) { fHasBackground = true; fBackground = paintID;