diff options
author | thestig <thestig@chromium.org> | 2016-05-26 10:45:30 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-26 10:45:30 -0700 |
commit | 41846a0fcc7d98476a18ec6c97778ead58069d99 (patch) | |
tree | a91f1273a03ca027c066a571b41f590896404574 /core/fxge/agg | |
parent | e9885e77a7daf7a8d45eaf0290a1ea5f208c24c6 (diff) | |
download | pdfium-41846a0fcc7d98476a18ec6c97778ead58069d99.tar.xz |
Remove default argument from RestoreState() methods.
Review-Url: https://codereview.chromium.org/2009803003
Diffstat (limited to 'core/fxge/agg')
-rw-r--r-- | core/fxge/agg/fx_agg_driver.cpp | 16 | ||||
-rw-r--r-- | core/fxge/agg/fx_agg_driver.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp index 6726877d99..86326f6caf 100644 --- a/core/fxge/agg/fx_agg_driver.cpp +++ b/core/fxge/agg/fx_agg_driver.cpp @@ -284,21 +284,21 @@ void CFX_AggDeviceDriver::SaveState() { m_StateStack.Add(pClip); } -void CFX_AggDeviceDriver::RestoreState(FX_BOOL bKeepSaved) { - if (m_StateStack.GetSize() == 0) { - delete m_pClipRgn; - m_pClipRgn = nullptr; - return; - } - CFX_ClipRgn* pSavedClip = m_StateStack[m_StateStack.GetSize() - 1]; +void CFX_AggDeviceDriver::RestoreState(bool bKeepSaved) { delete m_pClipRgn; m_pClipRgn = nullptr; + + int size = m_StateStack.GetSize(); + if (!size) + return; + + CFX_ClipRgn* pSavedClip = m_StateStack[size - 1]; if (bKeepSaved) { if (pSavedClip) { m_pClipRgn = new CFX_ClipRgn(*pSavedClip); } } else { - m_StateStack.RemoveAt(m_StateStack.GetSize() - 1); + m_StateStack.RemoveAt(size - 1); m_pClipRgn = pSavedClip; } } diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h index 18f8d348ce..a33bc09937 100644 --- a/core/fxge/agg/fx_agg_driver.h +++ b/core/fxge/agg/fx_agg_driver.h @@ -40,7 +40,7 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver { // IFX_RenderDeviceDriver int GetDeviceCaps(int caps_id) override; void SaveState() override; - void RestoreState(FX_BOOL bKeepSaved) override; + void RestoreState(bool bKeepSaved) override; FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, const CFX_Matrix* pObject2Device, int fill_mode) override; |