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 "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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 SelectObject(m_hDC, hOld); | 932 SelectObject(m_hDC, hOld); |
933 DeleteObject(hPattern); | 933 DeleteObject(hPattern); |
934 | 934 |
935 return TRUE; | 935 return TRUE; |
936 } | 936 } |
937 | 937 |
938 FX_BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect) { | 938 FX_BOOL CGdiDeviceDriver::GetClipBox(FX_RECT* pRect) { |
939 return ::GetClipBox(m_hDC, (RECT*)pRect); | 939 return ::GetClipBox(m_hDC, (RECT*)pRect); |
940 } | 940 } |
941 | 941 |
| 942 void* CGdiDeviceDriver::GetPlatformSurface() const { |
| 943 return (void*)m_hDC; |
| 944 } |
| 945 |
942 void CGdiDeviceDriver::DrawLine(FX_FLOAT x1, | 946 void CGdiDeviceDriver::DrawLine(FX_FLOAT x1, |
943 FX_FLOAT y1, | 947 FX_FLOAT y1, |
944 FX_FLOAT x2, | 948 FX_FLOAT x2, |
945 FX_FLOAT y2, | 949 FX_FLOAT y2, |
946 const CFX_Matrix* pMatrix) { | 950 const CFX_Matrix* pMatrix) { |
947 bool bStartOutOfBounds = x1 < 0 || x1 > m_Width || y1 < 0 || y1 > m_Height; | 951 bool bStartOutOfBounds = x1 < 0 || x1 > m_Width || y1 < 0 || y1 > m_Height; |
948 bool bEndOutOfBounds = x2 < 0 || x2 > m_Width || y2 < 0 || y2 > m_Height; | 952 bool bEndOutOfBounds = x2 < 0 || x2 > m_Width || y2 < 0 || y2 > m_Height; |
949 if (bStartOutOfBounds & bEndOutOfBounds) | 953 if (bStartOutOfBounds & bEndOutOfBounds) |
950 return; | 954 return; |
951 | 955 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 dest_width, dest_height, pClipRect, flags); | 1360 dest_width, dest_height, pClipRect, flags); |
1357 } | 1361 } |
1358 CFX_DIBExtractor temp(pSource); | 1362 CFX_DIBExtractor temp(pSource); |
1359 CFX_DIBitmap* pBitmap = temp; | 1363 CFX_DIBitmap* pBitmap = temp; |
1360 if (!pBitmap) | 1364 if (!pBitmap) |
1361 return FALSE; | 1365 return FALSE; |
1362 return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, | 1366 return GDI_StretchDIBits(pBitmap, dest_left, dest_top, dest_width, |
1363 dest_height, flags, nullptr); | 1367 dest_height, flags, nullptr); |
1364 } | 1368 } |
1365 | 1369 |
| 1370 FX_BOOL CGdiDisplayDriver::StartDIBits(const CFX_DIBSource* pBitmap, |
| 1371 int bitmap_alpha, |
| 1372 uint32_t color, |
| 1373 const CFX_Matrix* pMatrix, |
| 1374 uint32_t render_flags, |
| 1375 void*& handle, |
| 1376 int blend_type) { |
| 1377 return FALSE; |
| 1378 } |
| 1379 |
1366 CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC) { | 1380 CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC) { |
1367 SetDeviceDriver(CreateDriver(hDC)); | 1381 SetDeviceDriver(CreateDriver(hDC)); |
1368 } | 1382 } |
1369 | 1383 |
1370 CFX_WindowsDevice::~CFX_WindowsDevice() {} | 1384 CFX_WindowsDevice::~CFX_WindowsDevice() {} |
1371 | 1385 |
1372 HDC CFX_WindowsDevice::GetDC() const { | 1386 HDC CFX_WindowsDevice::GetDC() const { |
1373 IFX_RenderDeviceDriver* pRDD = GetDeviceDriver(); | 1387 IFX_RenderDeviceDriver* pRDD = GetDeviceDriver(); |
1374 return pRDD ? reinterpret_cast<HDC>(pRDD->GetPlatformSurface()) : nullptr; | 1388 return pRDD ? reinterpret_cast<HDC>(pRDD->GetPlatformSurface()) : nullptr; |
1375 } | 1389 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 if (m_hDC) { | 1429 if (m_hDC) { |
1416 SelectObject(m_hDC, m_hOldBitmap); | 1430 SelectObject(m_hDC, m_hOldBitmap); |
1417 DeleteDC(m_hDC); | 1431 DeleteDC(m_hDC); |
1418 } | 1432 } |
1419 if (m_hBitmap) | 1433 if (m_hBitmap) |
1420 DeleteObject(m_hBitmap); | 1434 DeleteObject(m_hBitmap); |
1421 delete GetBitmap(); | 1435 delete GetBitmap(); |
1422 } | 1436 } |
1423 | 1437 |
1424 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ | 1438 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ |
OLD | NEW |