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 #ifndef CORE_INCLUDE_FXGE_FX_GE_H_ | 7 #ifndef CORE_INCLUDE_FXGE_FX_GE_H_ |
8 #define CORE_INCLUDE_FXGE_FX_GE_H_ | 8 #define CORE_INCLUDE_FXGE_FX_GE_H_ |
9 | 9 |
10 #include "core/include/fxge/fx_dib.h" | 10 #include "core/include/fxge/fx_dib.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 #define FXTEXT_NOSMOOTH 0x20 | 232 #define FXTEXT_NOSMOOTH 0x20 |
233 typedef struct { | 233 typedef struct { |
234 FX_DWORD m_GlyphIndex; | 234 FX_DWORD m_GlyphIndex; |
235 FX_FLOAT m_OriginX, m_OriginY; | 235 FX_FLOAT m_OriginX, m_OriginY; |
236 int m_FontCharWidth; | 236 int m_FontCharWidth; |
237 FX_BOOL m_bGlyphAdjust; | 237 FX_BOOL m_bGlyphAdjust; |
238 FX_FLOAT m_AdjustMatrix[4]; | 238 FX_FLOAT m_AdjustMatrix[4]; |
239 FX_DWORD m_ExtGID; | 239 FX_DWORD m_ExtGID; |
240 FX_BOOL m_bFontStyle; | 240 FX_BOOL m_bFontStyle; |
241 } FXTEXT_CHARPOS; | 241 } FXTEXT_CHARPOS; |
| 242 |
242 class CFX_RenderDevice { | 243 class CFX_RenderDevice { |
243 public: | 244 public: |
244 CFX_RenderDevice(); | 245 CFX_RenderDevice(); |
245 | |
246 virtual ~CFX_RenderDevice(); | 246 virtual ~CFX_RenderDevice(); |
247 | 247 |
248 void SetDeviceDriver(IFX_RenderDeviceDriver* pDriver); | 248 void SetDeviceDriver(IFX_RenderDeviceDriver* pDriver); |
249 | |
250 IFX_RenderDeviceDriver* GetDeviceDriver() const { return m_pDeviceDriver; } | 249 IFX_RenderDeviceDriver* GetDeviceDriver() const { return m_pDeviceDriver; } |
251 | 250 |
252 FX_BOOL StartRendering(); | 251 FX_BOOL StartRendering(); |
253 | |
254 void EndRendering(); | 252 void EndRendering(); |
255 | |
256 void SaveState(); | 253 void SaveState(); |
257 | |
258 void RestoreState(FX_BOOL bKeepSaved = FALSE); | 254 void RestoreState(FX_BOOL bKeepSaved = FALSE); |
259 | 255 |
260 int GetWidth() const { return m_Width; } | 256 int GetWidth() const { return m_Width; } |
261 | |
262 int GetHeight() const { return m_Height; } | 257 int GetHeight() const { return m_Height; } |
263 | |
264 int GetDeviceClass() const { return m_DeviceClass; } | 258 int GetDeviceClass() const { return m_DeviceClass; } |
265 | |
266 int GetBPP() const { return m_bpp; } | 259 int GetBPP() const { return m_bpp; } |
267 | |
268 int GetRenderCaps() const { return m_RenderCaps; } | 260 int GetRenderCaps() const { return m_RenderCaps; } |
269 | |
270 int GetDeviceCaps(int id) const; | 261 int GetDeviceCaps(int id) const; |
271 | |
272 CFX_Matrix GetCTM() const; | 262 CFX_Matrix GetCTM() const; |
273 | 263 |
274 CFX_DIBitmap* GetBitmap() const { return m_pBitmap; } | 264 CFX_DIBitmap* GetBitmap() const { return m_pBitmap; } |
275 void SetBitmap(CFX_DIBitmap* pBitmap) { m_pBitmap = pBitmap; } | 265 void SetBitmap(CFX_DIBitmap* pBitmap) { m_pBitmap = pBitmap; } |
276 | 266 |
277 FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, | 267 FX_BOOL CreateCompatibleBitmap(CFX_DIBitmap* pDIB, |
278 int width, | 268 int width, |
279 int height) const; | 269 int height) const; |
280 | 270 |
281 const FX_RECT& GetClipBox() const { return m_ClipBox; } | 271 const FX_RECT& GetClipBox() const { return m_ClipBox; } |
282 | 272 |
283 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 273 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
284 const CFX_Matrix* pObject2Device, | 274 const CFX_Matrix* pObject2Device, |
285 int fill_mode); | 275 int fill_mode); |
286 | 276 |
287 FX_BOOL SetClip_Rect(const FX_RECT* pRect); | 277 FX_BOOL SetClip_Rect(const FX_RECT& pRect); |
288 | |
289 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 278 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
290 const CFX_Matrix* pObject2Device, | 279 const CFX_Matrix* pObject2Device, |
291 const CFX_GraphStateData* pGraphState); | 280 const CFX_GraphStateData* pGraphState); |
292 | 281 |
293 FX_BOOL DrawPath(const CFX_PathData* pPathData, | 282 FX_BOOL DrawPath(const CFX_PathData* pPathData, |
294 const CFX_Matrix* pObject2Device, | 283 const CFX_Matrix* pObject2Device, |
295 const CFX_GraphStateData* pGraphState, | 284 const CFX_GraphStateData* pGraphState, |
296 FX_DWORD fill_color, | 285 FX_DWORD fill_color, |
297 FX_DWORD stroke_color, | 286 FX_DWORD stroke_color, |
298 int fill_mode, | 287 int fill_mode, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 FX_DWORD stroke_color, | 387 FX_DWORD stroke_color, |
399 CFX_PathData* pClippingPath, | 388 CFX_PathData* pClippingPath, |
400 int nFlag = 0, | 389 int nFlag = 0, |
401 int alpha_flag = 0, | 390 int alpha_flag = 0, |
402 void* pIccTransform = NULL, | 391 void* pIccTransform = NULL, |
403 int blend_type = FXDIB_BLEND_NORMAL); | 392 int blend_type = FXDIB_BLEND_NORMAL); |
404 virtual void Begin() {} | 393 virtual void Begin() {} |
405 virtual void End() {} | 394 virtual void End() {} |
406 | 395 |
407 private: | 396 private: |
| 397 void InitDeviceInfo(); |
| 398 void UpdateClipBox(); |
| 399 |
408 CFX_DIBitmap* m_pBitmap; | 400 CFX_DIBitmap* m_pBitmap; |
| 401 int m_Width; |
| 402 int m_Height; |
| 403 int m_bpp; |
| 404 int m_RenderCaps; |
| 405 int m_DeviceClass; |
| 406 FX_RECT m_ClipBox; |
| 407 IFX_RenderDeviceDriver* m_pDeviceDriver; |
| 408 }; |
409 | 409 |
410 int m_Width; | |
411 | |
412 int m_Height; | |
413 | |
414 int m_bpp; | |
415 | |
416 int m_RenderCaps; | |
417 | |
418 int m_DeviceClass; | |
419 | |
420 FX_RECT m_ClipBox; | |
421 | |
422 protected: | |
423 IFX_RenderDeviceDriver* m_pDeviceDriver; | |
424 | |
425 private: | |
426 void InitDeviceInfo(); | |
427 | |
428 void UpdateClipBox(); | |
429 }; | |
430 class CFX_FxgeDevice : public CFX_RenderDevice { | 410 class CFX_FxgeDevice : public CFX_RenderDevice { |
431 public: | 411 public: |
432 CFX_FxgeDevice(); | 412 CFX_FxgeDevice(); |
433 ~CFX_FxgeDevice() override; | 413 ~CFX_FxgeDevice() override; |
434 | 414 |
435 FX_BOOL Attach(CFX_DIBitmap* pBitmap, | 415 FX_BOOL Attach(CFX_DIBitmap* pBitmap, |
436 int dither_bits = 0, | 416 int dither_bits = 0, |
437 FX_BOOL bRgbByteOrder = FALSE, | 417 FX_BOOL bRgbByteOrder = FALSE, |
438 CFX_DIBitmap* pOriDevice = NULL, | 418 CFX_DIBitmap* pOriDevice = NULL, |
439 FX_BOOL bGroupKnockout = FALSE); | 419 FX_BOOL bGroupKnockout = FALSE); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, | 701 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, |
722 CFX_Font* pFont, | 702 CFX_Font* pFont, |
723 const FXTEXT_CHARPOS& charpos, | 703 const FXTEXT_CHARPOS& charpos, |
724 int& ps_fontnum, | 704 int& ps_fontnum, |
725 int& ps_glyphindex); | 705 int& ps_glyphindex); |
726 | 706 |
727 void WritePSBinary(const uint8_t* data, int len); | 707 void WritePSBinary(const uint8_t* data, int len); |
728 }; | 708 }; |
729 | 709 |
730 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ | 710 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ |
OLD | NEW |