summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-13 10:58:52 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-13 10:58:52 -0700
commit08153b16fb1c7e9849cc33f1b9d4f1521240d18e (patch)
tree4906b17cc38830d9a341b571011c930907c06795
parent6d8e981b51458f0381031fe240f5215db9906622 (diff)
downloadpdfium-08153b16fb1c7e9849cc33f1b9d4f1521240d18e.tar.xz
Remove IFDE_Image, IFDE_PathSet, IFDE_ImageSet, and IFDE_WidgetSet.
These interfaces were not implemented, removed. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1866333003
-rw-r--r--BUILD.gn1
-rw-r--r--xfa.gyp1
-rw-r--r--xfa/fde/fde_gedevice.cpp1
-rw-r--r--xfa/fde/fde_image.h42
-rw-r--r--xfa/fde/fde_iterator.cpp19
-rw-r--r--xfa/fde/fde_iterator.h1
-rw-r--r--xfa/fde/fde_render.cpp35
-rw-r--r--xfa/fde/fde_visualset.h53
8 files changed, 10 insertions, 143 deletions
diff --git a/BUILD.gn b/BUILD.gn
index a711559ccd..11122b9283 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -919,7 +919,6 @@ if (pdf_enable_xfa) {
"xfa/fde/fde_gedevice.h",
"xfa/fde/fde_geobject.cpp",
"xfa/fde/fde_geobject.h",
- "xfa/fde/fde_image.h",
"xfa/fde/fde_iterator.cpp",
"xfa/fde/fde_iterator.h",
"xfa/fde/fde_object.h",
diff --git a/xfa.gyp b/xfa.gyp
index 88b6e586d9..a0b2580aae 100644
--- a/xfa.gyp
+++ b/xfa.gyp
@@ -66,7 +66,6 @@
"xfa/fde/fde_gedevice.h",
"xfa/fde/fde_geobject.cpp",
"xfa/fde/fde_geobject.h",
- "xfa/fde/fde_image.h",
"xfa/fde/fde_iterator.cpp",
"xfa/fde/fde_iterator.h",
"xfa/fde/fde_object.h",
diff --git a/xfa/fde/fde_gedevice.cpp b/xfa/fde/fde_gedevice.cpp
index e289ef9ec2..605c4f97c0 100644
--- a/xfa/fde/fde_gedevice.cpp
+++ b/xfa/fde/fde_gedevice.cpp
@@ -9,7 +9,6 @@
#include <algorithm>
#include "xfa/fde/fde_geobject.h"
-#include "xfa/fde/fde_image.h"
#include "xfa/fde/fde_object.h"
IFDE_RenderDevice* IFDE_RenderDevice::Create(CFX_DIBitmap* pBitmap,
diff --git a/xfa/fde/fde_image.h b/xfa/fde/fde_image.h
deleted file mode 100644
index 011f232370..0000000000
--- a/xfa/fde/fde_image.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FDE_FDE_IMAGE_H_
-#define XFA_FDE_FDE_IMAGE_H_
-
-#include "xfa/fgas/crt/fgas_memory.h"
-#include "xfa/fgas/crt/fgas_stream.h"
-#include "xfa/fgas/crt/fgas_utils.h"
-
-class IFDE_Image {
- public:
- virtual ~IFDE_Image() {}
- virtual void Release() = 0;
- virtual FX_BOOL LoadImage() = 0;
- virtual void FreeImage() = 0;
- virtual int32_t CountFrames() const = 0;
- virtual FX_BOOL LoadFrame(int32_t index) = 0;
- virtual CFX_DIBitmap* GetFrameImage() = 0;
- virtual int32_t GetImageFormat() const = 0;
- virtual int32_t GetImageWidth() const = 0;
- virtual int32_t GetImageHeight() const = 0;
- virtual int32_t GetDelayTime(int32_t iFrameIndex) const = 0;
- virtual int32_t GetLoopCount() const = 0;
- virtual FX_BOOL StartLoadImage(CFX_DIBitmap* pDIBitmap,
- int32_t dibX,
- int32_t dibY,
- int32_t dibCX,
- int32_t dibCY,
- int32_t imgX,
- int32_t imgY,
- int32_t imgCX,
- int32_t imgCY,
- int32_t iFrameIndex = 0) = 0;
- virtual int32_t DoLoadImage(IFX_Pause* pPause = NULL) = 0;
- virtual void StopLoadImage() = 0;
-};
-
-#endif // XFA_FDE_FDE_IMAGE_H_
diff --git a/xfa/fde/fde_iterator.cpp b/xfa/fde/fde_iterator.cpp
index 097be1d01f..4356e22ee2 100644
--- a/xfa/fde/fde_iterator.cpp
+++ b/xfa/fde/fde_iterator.cpp
@@ -28,16 +28,14 @@ FX_BOOL CFDE_VisualSetIterator::AttachCanvas(IFDE_CanvasSet* pCanvas) {
return m_CanvasStack.Push(canvas) == 0;
}
FX_BOOL CFDE_VisualSetIterator::FilterObjects(uint32_t dwObjects) {
- if (m_CanvasStack.GetSize() == 0) {
+ if (m_CanvasStack.GetSize() == 0)
return FALSE;
- }
- while (m_CanvasStack.GetSize() > 1) {
+
+ while (m_CanvasStack.GetSize() > 1)
m_CanvasStack.Pop();
- }
- m_dwFilter = dwObjects & ~(uint32_t)FDE_VISUALOBJ_Widget;
- if (dwObjects & FDE_VISUALOBJ_Widget) {
- m_dwFilter |= 0xFF00;
- }
+
+ m_dwFilter = dwObjects;
+
FDE_CANVASITEM* pCanvas = m_CanvasStack.GetTopElement();
FXSYS_assert(pCanvas != NULL && pCanvas->pCanvas != NULL);
pCanvas->hPos = pCanvas->pCanvas->GetFirstPosition(NULL);
@@ -72,10 +70,7 @@ FDE_HVISUALOBJ CFDE_VisualSetIterator::GetNext(IFDE_VisualSet*& pVisualSet,
m_CanvasStack.Push(canvas);
break;
}
- uint32_t dwObj =
- (eType == FDE_VISUALOBJ_Widget)
- ? (uint32_t)((IFDE_WidgetSet*)pVisualSet)->GetWidgetType(hObj)
- : (uint32_t)eType;
+ uint32_t dwObj = (uint32_t)eType;
if ((m_dwFilter & dwObj) != 0) {
if (ppCanvasSet) {
*ppCanvasSet = pCanvas->pCanvas;
diff --git a/xfa/fde/fde_iterator.h b/xfa/fde/fde_iterator.h
index 5a0e7566a0..737fb8935f 100644
--- a/xfa/fde/fde_iterator.h
+++ b/xfa/fde/fde_iterator.h
@@ -9,6 +9,7 @@
#include "xfa/fde/fde_visualset.h"
#include "xfa/fgas/crt/fgas_memory.h"
+#include "xfa/fgas/crt/fgas_utils.h"
struct FDE_CANVASITEM {
IFDE_CanvasSet* pCanvas;
diff --git a/xfa/fde/fde_render.cpp b/xfa/fde/fde_render.cpp
index 59bb5f1aa2..b4259f71d9 100644
--- a/xfa/fde/fde_render.cpp
+++ b/xfa/fde/fde_render.cpp
@@ -26,7 +26,6 @@ class CFDE_RenderContext : public IFDE_RenderContext, public CFX_Target {
virtual FDE_RENDERSTATUS GetStatus() const { return m_eStatus; }
virtual FDE_RENDERSTATUS DoRender(IFX_Pause* pPause = nullptr);
virtual void StopRender();
- void RenderPath(IFDE_PathSet* pPathSet, FDE_HVISUALOBJ hPath);
void RenderText(IFDE_TextSet* pTextSet, FDE_HVISUALOBJ hText);
FX_BOOL ApplyClip(IFDE_VisualSet* pVisualSet,
FDE_HVISUALOBJ hObj,
@@ -169,13 +168,6 @@ FDE_RENDERSTATUS CFDE_RenderContext::DoRender(IFX_Pause* pPause) {
RenderText((IFDE_TextSet*)pVisualSet, hVisualObj);
iCount += 5;
break;
- case FDE_VISUALOBJ_Path:
- RenderPath((IFDE_PathSet*)pVisualSet, hVisualObj);
- iCount += 20;
- break;
- case FDE_VISUALOBJ_Widget:
- iCount += 10;
- break;
case FDE_VISUALOBJ_Canvas:
FXSYS_assert(FALSE);
break;
@@ -243,33 +235,6 @@ void CFDE_RenderContext::RenderText(IFDE_TextSet* pTextSet,
RestoreClip(hState);
}
-void CFDE_RenderContext::RenderPath(IFDE_PathSet* pPathSet,
- FDE_HVISUALOBJ hPath) {
- FXSYS_assert(m_pRenderDevice);
- FXSYS_assert(pPathSet && hPath);
-
- IFDE_Path* pPath = pPathSet->GetPath(hPath);
- if (!pPath)
- return;
-
- FDE_HDEVICESTATE hState;
- FX_BOOL bClip = ApplyClip(pPathSet, hPath, hState);
- int32_t iRenderMode = pPathSet->GetRenderMode(hPath);
- if (iRenderMode & FDE_PATHRENDER_Stroke) {
- CFDE_Pen* pPen = pPathSet->GetPen(hPath);
- FX_FLOAT fWidth = pPathSet->GetPenWidth(hPath);
- if (pPen && fWidth > 0)
- m_pRenderDevice->DrawPath(pPen, fWidth, pPath, &m_Transform);
- }
- if (iRenderMode & FDE_PATHRENDER_Fill) {
- CFDE_Brush* pBrush = pPathSet->GetBrush(hPath);
- if (pBrush)
- m_pRenderDevice->FillPath(pBrush, pPath, &m_Transform);
- }
- if (bClip)
- RestoreClip(hState);
-}
-
FX_BOOL CFDE_RenderContext::ApplyClip(IFDE_VisualSet* pVisualSet,
FDE_HVISUALOBJ hObj,
FDE_HDEVICESTATE& hState) {
diff --git a/xfa/fde/fde_visualset.h b/xfa/fde/fde_visualset.h
index 2c95253315..778d2dcb7a 100644
--- a/xfa/fde/fde_visualset.h
+++ b/xfa/fde/fde_visualset.h
@@ -11,17 +11,14 @@
#include "core/fxcrt/include/fx_system.h"
#include "core/fxge/include/fx_dib.h"
#include "core/fxge/include/fx_ge.h"
-#include "xfa/fde/fde_image.h"
#include "xfa/fde/fde_object.h"
#include "xfa/fde/fde_path.h"
+#include "xfa/fgas/crt/fgas_memory.h"
#include "xfa/fgas/font/fgas_font.h"
enum FDE_VISUALOBJTYPE {
FDE_VISUALOBJ_Canvas = 0x00,
- FDE_VISUALOBJ_Text = 0x01,
- FDE_VISUALOBJ_Image = 0x02,
- FDE_VISUALOBJ_Path = 0x04,
- FDE_VISUALOBJ_Widget = 0x08,
+ FDE_VISUALOBJ_Text = 0x01
};
typedef struct FDE_HVISUALOBJ_ { void* pData; } const* FDE_HVISUALOBJ;
@@ -60,52 +57,6 @@ class IFDE_TextSet : public IFDE_VisualSet {
CFX_RectFArray& rtArray) = 0;
};
-struct FDE_IMAGEFILTERPARAMS : public CFX_Target {
- int32_t iFilterType;
-};
-
-class IFDE_ImageSet : public IFDE_VisualSet {
- public:
- virtual IFDE_Image* GetImage(FDE_HVISUALOBJ hImage) = 0;
- virtual FX_POSITION GetFirstFilterPosition(FDE_HVISUALOBJ hImage) = 0;
- virtual const FDE_IMAGEFILTERPARAMS* GetNextFilter(FDE_HVISUALOBJ hImage,
- FX_POSITION& pos) = 0;
-};
-
-class IFDE_PathSet : public IFDE_VisualSet {
- public:
- virtual IFDE_Path* GetPath(FDE_HVISUALOBJ hPath) = 0;
- virtual int32_t GetFillMode(FDE_HVISUALOBJ hPath) = 0;
- virtual int32_t GetRenderMode(FDE_HVISUALOBJ hPath) = 0;
- virtual CFDE_Pen* GetPen(FDE_HVISUALOBJ hPath) = 0;
- virtual FX_FLOAT GetPenWidth(FDE_HVISUALOBJ hPath) = 0;
- virtual CFDE_Brush* GetBrush(FDE_HVISUALOBJ hPath) = 0;
-};
-
-enum FDE_WIDGETOBJ {
- FDE_WIDGETOBJ_Unknown = 0x0000,
- FDE_WIDGETOBJ_Anchor = 0x0100,
- FDE_WIDGETOBJ_NamedDest = 0x0200,
- FDE_WIDGETOBJ_HyperLink = 0x0400,
-};
-
-class IFDE_WidgetSet : public IFDE_VisualSet {
- public:
- virtual FDE_WIDGETOBJ GetWidgetType(FDE_HVISUALOBJ hWidget) = 0;
- virtual FX_FLOAT GetFloat(FDE_HVISUALOBJ hWidget,
- int32_t iParameter,
- FX_FLOAT fDefVal = 0.0f) = 0;
- virtual int32_t GetInteger(FDE_HVISUALOBJ hWidget,
- int32_t iParameter,
- int32_t iDefVal = 0) = 0;
- virtual FX_BOOL GetString(FDE_HVISUALOBJ hWidget,
- int32_t iParameter,
- CFX_WideString& wsValue) = 0;
- virtual FX_BOOL GetRects(FDE_HVISUALOBJ hWidget,
- int32_t iParameter,
- CFX_RectFArray& rects) = 0;
-};
-
class IFDE_VisualSetIterator {
public:
static IFDE_VisualSetIterator* Create();