summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-12 10:38:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-12 10:38:24 -0700
commit6d689942f295565563253e9697a043f87b3796c2 (patch)
tree27944b86b89bceb225aeebc775e6a54cf6c6aa89 /xfa
parent25c223d1c3a662a0e69a5bf95083afbd5fa3cd97 (diff)
downloadpdfium-6d689942f295565563253e9697a043f87b3796c2.tar.xz
Remove unused FWL_WidgetMgrSnapshot() and FWL_WriteBMP().
Review URL: https://codereview.chromium.org/1878293002
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fwl/core/fwl_widgetmgrimp.cpp50
-rw-r--r--xfa/fwl/core/ifwl_widgetmgr.h3
2 files changed, 0 insertions, 53 deletions
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp
index 97a3cbc1f1..cbf6a9d883 100644
--- a/xfa/fwl/core/fwl_widgetmgrimp.cpp
+++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp
@@ -1007,56 +1007,6 @@ FX_BOOL CFWL_WidgetMgrDelegate::bUseOffscreenDirect(IFWL_Widget* pWidget) {
#endif
return pItem->iRedrawCounter == 0;
}
-static void FWL_WriteBMP(CFX_DIBitmap* pBitmap, const FX_CHAR* filename) {
- FILE* file = fopen(filename, "wb");
- if (file == NULL) {
- return;
- }
- int size = 14 + 40 + pBitmap->GetPitch() * pBitmap->GetHeight();
- unsigned char buffer[40];
- buffer[0] = 'B';
- buffer[1] = 'M';
- buffer[2] = (unsigned char)size;
- buffer[3] = (unsigned char)(size >> 8);
- buffer[4] = (unsigned char)(size >> 16);
- buffer[5] = (unsigned char)(size >> 24);
- buffer[6] = buffer[7] = buffer[8] = buffer[9] = 0;
- buffer[10] = 54;
- buffer[11] = buffer[12] = buffer[13] = 0;
- fwrite(buffer, 14, 1, file);
- memset(buffer, 0, 40);
- buffer[0] = 40;
- buffer[4] = (unsigned char)pBitmap->GetWidth();
- buffer[5] = (unsigned char)(pBitmap->GetWidth() >> 8);
- buffer[6] = (unsigned char)(pBitmap->GetWidth() >> 16);
- buffer[7] = (unsigned char)(pBitmap->GetWidth() >> 24);
- buffer[8] = (unsigned char)(-pBitmap->GetHeight());
- buffer[9] = (unsigned char)((-pBitmap->GetHeight()) >> 8);
- buffer[10] = (unsigned char)((-pBitmap->GetHeight()) >> 16);
- buffer[11] = (unsigned char)((-pBitmap->GetHeight()) >> 24);
- buffer[12] = 1;
- buffer[14] = pBitmap->GetBPP();
- fwrite(buffer, 40, 1, file);
- for (int row = 0; row < pBitmap->GetHeight(); row++) {
- uint8_t* scan_line = pBitmap->GetBuffer() + row * pBitmap->GetPitch();
- fwrite(scan_line, pBitmap->GetPitch(), 1, file);
- }
- fclose(file);
-}
-FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget* pWidget,
- const CFX_WideString* saveFile,
- const CFX_Matrix* pMatrix) {
- CFX_RectF r;
- pWidget->GetWidgetRect(r);
- CFX_Graphics gs;
- gs.Create((int32_t)r.width, (int32_t)r.height, FXDIB_Argb);
- CFWL_WidgetMgr* widgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
- CFWL_WidgetMgrDelegate* delegate = widgetMgr->GetDelegate();
- delegate->OnDrawWidget(pWidget, &gs, pMatrix);
- CFX_DIBitmap* dib = gs.GetRenderDevice()->GetBitmap();
- FWL_WriteBMP(dib, saveFile->UTF8Encode());
- return FWL_ERR_Succeeded;
-}
FX_BOOL FWL_WidgetIsChild(IFWL_Widget* parent, IFWL_Widget* find) {
if (!find) {
return FALSE;
diff --git a/xfa/fwl/core/ifwl_widgetmgr.h b/xfa/fwl/core/ifwl_widgetmgr.h
index 648206eea9..955e6bab5b 100644
--- a/xfa/fwl/core/ifwl_widgetmgr.h
+++ b/xfa/fwl/core/ifwl_widgetmgr.h
@@ -44,8 +44,5 @@ class IFWL_WidgetMgr {
IFWL_WidgetMgr* FWL_GetWidgetMgr();
FX_BOOL FWL_WidgetIsChild(IFWL_Widget* parent, IFWL_Widget* find);
-FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget* pWidget,
- const CFX_WideString* saveFile,
- const CFX_Matrix* pMatrix = NULL);
#endif // XFA_FWL_CORE_IFWL_WIDGETMGR_H_