From 940f559b985d4a742c21b21cb077a232e44dd289 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 14 Feb 2017 11:55:21 -0500 Subject: Reland Cleanup CPDF_MeshStream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL fixes up the bits of the CPDF_MeshStream CL that depended on the Origin CL and integrates the fixes for the Skia bots. Change-Id: I470e49c35b809f00fecbaeb303de15c0db3fe590 Reviewed-on: https://pdfium-review.googlesource.com/2698 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- core/fpdfapi/page/cpdf_meshstream.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'core/fpdfapi/page/cpdf_meshstream.h') diff --git a/core/fpdfapi/page/cpdf_meshstream.h b/core/fpdfapi/page/cpdf_meshstream.h index 21a6c2fa8c..24f1d66cfd 100644 --- a/core/fpdfapi/page/cpdf_meshstream.h +++ b/core/fpdfapi/page/cpdf_meshstream.h @@ -8,6 +8,7 @@ #define CORE_FPDFAPI_PAGE_CPDF_MESHSTREAM_H_ #include +#include #include #include "core/fpdfapi/page/cpdf_shadingpattern.h" @@ -15,9 +16,13 @@ #include "core/fxcrt/fx_basic.h" #include "core/fxcrt/fx_system.h" -struct CPDF_MeshVertex { - FX_FLOAT x; - FX_FLOAT y; +class CPDF_MeshVertex { + public: + CPDF_MeshVertex(); + CPDF_MeshVertex(const CPDF_MeshVertex&); + ~CPDF_MeshVertex(); + + CFX_PointF position; FX_FLOAT r; FX_FLOAT g; FX_FLOAT b; @@ -37,14 +42,14 @@ class CPDF_MeshStream { bool Load(); - uint32_t GetFlag(); - void GetCoords(FX_FLOAT& x, FX_FLOAT& y); - void GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b); + uint32_t ReadFlag(); + CFX_PointF ReadCoords(); + std::tuple ReadColor(); - uint32_t GetVertex(CPDF_MeshVertex& vertex, CFX_Matrix* pObject2Bitmap); - bool GetVertexRow(CPDF_MeshVertex* vertex, - int count, - CFX_Matrix* pObject2Bitmap); + CPDF_MeshVertex ReadVertex(const CFX_Matrix& pObject2Bitmap, uint32_t* flag); + bool ReadVertexRow(const CFX_Matrix& pObject2Bitmap, + int count, + CPDF_MeshVertex* vertex); CFX_BitStream* BitStream() { return &m_BitStream; } uint32_t ComponentBits() const { return m_nComponentBits; } -- cgit v1.2.3