| OLD | NEW |
| 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 <crtdbg.h> | 7 #include <crtdbg.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 width, height, pBitmap->GetBuffer(), (BITMAPINFO*)&bmi, | 926 width, height, pBitmap->GetBuffer(), (BITMAPINFO*)&bmi, |
| 927 DIB_RGB_COLORS, 0xB8074A); | 927 DIB_RGB_COLORS, 0xB8074A); |
| 928 | 928 |
| 929 SelectObject(m_hDC, hOld); | 929 SelectObject(m_hDC, hOld); |
| 930 DeleteObject(hPattern); | 930 DeleteObject(hPattern); |
| 931 | 931 |
| 932 return TRUE; | 932 return TRUE; |
| 933 } | 933 } |
| 934 | 934 |
| 935 FX_BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect) { | 935 FX_BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect) { |
| 936 return ::GetClipBox(m_hDC, (RECT*)pRect); | 936 return !!(::GetClipBox(m_hDC, (RECT*)pRect)); |
| 937 } | 937 } |
| 938 | 938 |
| 939 void* CGdiDeviceDriver::GetPlatformSurface() const { | 939 void* CGdiDeviceDriver::GetPlatformSurface() const { |
| 940 return (void*)m_hDC; | 940 return (void*)m_hDC; |
| 941 } | 941 } |
| 942 | 942 |
| 943 void CGdiDeviceDriver::DrawLine(FX_FLOAT x1, | 943 void CGdiDeviceDriver::DrawLine(FX_FLOAT x1, |
| 944 FX_FLOAT y1, | 944 FX_FLOAT y1, |
| 945 FX_FLOAT x2, | 945 FX_FLOAT x2, |
| 946 FX_FLOAT y2, | 946 FX_FLOAT y2, |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 | 1130 |
| 1131 FX_BOOL CGdiDeviceDriver::SetClip_PathStroke( | 1131 FX_BOOL CGdiDeviceDriver::SetClip_PathStroke( |
| 1132 const CFX_PathData* pPathData, | 1132 const CFX_PathData* pPathData, |
| 1133 const CFX_Matrix* pMatrix, | 1133 const CFX_Matrix* pMatrix, |
| 1134 const CFX_GraphStateData* pGraphState) { | 1134 const CFX_GraphStateData* pGraphState) { |
| 1135 HPEN hPen = CreatePen(pGraphState, pMatrix, 0xff000000); | 1135 HPEN hPen = CreatePen(pGraphState, pMatrix, 0xff000000); |
| 1136 hPen = (HPEN)SelectObject(m_hDC, hPen); | 1136 hPen = (HPEN)SelectObject(m_hDC, hPen); |
| 1137 SetPathToDC(m_hDC, pPathData, pMatrix); | 1137 SetPathToDC(m_hDC, pPathData, pMatrix); |
| 1138 WidenPath(m_hDC); | 1138 WidenPath(m_hDC); |
| 1139 SetPolyFillMode(m_hDC, WINDING); | 1139 SetPolyFillMode(m_hDC, WINDING); |
| 1140 FX_BOOL ret = SelectClipPath(m_hDC, RGN_AND); | 1140 FX_BOOL ret = !!SelectClipPath(m_hDC, RGN_AND); |
| 1141 hPen = (HPEN)SelectObject(m_hDC, hPen); | 1141 hPen = (HPEN)SelectObject(m_hDC, hPen); |
| 1142 DeleteObject(hPen); | 1142 DeleteObject(hPen); |
| 1143 return ret; | 1143 return ret; |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, | 1146 FX_BOOL CGdiDeviceDriver::DrawCosmeticLine(FX_FLOAT x1, |
| 1147 FX_FLOAT y1, | 1147 FX_FLOAT y1, |
| 1148 FX_FLOAT x2, | 1148 FX_FLOAT x2, |
| 1149 FX_FLOAT y2, | 1149 FX_FLOAT y2, |
| 1150 uint32_t color, | 1150 uint32_t color, |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1383 // static | 1383 // static |
| 1384 IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC) { | 1384 IFX_RenderDeviceDriver* CFX_WindowsDevice::CreateDriver(HDC hDC) { |
| 1385 int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY); | 1385 int device_type = ::GetDeviceCaps(hDC, TECHNOLOGY); |
| 1386 int obj_type = ::GetObjectType(hDC); | 1386 int obj_type = ::GetObjectType(hDC); |
| 1387 bool use_printer = device_type == DT_RASPRINTER || | 1387 bool use_printer = device_type == DT_RASPRINTER || |
| 1388 device_type == DT_PLOTTER || obj_type == OBJ_ENHMETADC; | 1388 device_type == DT_PLOTTER || obj_type == OBJ_ENHMETADC; |
| 1389 if (use_printer) | 1389 if (use_printer) |
| 1390 return new CGdiPrinterDriver(hDC); | 1390 return new CGdiPrinterDriver(hDC); |
| 1391 return new CGdiDisplayDriver(hDC); | 1391 return new CGdiDisplayDriver(hDC); |
| 1392 } | 1392 } |
| OLD | NEW |