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

Side by Side Diff: core/fxge/fx_dib.h

Issue 2572243002: Return unique_ptr from GetAlphaMask. (Closed)
Patch Set: rebase, nits, typo. 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/dib/fx_dib_transform.cpp ('k') | no next file » | 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 // 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_FXGE_FX_DIB_H_ 7 #ifndef CORE_FXGE_FX_DIB_H_
8 #define CORE_FXGE_FX_DIB_H_ 8 #define CORE_FXGE_FX_DIB_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 206 }
207 207
208 uint32_t GetPaletteEntry(int index) const; 208 uint32_t GetPaletteEntry(int index) const;
209 209
210 void SetPaletteEntry(int index, uint32_t color); 210 void SetPaletteEntry(int index, uint32_t color);
211 uint32_t GetPaletteArgb(int index) const { return GetPaletteEntry(index); } 211 uint32_t GetPaletteArgb(int index) const { return GetPaletteEntry(index); }
212 void SetPaletteArgb(int index, uint32_t color) { 212 void SetPaletteArgb(int index, uint32_t color) {
213 SetPaletteEntry(index, color); 213 SetPaletteEntry(index, color);
214 } 214 }
215 215
216 void CopyPalette(const uint32_t* pSrcPal); 216 // Copies into internally-owned palette.
217 void SetPalette(const uint32_t* pSrcPal);
217 218
218 std::unique_ptr<CFX_DIBitmap> Clone(const FX_RECT* pClip = nullptr) const; 219 std::unique_ptr<CFX_DIBitmap> Clone(const FX_RECT* pClip = nullptr) const;
219 std::unique_ptr<CFX_DIBitmap> CloneConvert(FXDIB_Format format) const; 220 std::unique_ptr<CFX_DIBitmap> CloneConvert(FXDIB_Format format) const;
220 221
221 std::unique_ptr<CFX_DIBitmap> StretchTo(int dest_width, 222 std::unique_ptr<CFX_DIBitmap> StretchTo(int dest_width,
222 int dest_height, 223 int dest_height,
223 uint32_t flags = 0, 224 uint32_t flags = 0,
224 const FX_RECT* pClip = nullptr) const; 225 const FX_RECT* pClip = nullptr) const;
225 std::unique_ptr<CFX_DIBitmap> TransformTo( 226 std::unique_ptr<CFX_DIBitmap> TransformTo(
226 const CFX_Matrix* pMatrix, 227 const CFX_Matrix* pMatrix,
227 int& left, 228 int& left,
228 int& top, 229 int& top,
229 uint32_t flags = 0, 230 uint32_t flags = 0,
230 const FX_RECT* pClip = nullptr) const; 231 const FX_RECT* pClip = nullptr) const;
231 232
232 CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = nullptr) const; 233 std::unique_ptr<CFX_DIBitmap> CloneAlphaMask(
233 bool CopyAlphaMask(const CFX_DIBSource* pAlphaMask, 234 const FX_RECT* pClip = nullptr) const;
234 const FX_RECT* pClip = nullptr); 235
236 // Copies into internally-owned mask.
237 bool SetAlphaMask(const CFX_DIBSource* pAlphaMask,
238 const FX_RECT* pClip = nullptr);
235 239
236 CFX_DIBitmap* SwapXY(bool bXFlip, 240 CFX_DIBitmap* SwapXY(bool bXFlip,
237 bool bYFlip, 241 bool bYFlip,
238 const FX_RECT* pClip = nullptr) const; 242 const FX_RECT* pClip = nullptr) const;
239 243
240 CFX_DIBitmap* FlipImage(bool bXFlip, bool bYFlip) const; 244 CFX_DIBitmap* FlipImage(bool bXFlip, bool bYFlip) const;
241 245
242 void GetOverlapRect(int& dest_left, 246 void GetOverlapRect(int& dest_left,
243 int& dest_top, 247 int& dest_top,
244 int& width, 248 int& width,
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 int m_Status; 690 int m_Status;
687 FX_RECT m_ClipBox; 691 FX_RECT m_ClipBox;
688 uint32_t m_Flags; 692 uint32_t m_Flags;
689 int m_AlphaFlag; 693 int m_AlphaFlag;
690 void* m_pIccTransform; 694 void* m_pIccTransform;
691 bool m_bRgbByteOrder; 695 bool m_bRgbByteOrder;
692 int m_BlendType; 696 int m_BlendType;
693 }; 697 };
694 698
695 #endif // CORE_FXGE_FX_DIB_H_ 699 #endif // CORE_FXGE_FX_DIB_H_
OLDNEW
« no previous file with comments | « core/fxge/dib/fx_dib_transform.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698