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

Side by Side Diff: core/fxge/dib/fx_dib_composite.cpp

Issue 2045083003: Remove implicit CFX_CountedRef::operator T*() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix mac build. Created 4 years, 6 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
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 #include "core/fxcodec/include/fx_codec.h" 7 #include "core/fxcodec/include/fx_codec.h"
8 #include "core/fxge/dib/dib_int.h" 8 #include "core/fxge/dib/dib_int.h"
9 #include "core/fxge/include/fx_ge.h" 9 #include "core/fxge/include/fx_ge.h"
10 10
(...skipping 4490 matching lines...) Expand 10 before | Expand all | Expand 10 after
4501 } 4501 }
4502 GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(), 4502 GetOverlapRect(dest_left, dest_top, width, height, pSrcBitmap->GetWidth(),
4503 pSrcBitmap->GetHeight(), src_left, src_top, pClipRgn); 4503 pSrcBitmap->GetHeight(), src_left, src_top, pClipRgn);
4504 if (width == 0 || height == 0) { 4504 if (width == 0 || height == 0) {
4505 return TRUE; 4505 return TRUE;
4506 } 4506 }
4507 const CFX_DIBitmap* pClipMask = nullptr; 4507 const CFX_DIBitmap* pClipMask = nullptr;
4508 FX_RECT clip_box; 4508 FX_RECT clip_box;
4509 if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) { 4509 if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
4510 ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF); 4510 ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF);
4511 pClipMask = pClipRgn->GetMask(); 4511 pClipMask = pClipRgn->GetMask().GetObject();
4512 clip_box = pClipRgn->GetBox(); 4512 clip_box = pClipRgn->GetBox();
4513 } 4513 }
4514 CFX_ScanlineCompositor compositor; 4514 CFX_ScanlineCompositor compositor;
4515 if (!compositor.Init(GetFormat(), pSrcBitmap->GetFormat(), width, 4515 if (!compositor.Init(GetFormat(), pSrcBitmap->GetFormat(), width,
4516 pSrcBitmap->GetPalette(), 0, blend_type, 4516 pSrcBitmap->GetPalette(), 0, blend_type,
4517 pClipMask != nullptr, bRgbByteOrder, 0, pIccTransform)) { 4517 pClipMask != nullptr, bRgbByteOrder, 0, pIccTransform)) {
4518 return FALSE; 4518 return FALSE;
4519 } 4519 }
4520 int dest_Bpp = m_bpp / 8; 4520 int dest_Bpp = m_bpp / 8;
4521 int src_Bpp = pSrcBitmap->GetBPP() / 8; 4521 int src_Bpp = pSrcBitmap->GetBPP() / 8;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
4580 } 4580 }
4581 int src_alpha = 4581 int src_alpha =
4582 (uint8_t)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color); 4582 (uint8_t)(alpha_flag >> 8) ? (alpha_flag & 0xff) : FXARGB_A(color);
4583 if (src_alpha == 0) { 4583 if (src_alpha == 0) {
4584 return TRUE; 4584 return TRUE;
4585 } 4585 }
4586 const CFX_DIBitmap* pClipMask = nullptr; 4586 const CFX_DIBitmap* pClipMask = nullptr;
4587 FX_RECT clip_box; 4587 FX_RECT clip_box;
4588 if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) { 4588 if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
4589 ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF); 4589 ASSERT(pClipRgn->GetType() == CFX_ClipRgn::MaskF);
4590 pClipMask = pClipRgn->GetMask(); 4590 pClipMask = pClipRgn->GetMask().GetObject();
4591 clip_box = pClipRgn->GetBox(); 4591 clip_box = pClipRgn->GetBox();
4592 } 4592 }
4593 int src_bpp = pMask->GetBPP(); 4593 int src_bpp = pMask->GetBPP();
4594 int Bpp = GetBPP() / 8; 4594 int Bpp = GetBPP() / 8;
4595 CFX_ScanlineCompositor compositor; 4595 CFX_ScanlineCompositor compositor;
4596 if (!compositor.Init(GetFormat(), pMask->GetFormat(), width, nullptr, color, 4596 if (!compositor.Init(GetFormat(), pMask->GetFormat(), width, nullptr, color,
4597 blend_type, pClipMask != nullptr, bRgbByteOrder, 4597 blend_type, pClipMask != nullptr, bRgbByteOrder,
4598 alpha_flag, pIccTransform)) { 4598 alpha_flag, pIccTransform)) {
4599 return FALSE; 4599 return FALSE;
4600 } 4600 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
4863 m_pBitmap = pDest; 4863 m_pBitmap = pDest;
4864 m_pClipRgn = pClipRgn; 4864 m_pClipRgn = pClipRgn;
4865 m_DestLeft = dest_rect.left; 4865 m_DestLeft = dest_rect.left;
4866 m_DestTop = dest_rect.top; 4866 m_DestTop = dest_rect.top;
4867 m_DestWidth = dest_rect.Width(); 4867 m_DestWidth = dest_rect.Width();
4868 m_DestHeight = dest_rect.Height(); 4868 m_DestHeight = dest_rect.Height();
4869 m_BitmapAlpha = bitmap_alpha; 4869 m_BitmapAlpha = bitmap_alpha;
4870 m_MaskColor = mask_color; 4870 m_MaskColor = mask_color;
4871 m_pClipMask = nullptr; 4871 m_pClipMask = nullptr;
4872 if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) { 4872 if (pClipRgn && pClipRgn->GetType() != CFX_ClipRgn::RectI) {
4873 m_pClipMask = pClipRgn->GetMask(); 4873 m_pClipMask = pClipRgn->GetMask().GetObject();
4874 } 4874 }
4875 m_bVertical = bVertical; 4875 m_bVertical = bVertical;
4876 m_bFlipX = bFlipX; 4876 m_bFlipX = bFlipX;
4877 m_bFlipY = bFlipY; 4877 m_bFlipY = bFlipY;
4878 m_AlphaFlag = alpha_flag; 4878 m_AlphaFlag = alpha_flag;
4879 m_pIccTransform = pIccTransform; 4879 m_pIccTransform = pIccTransform;
4880 m_bRgbByteOrder = bRgbByteOrder; 4880 m_bRgbByteOrder = bRgbByteOrder;
4881 m_BlendType = blend_type; 4881 m_BlendType = blend_type;
4882 } 4882 }
4883 FX_BOOL CFX_BitmapComposer::SetInfo(int width, 4883 FX_BOOL CFX_BitmapComposer::SetInfo(int width,
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
5029 } 5029 }
5030 src_alpha_scan = m_pScanlineAlphaV; 5030 src_alpha_scan = m_pScanlineAlphaV;
5031 dest_alpha_scan = dest_alpha_buf; 5031 dest_alpha_scan = dest_alpha_buf;
5032 if (dest_alpha_scan) { 5032 if (dest_alpha_scan) {
5033 for (i = 0; i < m_DestHeight; i++) { 5033 for (i = 0; i < m_DestHeight; i++) {
5034 *dest_alpha_scan = *src_alpha_scan++; 5034 *dest_alpha_scan = *src_alpha_scan++;
5035 dest_alpha_scan += y_alpha_step; 5035 dest_alpha_scan += y_alpha_step;
5036 } 5036 }
5037 } 5037 }
5038 } 5038 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698