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

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

Issue 2060913003: Make code compile with clang_use_chrome_plugin (part II) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: base 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
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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 alpha_flag,
1377 void* pIccTransform,
1378 int blend_type) {
1379 return FALSE;
1380 }
1381
1366 CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC) { 1382 CFX_WindowsDevice::CFX_WindowsDevice(HDC hDC) {
1367 SetDeviceDriver(CreateDriver(hDC)); 1383 SetDeviceDriver(CreateDriver(hDC));
1368 } 1384 }
1369 1385
1370 CFX_WindowsDevice::~CFX_WindowsDevice() {} 1386 CFX_WindowsDevice::~CFX_WindowsDevice() {}
1371 1387
1372 HDC CFX_WindowsDevice::GetDC() const { 1388 HDC CFX_WindowsDevice::GetDC() const {
1373 IFX_RenderDeviceDriver* pRDD = GetDeviceDriver(); 1389 IFX_RenderDeviceDriver* pRDD = GetDeviceDriver();
1374 return pRDD ? reinterpret_cast<HDC>(pRDD->GetPlatformSurface()) : nullptr; 1390 return pRDD ? reinterpret_cast<HDC>(pRDD->GetPlatformSurface()) : nullptr;
1375 } 1391 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 if (m_hDC) { 1431 if (m_hDC) {
1416 SelectObject(m_hDC, m_hOldBitmap); 1432 SelectObject(m_hDC, m_hOldBitmap);
1417 DeleteDC(m_hDC); 1433 DeleteDC(m_hDC);
1418 } 1434 }
1419 if (m_hBitmap) 1435 if (m_hBitmap)
1420 DeleteObject(m_hBitmap); 1436 DeleteObject(m_hBitmap);
1421 delete GetBitmap(); 1437 delete GetBitmap();
1422 } 1438 }
1423 1439
1424 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ 1440 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698