From edfd3c3d6a56bee2456e96df4b945c095ea3a290 Mon Sep 17 00:00:00 2001 From: caryclark Date: Wed, 25 May 2016 14:08:25 -0700 Subject: get skia building Resolve changes to cpdf_shadingpattern.h that prevent Skia from building. R=thestig@chromium.org,dsinclair@chromium.org,reed@google.com BUG= Review-Url: https://codereview.chromium.org/2017463002 --- core/fxge/skia/fx_skia_device.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'core/fxge') diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 0edb73acb8..3d08cb5fe1 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -753,16 +753,17 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern, const FX_RECT& clip_rect, int alpha, FX_BOOL bAlphaMode) { - if (kAxialShading != pPattern->m_ShadingType && - kRadialShading != pPattern->m_ShadingType) { + if (kAxialShading != pPattern->GetShadingType() && + kRadialShading != pPattern->GetShadingType()) { // TODO(caryclark) more types return false; } - CPDF_Function* const* pFuncs = pPattern->m_pFunctions; - int nFuncs = pPattern->m_nFuncs; + const std::vector>& pFuncs = + pPattern->GetFuncs(); + int nFuncs = pFuncs.size(); if (nFuncs != 1) // TODO(caryclark) remove this restriction return false; - CPDF_Dictionary* pDict = pPattern->m_pShadingObj->GetDict(); + CPDF_Dictionary* pDict = pPattern->GetShadingObject()->GetDict(); CPDF_Array* pCoords = pDict->GetArrayBy("Coords"); if (!pCoords) return true; @@ -771,23 +772,22 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern, SkTDArray skColors; SkTDArray skPos; for (int j = 0; j < nFuncs; j++) { - const CPDF_Function* pFunc = pFuncs[j]; - if (!pFunc) + if (!pFuncs[j]) continue; - if (const CPDF_SampledFunc* pSampledFunc = pFunc->ToSampledFunc()) { + if (const CPDF_SampledFunc* pSampledFunc = pFuncs[j]->ToSampledFunc()) { /* TODO(caryclark) Type 0 Sampled Functions in PostScript can also have an Order integer in the dictionary. PDFium doesn't appear to check for this anywhere. */ if (!AddSamples(pSampledFunc, &skColors, &skPos)) return false; - } else if (const CPDF_ExpIntFunc* pExpIntFuc = pFunc->ToExpIntFunc()) { + } else if (const CPDF_ExpIntFunc* pExpIntFuc = pFuncs[j]->ToExpIntFunc()) { if (!AddColors(pExpIntFuc, &skColors)) return false; skPos.push(0); skPos.push(1); - } else if (const CPDF_StitchFunc* pStitchFunc = pFunc->ToStitchFunc()) { + } else if (const CPDF_StitchFunc* pStitchFunc = pFuncs[j]->ToStitchFunc()) { if (!AddStitching(pStitchFunc, &skColors, &skPos)) return false; } else { @@ -805,7 +805,7 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern, clip_rect.right, clip_rect.bottom); SkPath skClip; SkPath skPath; - if (kAxialShading == pPattern->m_ShadingType) { + if (kAxialShading == pPattern->GetShadingType()) { FX_FLOAT start_x = pCoords->GetNumberAt(0); FX_FLOAT start_y = pCoords->GetNumberAt(1); FX_FLOAT end_x = pCoords->GetNumberAt(2); @@ -846,7 +846,7 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawShading(const CPDF_ShadingPattern* pPattern, skPath.addRect(skRect); skMatrix.setIdentity(); } else { - ASSERT(kRadialShading == pPattern->m_ShadingType); + ASSERT(kRadialShading == pPattern->GetShadingType()); FX_FLOAT start_x = pCoords->GetNumberAt(0); FX_FLOAT start_y = pCoords->GetNumberAt(1); FX_FLOAT start_r = pCoords->GetNumberAt(2); -- cgit v1.2.3