summaryrefslogtreecommitdiff
path: root/core/src/fxge
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-12-09 16:26:21 -0800
committerTom Sepez <tsepez@chromium.org>2015-12-09 16:26:21 -0800
commit035359cd8ddb555fa33b6133db4fd405e4660712 (patch)
tree89accecac7da250468166168cd502ed7b92c7ce7 /core/src/fxge
parent0c92bed7ade20fe193dce0a481dad48e1be41622 (diff)
downloadpdfium-035359cd8ddb555fa33b6133db4fd405e4660712.tar.xz
Get rid of most uses of CFX_PtrArray.
I didn't go whole hog and replace these with std::vector, but in the mean time, it is silly to cast a typedef for a template instantiated against void* when we can just instantiate the template against the actual type. The ones that remain are actual heterogeneous arrays with wacky casting. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1518593002 .
Diffstat (limited to 'core/src/fxge')
-rw-r--r--core/src/fxge/agg/include/fx_agg_driver.h2
-rw-r--r--core/src/fxge/agg/src/fx_agg_driver.cpp7
2 files changed, 4 insertions, 5 deletions
diff --git a/core/src/fxge/agg/include/fx_agg_driver.h b/core/src/fxge/agg/include/fx_agg_driver.h
index 77d2f2af6e..0e79a3fc5e 100644
--- a/core/src/fxge/agg/include/fx_agg_driver.h
+++ b/core/src/fxge/agg/include/fx_agg_driver.h
@@ -137,7 +137,7 @@ class CFX_AggDeviceDriver : public IFX_RenderDeviceDriver {
CFX_DIBitmap* m_pBitmap;
CFX_ClipRgn* m_pClipRgn;
- CFX_PtrArray m_StateStack;
+ CFX_ArrayTemplate<CFX_ClipRgn*> m_StateStack;
void* m_pPlatformGraphics;
void* m_pPlatformBitmap;
void* m_pDwRenderTartget;
diff --git a/core/src/fxge/agg/src/fx_agg_driver.cpp b/core/src/fxge/agg/src/fx_agg_driver.cpp
index 78186a8f96..4b3389bb4c 100644
--- a/core/src/fxge/agg/src/fx_agg_driver.cpp
+++ b/core/src/fxge/agg/src/fx_agg_driver.cpp
@@ -211,7 +211,7 @@ CFX_AggDeviceDriver::CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap,
CFX_AggDeviceDriver::~CFX_AggDeviceDriver() {
delete m_pClipRgn;
for (int i = 0; i < m_StateStack.GetSize(); i++)
- delete (CFX_ClipRgn*)m_StateStack[i];
+ delete m_StateStack[i];
DestroyPlatform();
}
#if _FXM_PLATFORM_ != _FXM_PLATFORM_APPLE_
@@ -266,7 +266,7 @@ int CFX_AggDeviceDriver::GetDeviceCaps(int caps_id) {
return 0;
}
void CFX_AggDeviceDriver::SaveState() {
- void* pClip = NULL;
+ CFX_ClipRgn* pClip = NULL;
if (m_pClipRgn) {
pClip = new CFX_ClipRgn(*m_pClipRgn);
}
@@ -278,8 +278,7 @@ void CFX_AggDeviceDriver::RestoreState(FX_BOOL bKeepSaved) {
m_pClipRgn = NULL;
return;
}
- CFX_ClipRgn* pSavedClip =
- (CFX_ClipRgn*)m_StateStack[m_StateStack.GetSize() - 1];
+ CFX_ClipRgn* pSavedClip = m_StateStack[m_StateStack.GetSize() - 1];
delete m_pClipRgn;
m_pClipRgn = NULL;
if (bKeepSaved) {