HarfBuzz reports y-up, convert to y-down.

Change-Id: If90857f9cf8039ddc0dfba7f660d415a41953015
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250818
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
diff --git a/modules/skshaper/src/SkShaper_harfbuzz.cpp b/modules/skshaper/src/SkShaper_harfbuzz.cpp
index 0c80eee..c858452 100644
--- a/modules/skshaper/src/SkShaper_harfbuzz.cpp
+++ b/modules/skshaper/src/SkShaper_harfbuzz.cpp
@@ -525,9 +525,9 @@
         buffer.glyphs[i] = glyph.fID;
         if (buffer.offsets) {
             buffer.positions[i] = advance + buffer.point;
-            buffer.offsets[i] = glyph.fOffset; //TODO: invert glyph.fOffset.fY?
+            buffer.offsets[i] = glyph.fOffset;
         } else {
-            buffer.positions[i] = advance + buffer.point + glyph.fOffset; //TODO: invert glyph.fOffset.fY?
+            buffer.positions[i] = advance + buffer.point + glyph.fOffset;
         }
         if (buffer.clusters) {
             buffer.clusters[i] = glyph.fCluster;
@@ -1308,9 +1308,9 @@
         glyph.fID = info[i].codepoint;
         glyph.fCluster = info[i].cluster;
         glyph.fOffset.fX = pos[i].x_offset * textSizeX;
-        glyph.fOffset.fY = pos[i].y_offset * textSizeY;
+        glyph.fOffset.fY = -(pos[i].y_offset * textSizeY); // HarfBuzz y-up, Skia y-down
         glyph.fAdvance.fX = pos[i].x_advance * textSizeX;
-        glyph.fAdvance.fY = pos[i].y_advance * textSizeY;
+        glyph.fAdvance.fY = -(pos[i].y_advance * textSizeY); // HarfBuzz y-up, Skia y-down
 
         SkRect bounds;
         SkScalar advance;