summaryrefslogtreecommitdiff
path: root/core/fxge/ge
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-05-26 10:45:30 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-26 10:45:30 -0700
commit41846a0fcc7d98476a18ec6c97778ead58069d99 (patch)
treea91f1273a03ca027c066a571b41f590896404574 /core/fxge/ge
parente9885e77a7daf7a8d45eaf0290a1ea5f208c24c6 (diff)
downloadpdfium-41846a0fcc7d98476a18ec6c97778ead58069d99.tar.xz
Remove default argument from RestoreState() methods.
Review-Url: https://codereview.chromium.org/2009803003
Diffstat (limited to 'core/fxge/ge')
-rw-r--r--core/fxge/ge/fx_ge_device.cpp4
-rw-r--r--core/fxge/ge/fx_ge_ps.cpp18
2 files changed, 15 insertions, 7 deletions
diff --git a/core/fxge/ge/fx_ge_device.cpp b/core/fxge/ge/fx_ge_device.cpp
index 0d6addab75..2d3ba566be 100644
--- a/core/fxge/ge/fx_ge_device.cpp
+++ b/core/fxge/ge/fx_ge_device.cpp
@@ -40,10 +40,12 @@ void CFX_RenderDevice::EndRendering() {
void CFX_RenderDevice::SaveState() {
m_pDeviceDriver->SaveState();
}
-void CFX_RenderDevice::RestoreState(FX_BOOL bKeepSaved) {
+
+void CFX_RenderDevice::RestoreState(bool bKeepSaved) {
m_pDeviceDriver->RestoreState(bKeepSaved);
UpdateClipBox();
}
+
int CFX_RenderDevice::GetDeviceCaps(int caps_id) const {
return m_pDeviceDriver->GetDeviceCaps(caps_id);
}
diff --git a/core/fxge/ge/fx_ge_ps.cpp b/core/fxge/ge/fx_ge_ps.cpp
index 98253336a1..b112cf3630 100644
--- a/core/fxge/ge/fx_ge_ps.cpp
+++ b/core/fxge/ge/fx_ge_ps.cpp
@@ -77,19 +77,25 @@ void CFX_PSRenderer::SaveState() {
OUTPUT_PS("q\n");
m_ClipBoxStack.Add(m_ClipBox);
}
-void CFX_PSRenderer::RestoreState(FX_BOOL bKeepSaved) {
+
+void CFX_PSRenderer::RestoreState(bool bKeepSaved) {
StartRendering();
if (bKeepSaved) {
OUTPUT_PS("Q\nq\n");
} else {
OUTPUT_PS("Q\n");
}
- m_bColorSet = m_bGraphStateSet = FALSE;
- m_ClipBox = m_ClipBoxStack.GetAt(m_ClipBoxStack.GetSize() - 1);
- if (!bKeepSaved) {
- m_ClipBoxStack.RemoveAt(m_ClipBoxStack.GetSize() - 1);
- }
+ m_bColorSet = FALSE;
+ m_bGraphStateSet = FALSE;
+ int size = m_ClipBoxStack.GetSize();
+ if (!size)
+ return;
+
+ m_ClipBox = m_ClipBoxStack.GetAt(size - 1);
+ if (!bKeepSaved)
+ m_ClipBoxStack.RemoveAt(size - 1);
}
+
void CFX_PSRenderer::OutputPath(const CFX_PathData* pPathData,
const CFX_Matrix* pObject2Device) {
int nPoints = pPathData->GetPointCount();