summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-24 23:51:37 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-24 23:51:37 +0000
commitb093c688eca06d43385cdc3aff2d0ba7395dbcc9 (patch)
tree37643130150aad3231bb4ee80c5e2a53f338152d /core/fpdfapi
parentd8a3bc9ce941062fa4dd8cc2d03b16af402adafe (diff)
downloadpdfium-b093c688eca06d43385cdc3aff2d0ba7395dbcc9.tar.xz
Initialize CPDF_GeneralState::StateData in the header.
Change-Id: I7049073c09ac87ef8041bfa51740c653a67b4bd3 Reviewed-on: https://pdfium-review.googlesource.com/c/44543 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_generalstate.cpp24
-rw-r--r--core/fpdfapi/page/cpdf_generalstate.h27
2 files changed, 15 insertions, 36 deletions
diff --git a/core/fpdfapi/page/cpdf_generalstate.cpp b/core/fpdfapi/page/cpdf_generalstate.cpp
index ea912736fe..7687626e54 100644
--- a/core/fpdfapi/page/cpdf_generalstate.cpp
+++ b/core/fpdfapi/page/cpdf_generalstate.cpp
@@ -6,7 +6,6 @@
#include "core/fpdfapi/page/cpdf_generalstate.h"
-#include "constants/transparency.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/render/cpdf_dibbase.h"
#include "core/fpdfapi/render/cpdf_docrenderdata.h"
@@ -259,28 +258,7 @@ CFX_Matrix* CPDF_GeneralState::GetMutableMatrix() {
return &m_Ref.GetPrivateCopy()->m_Matrix;
}
-CPDF_GeneralState::StateData::StateData()
- : m_BlendMode(pdfium::transparency::kNormal),
- m_BlendType(0),
- m_StrokeAlpha(1.0),
- m_FillAlpha(1.0f),
- m_pTR(nullptr),
- m_pTransferFunc(nullptr),
- m_RenderIntent(0),
- m_StrokeAdjust(false),
- m_AlphaSource(false),
- m_TextKnockout(false),
- m_StrokeOP(false),
- m_FillOP(false),
- m_OPMode(0),
- m_pBG(nullptr),
- m_pUCR(nullptr),
- m_pHT(nullptr),
- m_Flatness(1.0f),
- m_Smoothness(0.0f) {
- m_SMaskMatrix.SetIdentity();
- m_Matrix.SetIdentity();
-}
+CPDF_GeneralState::StateData::StateData() = default;
CPDF_GeneralState::StateData::StateData(const StateData& that)
: m_BlendMode(that.m_BlendMode),
diff --git a/core/fpdfapi/page/cpdf_generalstate.h b/core/fpdfapi/page/cpdf_generalstate.h
index 9ee20db8a5..096271fd8b 100644
--- a/core/fpdfapi/page/cpdf_generalstate.h
+++ b/core/fpdfapi/page/cpdf_generalstate.h
@@ -7,6 +7,7 @@
#ifndef CORE_FPDFAPI_PAGE_CPDF_GENERALSTATE_H_
#define CORE_FPDFAPI_PAGE_CPDF_GENERALSTATE_H_
+#include "constants/transparency.h"
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/shared_copy_on_write.h"
@@ -83,27 +84,27 @@ class CPDF_GeneralState {
StateData(const StateData& that);
~StateData() override;
- ByteString m_BlendMode;
- int m_BlendType;
+ ByteString m_BlendMode = pdfium::transparency::kNormal;
+ int m_BlendType = FXDIB_BLEND_NORMAL;
UnownedPtr<CPDF_Object> m_pSoftMask;
CFX_Matrix m_SMaskMatrix;
- float m_StrokeAlpha;
- float m_FillAlpha;
+ float m_StrokeAlpha = 1.0f;
+ float m_FillAlpha = 1.0f;
UnownedPtr<const CPDF_Object> m_pTR;
RetainPtr<CPDF_TransferFunc> m_pTransferFunc;
CFX_Matrix m_Matrix;
- int m_RenderIntent;
- bool m_StrokeAdjust;
- bool m_AlphaSource;
- bool m_TextKnockout;
- bool m_StrokeOP;
- bool m_FillOP;
- int m_OPMode;
+ int m_RenderIntent = 0;
+ bool m_StrokeAdjust = false;
+ bool m_AlphaSource = false;
+ bool m_TextKnockout = false;
+ bool m_StrokeOP = false;
+ bool m_FillOP = false;
+ int m_OPMode = 0;
UnownedPtr<const CPDF_Object> m_pBG;
UnownedPtr<const CPDF_Object> m_pUCR;
UnownedPtr<const CPDF_Object> m_pHT;
- float m_Flatness;
- float m_Smoothness;
+ float m_Flatness = 1.0f;
+ float m_Smoothness = 0.0f;
};
SharedCopyOnWrite<StateData> m_Ref;