Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: core/fxge/win32/fx_win32_device.cpp

Issue 2019603002: Remove unused PS generation code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@print_clean
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxge/include/fx_ge_win32.h ('k') | core/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxge/include/fx_ge.h" 7 #include "core/fxge/include/fx_ge.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 } 1401 }
1402 CFX_DIBExtractor temp(pSource); 1402 CFX_DIBExtractor temp(pSource);
1403 CFX_DIBitmap* pBitmap = temp; 1403 CFX_DIBitmap* pBitmap = temp;
1404 if (pBitmap) { 1404 if (pBitmap) {
1405 return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, 1405 return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width,
1406 dest_height, flags, pIccTransform); 1406 dest_height, flags, pIccTransform);
1407 } 1407 }
1408 return FALSE; 1408 return FALSE;
1409 } 1409 }
1410 1410
1411 // static 1411 CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC) {
1412 int CFX_WindowsDevice::m_psLevel = 2; 1412 SetDeviceDriver(CreateDriver(hDC));
1413 }
1413 1414
1414 CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC, 1415 CFX_WindowsDevice::~CFX_WindowsDevice() {}
1415 FX_BOOL bCmykOutput,
1416 FX_BOOL bForcePSOutput,
1417 int psLevel) {
1418 m_bForcePSOutput = bForcePSOutput;
1419 m_psLevel = psLevel;
1420 if (bForcePSOutput) {
1421 IFX_RenderDeviceDriver* pDriver = new CPSPrinterDriver;
1422 ((CPSPrinterDriver*)pDriver)->Init(hDC, psLevel, bCmykOutput);
1423 SetDeviceDriver(pDriver);
1424 return;
1425 }
1426 SetDeviceDriver(CreateDriver(hDC, bCmykOutput));
1427 }
1428 1416
1429 HDC CFX_WindowsDevice::GetDC() const { 1417 HDC CFX_WindowsDevice::GetDC() const {
1430 IFX_RenderDeviceDriver* pRDD = GetDeviceDriver(); 1418 IFX_RenderDeviceDriver* pRDD = GetDeviceDriver();
1431 return pRDD ? reinterpret_cast<HDC>(pRDD->GetPlatformSurface()) : nullptr; 1419 return pRDD ? reinterpret_cast<HDC>(pRDD->GetPlatformSurface()) : nullptr;
1432 } 1420 }
1433 1421
1434 IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC, 1422 // static
1435 FX_BOOL bCmykOutput) { 1423 IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC) {
1436 int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY); 1424 int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY);
1437 int obj_type = ::GetObjectType(hDC); 1425 int obj_type = ::GetObjectType(hDC);
1438 bool use_printer = device_type == DT_RASPRINTER || 1426 bool use_printer = device_type == DT_RASPRINTER ||
1439 device_type == DT_PLOTTER || obj_type == OBJ_ENHMETADC; 1427 device_type == DT_PLOTTER || obj_type == OBJ_ENHMETADC;
1440 if (use_printer) 1428 if (use_printer)
1441 return new CGdiPrinterDriver(hDC); 1429 return new CGdiPrinterDriver(hDC);
1442 return new CGdiDisplayDriver(hDC); 1430 return new CGdiDisplayDriver(hDC);
1443 } 1431 }
1444 1432
1445 CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width, 1433 CFX_WinBitmapDevice::CFX_WinBitmapDevice(int width,
(...skipping 26 matching lines...) Expand all
1472 if (m_hDC) { 1460 if (m_hDC) {
1473 SelectObject(m_hDC, m_hOldBitmap); 1461 SelectObject(m_hDC, m_hOldBitmap);
1474 DeleteDC(m_hDC); 1462 DeleteDC(m_hDC);
1475 } 1463 }
1476 if (m_hBitmap) 1464 if (m_hBitmap)
1477 DeleteObject(m_hBitmap); 1465 DeleteObject(m_hBitmap);
1478 delete GetBitmap(); 1466 delete GetBitmap();
1479 } 1467 }
1480 1468
1481 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ 1469 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
OLDNEW
« no previous file with comments | « core/fxge/include/fx_ge_win32.h ('k') | core/fxge/win32/fx_win32_print.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698