Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: core/fpdfapi/fpdf_page/cpdf_meshstream.h

Issue 2000973002: Make CPDF_Function::Load() return an unique_ptr. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: fix build, nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_colorspace.cpp ('k') | core/fpdfapi/fpdf_page/cpdf_meshstream.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_page/cpdf_meshstream.h
diff --git a/core/fpdfapi/fpdf_page/cpdf_meshstream.h b/core/fpdfapi/fpdf_page/cpdf_meshstream.h
index 462dcf09c75e0da0a731918f1551acecf2bf52a0..e5d37fe36b1c25075a15669ad47a562dff0b787e 100644
--- a/core/fpdfapi/fpdf_page/cpdf_meshstream.h
+++ b/core/fpdfapi/fpdf_page/cpdf_meshstream.h
@@ -7,6 +7,9 @@
#ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_MESHSTREAM_H_
#define CORE_FPDFAPI_FPDF_PAGE_CPDF_MESHSTREAM_H_
+#include <memory>
+#include <vector>
+
#include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h"
#include "core/fxcrt/include/fx_basic.h"
#include "core/fxcrt/include/fx_system.h"
@@ -26,11 +29,10 @@ class CPDF_Stream;
class CPDF_MeshStream {
public:
- FX_BOOL Load(CPDF_Stream* pShadingStream,
- CPDF_Function** pFuncs,
- int nFuncs,
- CPDF_ColorSpace* pCS);
+ CPDF_MeshStream(const std::vector<std::unique_ptr<CPDF_Function>>& funcs,
+ CPDF_ColorSpace* pCS);
+ bool Load(CPDF_Stream* pShadingStream);
uint32_t GetFlag();
void GetCoords(FX_FLOAT& x, FX_FLOAT& y);
@@ -41,9 +43,15 @@ class CPDF_MeshStream {
int count,
CFX_Matrix* pObject2Bitmap);
- CPDF_Function** m_pFuncs;
- CPDF_ColorSpace* m_pCS;
- uint32_t m_nFuncs;
+ CFX_BitStream* BitStream() { return &m_BitStream; }
+ uint32_t CoordBits() const { return m_nCoordBits; }
+ uint32_t CompBits() const { return m_nCompBits; }
+ uint32_t FlagBits() const { return m_nFlagBits; }
+ uint32_t comps() const { return m_nComps; }
+
+ private:
+ const std::vector<std::unique_ptr<CPDF_Function>>& m_funcs;
+ CPDF_ColorSpace* const m_pCS;
uint32_t m_nCoordBits;
uint32_t m_nCompBits;
uint32_t m_nFlagBits;
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_colorspace.cpp ('k') | core/fpdfapi/fpdf_page/cpdf_meshstream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698