diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-14 11:55:21 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-14 18:13:11 +0000 |
commit | 940f559b985d4a742c21b21cb077a232e44dd289 (patch) | |
tree | ceae19d15f2e97b332dd4ef7eb0dcc458d0281d9 /core/fpdfapi/page/cpdf_meshstream.h | |
parent | f528eee136a602643a7777d87a2cce52cf83f38a (diff) | |
download | pdfium-940f559b985d4a742c21b21cb077a232e44dd289.tar.xz |
Reland Cleanup CPDF_MeshStream
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 <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_meshstream.h')
-rw-r--r-- | core/fpdfapi/page/cpdf_meshstream.h | 25 |
1 files changed, 15 insertions, 10 deletions
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 <memory> +#include <tuple> #include <vector> #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<FX_FLOAT, FX_FLOAT, FX_FLOAT> 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; } |