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

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

Issue 2520073003: handle antialiased rendering as premultiplied (Closed)
Patch Set: more work on premultiplied mismatch Created 4 years 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
« no previous file with comments | « core/fxge/ge/cfx_renderdevice.cpp ('k') | core/fxge/skia/fx_skia_device.cpp » ('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_ || defined _SKIA_SUPPORT_PATHS_ 8 #if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 const CFX_Matrix* pMatrix, 133 const CFX_Matrix* pMatrix,
134 int blend_type); 134 int blend_type);
135 135
136 bool DrawDeviceText(int nChars, 136 bool DrawDeviceText(int nChars,
137 const FXTEXT_CHARPOS* pCharPos, 137 const FXTEXT_CHARPOS* pCharPos,
138 CFX_Font* pFont, 138 CFX_Font* pFont,
139 const CFX_Matrix* pObject2Device, 139 const CFX_Matrix* pObject2Device,
140 FX_FLOAT font_size, 140 FX_FLOAT font_size,
141 uint32_t color) override; 141 uint32_t color) override;
142 142
143 #ifdef _SKIA_SUPPORT_
144 bool DrawShading(const CPDF_ShadingPattern* pPattern, 143 bool DrawShading(const CPDF_ShadingPattern* pPattern,
145 const CFX_Matrix* pMatrix, 144 const CFX_Matrix* pMatrix,
146 const FX_RECT& clip_rect, 145 const FX_RECT& clip_rect,
147 int alpha, 146 int alpha,
148 bool bAlphaMode) override; 147 bool bAlphaMode) override;
149 #endif
150 148
151 virtual uint8_t* GetBuffer() const; 149 virtual uint8_t* GetBuffer() const;
152 150
153 void PaintStroke(SkPaint* spaint, 151 void PaintStroke(SkPaint* spaint,
154 const CFX_GraphStateData* pGraphState, 152 const CFX_GraphStateData* pGraphState,
155 const SkMatrix& matrix); 153 const SkMatrix& matrix);
156 void Clear(uint32_t color); 154 void Clear(uint32_t color);
157 void Flush(); 155 void Flush();
158 SkPictureRecorder* GetRecorder() const { return m_pRecorder; } 156 SkPictureRecorder* GetRecorder() const { return m_pRecorder; }
159 static void PreMultiply(CFX_DIBitmap* pDIBitmap); 157 static void PreMultiply(CFX_DIBitmap* pDIBitmap);
160 #ifdef _SKIA_SUPPORT_PATHS_
161 void UnPreMultiplyDevice();
162 void UnPreMultiply(CFX_DIBitmap* pDIBitmap);
163 #endif
164 SkCanvas* SkiaCanvas() { return m_pCanvas; } 158 SkCanvas* SkiaCanvas() { return m_pCanvas; }
165 void DebugVerifyBitmapIsPreMultiplied() const; 159 void DebugVerifyBitmapIsPreMultiplied() const;
166 void Dump() const; 160 void Dump() const;
167 161
168 private: 162 private:
169 friend class SkiaState; 163 friend class SkiaState;
170 164
171 CFX_DIBitmap* m_pBitmap; 165 CFX_DIBitmap* m_pBitmap;
172 CFX_DIBitmap* m_pOriDevice; 166 CFX_DIBitmap* m_pOriDevice;
173 SkCanvas* m_pCanvas; 167 SkCanvas* m_pCanvas;
174 SkPictureRecorder* const m_pRecorder; 168 SkPictureRecorder* const m_pRecorder;
175 #ifdef _SKIA_SUPPORT_ 169 #ifdef _SKIA_SUPPORT_
176 std::unique_ptr<SkiaState> m_pCache; 170 std::unique_ptr<SkiaState> m_pCache;
177 #endif 171 #endif
178 #ifdef _SKIA_SUPPORT_PATHS_ 172 #ifdef _SKIA_SUPPORT_PATHS_
179 std::unique_ptr<CFX_ClipRgn> m_pClipRgn; 173 std::unique_ptr<CFX_ClipRgn> m_pClipRgn;
180 std::vector<std::unique_ptr<CFX_ClipRgn>> m_StateStack; 174 std::vector<std::unique_ptr<CFX_ClipRgn>> m_StateStack;
181 int m_FillFlags; 175 int m_FillFlags;
182 bool m_bRgbByteOrder; 176 bool m_bRgbByteOrder;
183 #endif 177 #endif
184 bool m_bGroupKnockout; 178 bool m_bGroupKnockout;
185 }; 179 };
186 #endif // defined(_SKIA_SUPPORT_) 180 #endif // defined(_SKIA_SUPPORT_)
187 181
188 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_ 182 #endif // CORE_FXGE_SKIA_FX_SKIA_DEVICE_H_
OLDNEW
« no previous file with comments | « core/fxge/ge/cfx_renderdevice.cpp ('k') | core/fxge/skia/fx_skia_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698