Spanify fx_skia_device.cpp and roll third_party/skia
https://skia-review.googlesource.com/c/skia/+/1009933 removes the guard
to use unspanned APIs. Use the new spanned APIs to unblock skia DEPS
rolling. Then, roll to that commit.
Roll third_party/skia/ 9a5e09aac..df7ab9373 (1 commit)
https://skia.googlesource.com/skia.git/+log/9a5e09aac10a..df7ab9373bd0
Created with:
roll-dep third_party/skia
Change-Id: I09efdb69b95070f7d2d2b818c0334f5d9f9666c0
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/134011
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
diff --git a/DEPS b/DEPS
index 6eed598..03dc8a3 100644
--- a/DEPS
+++ b/DEPS
@@ -216,7 +216,7 @@
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling skia
# and whatever else without interference from each other.
- 'skia_revision': '9a5e09aac10a5938a6c8401db8bfc33b8452c196',
+ 'skia_revision': 'df7ab9373bd042373c823f91a93ccb2888eeca43',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling test_fonts
# and whatever else without interference from each other.
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 3a54ccf..90f4025 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -554,7 +554,7 @@
inverse.set(SkMatrix::kMTransX, 0);
inverse.set(SkMatrix::kMTransY, 0);
SkVector deviceUnits[2] = {{0, 1}, {1, 0}};
- inverse.mapPoints(deviceUnits, std::size(deviceUnits));
+ inverse.mapPoints(deviceUnits);
float width = fill_options.zero_area
? 0.0f
@@ -576,9 +576,8 @@
intervals[i * 2] = on;
intervals[i * 2 + 1] = off;
}
- spaint->setPathEffect(SkDashPathEffect::Make(
- intervals.data(), pdfium::checked_cast<int>(intervals.size()),
- graph_state->dash_phase()));
+ spaint->setPathEffect(
+ SkDashPathEffect::Make(intervals, graph_state->dash_phase()));
}
spaint->setStyle(SkPaint::kStroke_Style);
spaint->setAntiAlias(!fill_options.aliased_path);
@@ -947,7 +946,7 @@
const DataVector<uint16_t>& glyphs = char_details_.GetGlyphs();
if (!rsxform_.empty()) {
sk_sp<SkTextBlob> blob = SkTextBlob::MakeFromRSXform(
- glyphs.data(), glyphs.size() * sizeof(uint16_t), rsxform_.data(), font,
+ glyphs.data(), glyphs.size() * sizeof(uint16_t), rsxform_, font,
SkTextEncoding::kGlyphID);
canvas_->drawTextBlob(blob, 0, 0, skPaint);
return true;
@@ -965,9 +964,10 @@
} else {
font.setScaleX(scaleX);
}
- auto blob =
- SkTextBlob::MakeFromPosText(&glyphs[i], sizeof(uint16_t), &positions[i],
- font, SkTextEncoding::kGlyphID);
+ pdfium::span positions_span(positions);
+ auto blob = SkTextBlob::MakeFromPosText(&glyphs[i], sizeof(uint16_t),
+ positions_span.subspan(i), font,
+ SkTextEncoding::kGlyphID);
canvas_->drawTextBlob(blob, 0, 0, skPaint);
}
return true;
@@ -1241,7 +1241,7 @@
float end_x = pCoords->GetFloatAt(2);
float end_y = pCoords->GetFloatAt(3);
SkPoint pts[] = {{start_x, start_y}, {end_x, end_y}};
- skMatrix.mapPoints(pts, std::size(pts));
+ skMatrix.mapPoints(pts);
paint.setShader(SkGradientShader::MakeLinear(
pts, sk_colors.data(), sk_pos.data(),
fxcrt::CollectionSize<int>(sk_colors), SkTileMode::kClamp));