summaryrefslogtreecommitdiff
path: root/core/fxge/skia
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/skia')
-rw-r--r--core/fxge/skia/fx_skia_device.cpp15
-rw-r--r--core/fxge/skia/fx_skia_device_unittest.cpp7
2 files changed, 16 insertions, 6 deletions
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 40bd321f56..c8b16f5506 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -1749,7 +1749,7 @@ bool CFX_SkiaDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern,
m_pCanvas->clipPath(skClip, SkClipOp::kIntersect, true);
m_pCanvas->concat(skMatrix);
while (!stream.BitStream()->IsEOF()) {
- uint32_t flag = stream.GetFlag();
+ uint32_t flag = stream.ReadFlag();
int iStartPoint = flag ? 4 : 0;
int iStartColor = flag ? 2 : 0;
if (flag) {
@@ -1762,11 +1762,16 @@ bool CFX_SkiaDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern,
tempColors[1] = colors[(flag + 1) % 4];
FXSYS_memcpy(colors, tempColors, sizeof(tempColors));
}
- for (int i = iStartPoint; i < (int)SK_ARRAY_COUNT(cubics); i++)
- stream.GetCoords(cubics[i].fX, cubics[i].fY);
+ for (int i = iStartPoint; i < (int)SK_ARRAY_COUNT(cubics); i++) {
+ CFX_PointF point = stream.ReadCoords();
+ cubics[i].fX = point.x;
+ cubics[i].fY = point.y;
+ }
for (int i = iStartColor; i < (int)SK_ARRAY_COUNT(colors); i++) {
- FX_FLOAT r = 0.0f, g = 0.0f, b = 0.0f;
- stream.GetColor(r, g, b);
+ FX_FLOAT r;
+ FX_FLOAT g;
+ FX_FLOAT b;
+ std::tie(r, g, b) = stream.ReadColor();
colors[i] = SkColorSetARGBInline(0xFF, (U8CPU)(r * 255),
(U8CPU)(g * 255), (U8CPU)(b * 255));
}
diff --git a/core/fxge/skia/fx_skia_device_unittest.cpp b/core/fxge/skia/fx_skia_device_unittest.cpp
index 693cf1b616..3b799e6190 100644
--- a/core/fxge/skia/fx_skia_device_unittest.cpp
+++ b/core/fxge/skia/fx_skia_device_unittest.cpp
@@ -35,7 +35,12 @@ void EmptyTest(CFX_SkiaDeviceDriver* driver, const State&) {
}
void CommonTest(CFX_SkiaDeviceDriver* driver, const State& state) {
- FXTEXT_CHARPOS charPos[] = {{{0, 0, 0, 0}, 0, 1, 1, 4, false, false}};
+ FXTEXT_CHARPOS charPos[1];
+ charPos[0].m_OriginX = 0;
+ charPos[0].m_OriginY = 1;
+ charPos[0].m_GlyphIndex = 1;
+ charPos[0].m_FontCharWidth = 4;
+
CFX_Font font;
FX_FLOAT fontSize = 1;
CFX_PathData clipPath, clipPath2;