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 "../../../include/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 8 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
9 #include <windows.h> | 9 #include <windows.h> |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 CFX_ByteTextBuf m_InterStream; | 1006 CFX_ByteTextBuf m_InterStream; |
1007 public: | 1007 public: |
1008 GpStream() | 1008 GpStream() |
1009 { | 1009 { |
1010 m_RefCount = 1; | 1010 m_RefCount = 1; |
1011 m_ReadPos = 0; | 1011 m_ReadPos = 0; |
1012 } | 1012 } |
1013 virtual HRESULT STDMETHODCALLTYPE | 1013 virtual HRESULT STDMETHODCALLTYPE |
1014 QueryInterface(REFIID iid, void ** ppvObject) | 1014 QueryInterface(REFIID iid, void ** ppvObject) |
1015 { | 1015 { |
1016 if (iid == __uuidof(IUnknown) || iid == __uuidof(IStream) || | 1016 if (iid == __uuidof(IUnknown) || |
1017 iid == __uuidof(ISequentialStream))» { | 1017 iid == __uuidof(IStream) || |
| 1018 iid == __uuidof(ISequentialStream))»{ |
1018 *ppvObject = static_cast<IStream*>(this); | 1019 *ppvObject = static_cast<IStream*>(this); |
1019 AddRef(); | 1020 AddRef(); |
1020 return S_OK; | 1021 return S_OK; |
1021 } else { | |
1022 return E_NOINTERFACE; | |
1023 } | 1022 } |
| 1023 return E_NOINTERFACE; |
1024 } | 1024 } |
1025 virtual ULONG STDMETHODCALLTYPE AddRef(void) | 1025 virtual ULONG STDMETHODCALLTYPE AddRef(void) |
1026 { | 1026 { |
1027 return (ULONG)InterlockedIncrement(&m_RefCount); | 1027 return (ULONG)InterlockedIncrement(&m_RefCount); |
1028 } | 1028 } |
1029 virtual ULONG STDMETHODCALLTYPE Release(void) | 1029 virtual ULONG STDMETHODCALLTYPE Release(void) |
1030 { | 1030 { |
1031 ULONG res = (ULONG) InterlockedDecrement(&m_RefCount); | 1031 ULONG res = (ULONG) InterlockedDecrement(&m_RefCount); |
1032 if (res == 0) { | 1032 if (res == 0) { |
1033 delete this; | 1033 delete this; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 for (int i = 0; i < height; i ++) { | 1252 for (int i = 0; i < height; i ++) { |
1253 FXSYS_memcpy(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride *
i, dest_pitch); | 1253 FXSYS_memcpy(pData + dest_pitch * i, pInfo->pScan0 + pInfo->Stride *
i, dest_pitch); |
1254 } | 1254 } |
1255 } | 1255 } |
1256 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf(pInfo->pbmi, pData, pIn
fo->pbmi->bmiHeader.biBitCount == 32); | 1256 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf(pInfo->pbmi, pData, pIn
fo->pbmi->bmiHeader.biBitCount == 32); |
1257 FX_Free(pData); | 1257 FX_Free(pData); |
1258 FreeDIBitmap(pInfo); | 1258 FreeDIBitmap(pInfo); |
1259 return pDIBitmap; | 1259 return pDIBitmap; |
1260 } | 1260 } |
1261 #endif | 1261 #endif |
OLD | NEW |