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

Side by Side Diff: core/fxge/skia/fx_skia_device.h

Issue 1812563002: Enable building pdf_use_skia in the standalone build. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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
« DEPS ('K') | « DEPS ('k') | skia/config/SkUserConfig.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ 5 #ifndef CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_
6 #define CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ 6 #define CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_
7 7
8 #if defined(_SKIA_SUPPORT_) 8 #if defined(_SKIA_SUPPORT_)
9 9
10 class SkCanvas; 10 class SkCanvas;
11 class SkPaint; 11 class SkPaint;
12 class SkPath; 12 class SkPath;
13 class SkPictureRecorder; 13 class SkPictureRecorder;
14 struct SkIRect; 14 struct SkIRect;
15 15
16 class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver { 16 class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver {
17 public: 17 public:
18 CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, 18 CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap,
19 int dither_bits, 19 int dither_bits,
20 FX_BOOL bRgbByteOrder, 20 FX_BOOL bRgbByteOrder,
21 CFX_DIBitmap* pOriDevice, 21 CFX_DIBitmap* pOriDevice,
22 FX_BOOL bGroupKnockout); 22 FX_BOOL bGroupKnockout);
23 CFX_SkiaDeviceDriver(SkPictureRecorder* recorder); 23 CFX_SkiaDeviceDriver(SkPictureRecorder* recorder);
24 CFX_SkiaDeviceDriver(int size_x, int size_y); 24 CFX_SkiaDeviceDriver(int size_x, int size_y);
25 ~CFX_SkiaDeviceDriver() override; 25 ~CFX_SkiaDeviceDriver() override;
26 26
27 /** Options */ 27 /** Options */
28 virtual int GetDeviceCaps(int caps_id); 28 int GetDeviceCaps(int caps_id) override;
29 29
30 /** Save and restore all graphic states */ 30 /** Save and restore all graphic states */
31 virtual void SaveState(); 31 void SaveState() override;
32 virtual void RestoreState(FX_BOOL bKeepSaved); 32 void RestoreState(FX_BOOL bKeepSaved) override;
33 33
34 /** Set clipping path using filled region */ 34 /** Set clipping path using filled region */
35 virtual FX_BOOL SetClip_PathFill( 35 FX_BOOL SetClip_PathFill(
36 const CFX_PathData* pPathData, // path info 36 const CFX_PathData* pPathData, // path info
37 const CFX_Matrix* pObject2Device, // optional transformation 37 const CFX_Matrix* pObject2Device, // optional transformation
38 int fill_mode); // fill mode, WINDING or ALTERNATE 38 int fill_mode) override; // fill mode, WINDING or ALTERNATE
39 39
40 /** Set clipping path using stroked region */ 40 /** Set clipping path using stroked region */
41 virtual FX_BOOL SetClip_PathStroke( 41 FX_BOOL SetClip_PathStroke(
42 const CFX_PathData* pPathData, // path info 42 const CFX_PathData* pPathData, // path info
43 const CFX_Matrix* pObject2Device, // optional transformation 43 const CFX_Matrix* pObject2Device, // optional transformation
44 const CFX_GraphStateData* 44 const CFX_GraphStateData* pGraphState)
45 pGraphState); // graphic state, for pen attributes 45 override; // graphic state, for pen attributes
caryclark 2016/03/16 17:40:18 comment sticks to parameter?
dsinclair 2016/03/16 19:35:14 Done.
46 46
47 /** Draw a path */ 47 /** Draw a path */
48 virtual FX_BOOL DrawPath(const CFX_PathData* pPathData, 48 FX_BOOL DrawPath(const CFX_PathData* pPathData,
49 const CFX_Matrix* pObject2Device, 49 const CFX_Matrix* pObject2Device,
50 const CFX_GraphStateData* pGraphState, 50 const CFX_GraphStateData* pGraphState,
51 FX_DWORD fill_color, 51 FX_DWORD fill_color,
52 FX_DWORD stroke_color, 52 FX_DWORD stroke_color,
53 int fill_mode, 53 int fill_mode,
54 int alpha_flag = 0,
55 void* pIccTransform = NULL,
56 int blend_type = FXDIB_BLEND_NORMAL) override;
57
58 FX_BOOL SetPixel(int x,
59 int y,
60 FX_DWORD color,
61 int alpha_flag = 0,
62 void* pIccTransform = NULL) override;
63
64 FX_BOOL FillRect(const FX_RECT* pRect,
65 FX_DWORD fill_color,
66 int alpha_flag = 0,
67 void* pIccTransform = NULL,
68 int blend_type = FXDIB_BLEND_NORMAL) override;
69
70 /** Draw a single pixel (device dependant) line */
71 FX_BOOL DrawCosmeticLine(FX_FLOAT x1,
72 FX_FLOAT y1,
73 FX_FLOAT x2,
74 FX_FLOAT y2,
75 FX_DWORD color,
54 int alpha_flag = 0, 76 int alpha_flag = 0,
55 void* pIccTransform = NULL, 77 void* pIccTransform = NULL,
56 int blend_type = FXDIB_BLEND_NORMAL); 78 int blend_type = FXDIB_BLEND_NORMAL) override {
57
58 virtual FX_BOOL SetPixel(int x,
59 int y,
60 FX_DWORD color,
61 int alpha_flag = 0,
62 void* pIccTransform = NULL);
63
64 virtual FX_BOOL FillRect(const FX_RECT* pRect,
65 FX_DWORD fill_color,
66 int alpha_flag = 0,
67 void* pIccTransform = NULL,
68 int blend_type = FXDIB_BLEND_NORMAL);
69
70 /** Draw a single pixel (device dependant) line */
71 virtual FX_BOOL DrawCosmeticLine(FX_FLOAT x1,
72 FX_FLOAT y1,
73 FX_FLOAT x2,
74 FX_FLOAT y2,
75 FX_DWORD color,
76 int alpha_flag = 0,
77 void* pIccTransform = NULL,
78 int blend_type = FXDIB_BLEND_NORMAL) {
79 return FALSE; 79 return FALSE;
80 } 80 }
81 81
82 virtual FX_BOOL GetClipBox(FX_RECT* pRect); 82 FX_BOOL GetClipBox(FX_RECT* pRect) override;
83 83
84 /** Load device buffer into a DIB */ 84 /** Load device buffer into a DIB */
85 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, 85 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap,
86 int left, 86 int left,
87 int top, 87 int top,
88 void* pIccTransform = NULL, 88 void* pIccTransform = NULL,
89 FX_BOOL bDEdge = FALSE); 89 FX_BOOL bDEdge = FALSE) override;
90 90
91 virtual CFX_DIBitmap* GetBackDrop() { return m_pAggDriver->GetBackDrop(); } 91 CFX_DIBitmap* GetBackDrop() override { return m_pAggDriver->GetBackDrop(); }
92 92
93 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, 93 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
94 FX_DWORD color, 94 FX_DWORD color,
95 const FX_RECT* pSrcRect, 95 const FX_RECT* pSrcRect,
96 int dest_left, 96 int dest_left,
97 int dest_top, 97 int dest_top,
98 int blend_type, 98 int blend_type,
99 int alpha_flag = 0, 99 int alpha_flag = 0,
100 void* pIccTransform = NULL); 100 void* pIccTransform = NULL) override;
101 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, 101 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
102 FX_DWORD color, 102 FX_DWORD color,
103 int dest_left, 103 int dest_left,
104 int dest_top, 104 int dest_top,
105 int dest_width, 105 int dest_width,
106 int dest_height, 106 int dest_height,
107 const FX_RECT* pClipRect, 107 const FX_RECT* pClipRect,
108 FX_DWORD flags, 108 FX_DWORD flags,
109 int alpha_flag = 0, 109 int alpha_flag = 0,
110 void* pIccTransform = NULL, 110 void* pIccTransform = NULL,
111 int blend_type = FXDIB_BLEND_NORMAL); 111 int blend_type = FXDIB_BLEND_NORMAL) override;
112 112
113 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, 113 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
114 int bitmap_alpha, 114 int bitmap_alpha,
115 FX_DWORD color, 115 FX_DWORD color,
116 const CFX_Matrix* pMatrix, 116 const CFX_Matrix* pMatrix,
117 FX_DWORD flags, 117 FX_DWORD flags,
118 void*& handle, 118 void*& handle,
119 int alpha_flag = 0, 119 int alpha_flag = 0,
120 void* pIccTransform = NULL, 120 void* pIccTransform = NULL,
121 int blend_type = FXDIB_BLEND_NORMAL); 121 int blend_type = FXDIB_BLEND_NORMAL) override;
122 virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause); 122 FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override;
123 virtual void CancelDIBits(void* handle); 123 void CancelDIBits(void* handle) override;
124 124
125 virtual FX_BOOL DrawDeviceText(int nChars, 125 FX_BOOL DrawDeviceText(int nChars,
126 const FXTEXT_CHARPOS* pCharPos, 126 const FXTEXT_CHARPOS* pCharPos,
127 CFX_Font* pFont, 127 CFX_Font* pFont,
128 CFX_FontCache* pCache, 128 CFX_FontCache* pCache,
129 const CFX_Matrix* pObject2Device, 129 const CFX_Matrix* pObject2Device,
130 FX_FLOAT font_size, 130 FX_FLOAT font_size,
131 FX_DWORD color, 131 FX_DWORD color,
132 int alpha_flag = 0, 132 int alpha_flag = 0,
133 void* pIccTransform = NULL); 133 void* pIccTransform = NULL) override;
134 134
135 virtual FX_BOOL RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, 135 FX_BOOL RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer,
136 FX_DWORD color, 136 FX_DWORD color,
137 FX_BOOL bFullCover, 137 FX_BOOL bFullCover,
138 FX_BOOL bGroupKnockout, 138 FX_BOOL bGroupKnockout,
139 int alpha_flag, 139 int alpha_flag,
140 void* pIccTransform); 140 void* pIccTransform);
141 void SetClipMask(agg::rasterizer_scanline_aa& rasterizer); 141 void SetClipMask(agg::rasterizer_scanline_aa& rasterizer);
142 void SetClipMask(SkPath& skPath, SkPaint* spaint); 142 void SetClipMask(SkPath& skPath, SkPaint* spaint);
143 virtual uint8_t* GetBuffer() const { return m_pAggDriver->GetBuffer(); } 143 virtual uint8_t* GetBuffer() const { return m_pAggDriver->GetBuffer(); }
144 void PaintStroke(SkPaint* spaint, const CFX_GraphStateData* pGraphState); 144 void PaintStroke(SkPaint* spaint, const CFX_GraphStateData* pGraphState);
145 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } 145 SkPictureRecorder* GetRecorder() const { return m_pRecorder; }
146 146
147 private: 147 private:
148 CFX_AggDeviceDriver* m_pAggDriver; 148 CFX_AggDeviceDriver* m_pAggDriver;
149 SkCanvas* m_pCanvas; 149 SkCanvas* m_pCanvas;
150 SkPictureRecorder* const m_pRecorder; 150 SkPictureRecorder* const m_pRecorder;
151 int m_ditherBits; 151 int m_ditherBits;
152 }; 152 };
153 #endif // defined(_SKIA_SUPPORT_) 153 #endif // defined(_SKIA_SUPPORT_)
154 154
155 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ 155 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_
OLDNEW
« DEPS ('K') | « DEPS ('k') | skia/config/SkUserConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698