| Index: core/src/fxge/agg/src/fx_agg_driver.cpp
|
| diff --git a/core/src/fxge/agg/src/fx_agg_driver.cpp b/core/src/fxge/agg/src/fx_agg_driver.cpp
|
| index 475e5f6442412c22fc27dda8b43b9ecb34e62ad7..583eb1a9afc99ef45bb02231d5bd4712d165a6f3 100644
|
| --- a/core/src/fxge/agg/src/fx_agg_driver.cpp
|
| +++ b/core/src/fxge/agg/src/fx_agg_driver.cpp
|
| @@ -119,7 +119,7 @@ private:
|
| static void RasterizeStroke(agg::rasterizer_scanline_aa& rasterizer, agg::path_storage& path_data,
|
| const CFX_AffineMatrix* pObject2Device,
|
| const CFX_GraphStateData* pGraphState, FX_FLOAT scale = 1.0f,
|
| - FX_BOOL bStrokeAdjust = FALSE, FX_BOOL bTextMode = FALSE)
|
| + bool bStrokeAdjust = false, bool bTextMode = false)
|
| {
|
| agg::line_cap_e cap;
|
| switch (pGraphState->m_LineCap) {
|
| @@ -185,11 +185,11 @@ static void RasterizeStroke(agg::rasterizer_scanline_aa& rasterizer, agg::path_s
|
| rasterizer.add_path_transformed(stroke, pObject2Device);
|
| }
|
| }
|
| -IFX_RenderDeviceDriver* IFX_RenderDeviceDriver::CreateFxgeDriver(CFX_DIBitmap* pBitmap, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
|
| +IFX_RenderDeviceDriver* IFX_RenderDeviceDriver::CreateFxgeDriver(CFX_DIBitmap* pBitmap, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
|
| {
|
| return new CFX_AggDeviceDriver(pBitmap, 0, bRgbByteOrder, pOriDevice, bGroupKnockout);
|
| }
|
| -CFX_AggDeviceDriver::CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
|
| +CFX_AggDeviceDriver::CFX_AggDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
|
| {
|
| m_pBitmap = pBitmap;
|
| m_DitherBits = dither_bits;
|
| @@ -217,11 +217,11 @@ void CFX_AggDeviceDriver::InitPlatform()
|
| void CFX_AggDeviceDriver::DestroyPlatform()
|
| {
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
|
| +bool CFX_AggDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
|
| CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FLOAT font_size, FX_DWORD color,
|
| int alpha_flag, void* pIccTransform)
|
| {
|
| - return FALSE;
|
| + return false;
|
| }
|
| #endif
|
| int CFX_AggDeviceDriver::GetDeviceCaps(int caps_id)
|
| @@ -267,7 +267,7 @@ void CFX_AggDeviceDriver::SaveState()
|
| }
|
| m_StateStack.Add(pClip);
|
| }
|
| -void CFX_AggDeviceDriver::RestoreState(FX_BOOL bKeepSaved)
|
| +void CFX_AggDeviceDriver::RestoreState(bool bKeepSaved)
|
| {
|
| if (m_StateStack.GetSize() == 0) {
|
| delete m_pClipRgn;
|
| @@ -307,7 +307,7 @@ void CFX_AggDeviceDriver::SetClipMask(agg::rasterizer_scanline_aa& rasterizer)
|
| agg::render_scanlines(rasterizer, scanline, final_render, (m_FillFlags & FXFILL_NOPATHSMOOTH) != 0);
|
| m_pClipRgn->IntersectMaskF(path_rect.left, path_rect.top, mask);
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
|
| +bool CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
|
| const CFX_AffineMatrix* pObject2Device,
|
| int fill_mode
|
| )
|
| @@ -322,7 +322,7 @@ FX_BOOL CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
|
| rectf.Intersect(CFX_FloatRect(0, 0, (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_WIDTH), (FX_FLOAT)GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
|
| FX_RECT rect = rectf.GetOutterRect();
|
| m_pClipRgn->IntersectRect(rect);
|
| - return TRUE;
|
| + return true;
|
| }
|
| }
|
| CAgg_PathData path_data;
|
| @@ -333,9 +333,9 @@ FX_BOOL CFX_AggDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData,
|
| rasterizer.add_path(path_data.m_PathData);
|
| rasterizer.filling_rule((fill_mode & 3) == FXFILL_WINDING ? agg::fill_non_zero : agg::fill_even_odd);
|
| SetClipMask(rasterizer);
|
| - return TRUE;
|
| + return true;
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
|
| +bool CFX_AggDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
|
| const CFX_AffineMatrix* pObject2Device,
|
| const CFX_GraphStateData* pGraphState
|
| )
|
| @@ -350,7 +350,7 @@ FX_BOOL CFX_AggDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
|
| RasterizeStroke(rasterizer, path_data.m_PathData, pObject2Device, pGraphState);
|
| rasterizer.filling_rule(agg::fill_non_zero);
|
| SetClipMask(rasterizer);
|
| - return TRUE;
|
| + return true;
|
| }
|
| class CFX_Renderer
|
| {
|
| @@ -361,8 +361,8 @@ private:
|
| m_Blue,
|
| m_Gray;
|
| FX_DWORD m_Color;
|
| - FX_BOOL m_bFullCover;
|
| - FX_BOOL m_bRgbByteOrder;
|
| + bool m_bFullCover;
|
| + bool m_bRgbByteOrder;
|
| CFX_DIBitmap* m_pOriDevice;
|
| FX_RECT m_ClipBox;
|
| const CFX_DIBitmap* m_pClipMask;
|
| @@ -371,7 +371,7 @@ private:
|
| void (CFX_Renderer::*composite_span)(uint8_t*, int, int, int, uint8_t*, int, int, uint8_t*, uint8_t*);
|
| public:
|
| void prepare(unsigned) {}
|
| - void CompositeSpan(uint8_t* dest_scan, uint8_t* ori_scan, int Bpp, FX_BOOL bDestAlpha,
|
| + void CompositeSpan(uint8_t* dest_scan, uint8_t* ori_scan, int Bpp, bool bDestAlpha,
|
| int span_left, int span_len, uint8_t* cover_scan,
|
| int clip_left, int clip_right, uint8_t* clip_scan)
|
| {
|
| @@ -952,7 +952,7 @@ public:
|
| ori_scan = m_pOriDevice->GetBuffer() + m_pOriDevice->GetPitch() * y;
|
| }
|
| int Bpp = m_pDevice->GetBPP() / 8;
|
| - FX_BOOL bDestAlpha = m_pDevice->HasAlpha() || m_pDevice->IsAlphaMask();
|
| + bool bDestAlpha = m_pDevice->HasAlpha() || m_pDevice->IsAlphaMask();
|
| unsigned num_spans = sl.num_spans();
|
| typename Scanline::const_iterator span = sl.begin();
|
| while (1) {
|
| @@ -985,7 +985,7 @@ public:
|
| }
|
| }
|
|
|
| - FX_BOOL Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder,
|
| + bool Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, bool bFullCover, bool bRgbByteOrder,
|
| int alpha_flag = 0, void* pIccTransform = NULL)
|
| {
|
| m_pDevice = pDevice;
|
| @@ -1005,8 +1005,8 @@ public:
|
| m_pClipMask = m_pClipRgn->GetMask();
|
| }
|
| m_bFullCover = bFullCover;
|
| - FX_BOOL bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
|
| - FX_BOOL bDeviceCMYK = pDevice->IsCmykImage();
|
| + bool bObjectCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
|
| + bool bDeviceCMYK = pDevice->IsCmykImage();
|
| m_Alpha = bObjectCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
|
| ICodec_IccModule* pIccModule = NULL;
|
| if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
|
| @@ -1036,7 +1036,7 @@ public:
|
| }
|
| }
|
| }
|
| - return TRUE;
|
| + return true;
|
| }
|
| if (bDeviceCMYK) {
|
| ASSERT(!m_bRgbByteOrder);
|
| @@ -1048,7 +1048,7 @@ public:
|
| }
|
| } else {
|
| if (!pIccTransform) {
|
| - return FALSE;
|
| + return false;
|
| }
|
| color = FXARGB_TODIB(color);
|
| pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&m_Color, (const uint8_t*)&color, 1);
|
| @@ -1097,22 +1097,22 @@ public:
|
| if (m_pDevice->GetBPP() == 1) {
|
| composite_span = &CFX_Renderer::CompositeSpan1bpp;
|
| }
|
| - return TRUE;
|
| + return true;
|
| }
|
| };
|
| -FX_BOOL CFX_AggDeviceDriver::RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
|
| +bool CFX_AggDeviceDriver::RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
|
| int alpha_flag, void* pIccTransform)
|
| {
|
| CFX_DIBitmap* pt = bGroupKnockout ? m_pOriDevice : NULL;
|
| CFX_Renderer render;
|
| if (!render.Init(m_pBitmap, pt, m_pClipRgn, color, bFullCover, m_bRgbByteOrder, alpha_flag, pIccTransform)) {
|
| - return FALSE;
|
| + return false;
|
| }
|
| agg::scanline_u8 scanline;
|
| agg::render_scanlines(rasterizer, scanline, render, (m_FillFlags & FXFILL_NOPATHSMOOTH) != 0);
|
| - return TRUE;
|
| + return true;
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
|
| +bool CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
|
| const CFX_AffineMatrix* pObject2Device,
|
| const CFX_GraphStateData* pGraphState,
|
| FX_DWORD fill_color,
|
| @@ -1124,10 +1124,10 @@ FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
|
| )
|
| {
|
| if (blend_type != FXDIB_BLEND_NORMAL) {
|
| - return FALSE;
|
| + return false;
|
| }
|
| if (GetBuffer() == NULL) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| m_FillFlags = fill_mode;
|
| if ((fill_mode & 3) && fill_color) {
|
| @@ -1137,8 +1137,8 @@ FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
|
| rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
|
| rasterizer.add_path(path_data.m_PathData);
|
| rasterizer.filling_rule((fill_mode & 3) == FXFILL_WINDING ? agg::fill_non_zero : agg::fill_even_odd);
|
| - if (!RenderRasterizer(rasterizer, fill_color, fill_mode & FXFILL_FULLCOVER, FALSE, alpha_flag, pIccTransform)) {
|
| - return FALSE;
|
| + if (!RenderRasterizer(rasterizer, fill_color, fill_mode & FXFILL_FULLCOVER, false, alpha_flag, pIccTransform)) {
|
| + return false;
|
| }
|
| }
|
| int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag) ? FXGETFLAG_ALPHA_STROKE(alpha_flag) : FXARGB_A(stroke_color);
|
| @@ -1148,12 +1148,12 @@ FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
|
| path_data.BuildPath(pPathData, pObject2Device);
|
| agg::rasterizer_scanline_aa rasterizer;
|
| rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
|
| - RasterizeStroke(rasterizer, path_data.m_PathData, NULL, pGraphState, 1, FALSE, fill_mode & FX_STROKE_TEXT_MODE);
|
| + RasterizeStroke(rasterizer, path_data.m_PathData, NULL, pGraphState, 1, false, fill_mode & FX_STROKE_TEXT_MODE);
|
| int fill_flag = FXGETFLAG_COLORTYPE(alpha_flag) << 8 | FXGETFLAG_ALPHA_STROKE(alpha_flag);
|
| if (!RenderRasterizer(rasterizer, stroke_color, fill_mode & FXFILL_FULLCOVER, m_bGroupKnockout, fill_flag, pIccTransform)) {
|
| - return FALSE;
|
| + return false;
|
| }
|
| - return TRUE;
|
| + return true;
|
| }
|
| CFX_AffineMatrix matrix1, matrix2;
|
| if (pObject2Device) {
|
| @@ -1171,13 +1171,13 @@ FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
|
| path_data.BuildPath(pPathData, &matrix1);
|
| agg::rasterizer_scanline_aa rasterizer;
|
| rasterizer.clip_box(0.0f, 0.0f, (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_WIDTH)), (FX_FLOAT)(GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
|
| - RasterizeStroke(rasterizer, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, FALSE, fill_mode & FX_STROKE_TEXT_MODE);
|
| + RasterizeStroke(rasterizer, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, false, fill_mode & FX_STROKE_TEXT_MODE);
|
| int fill_flag = FXGETFLAG_COLORTYPE(alpha_flag) << 8 | FXGETFLAG_ALPHA_STROKE(alpha_flag);
|
| if (!RenderRasterizer(rasterizer, stroke_color, fill_mode & FXFILL_FULLCOVER, m_bGroupKnockout, fill_flag, pIccTransform)) {
|
| - return FALSE;
|
| + return false;
|
| }
|
| }
|
| - return TRUE;
|
| + return true;
|
| }
|
| void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, FX_DWORD argb)
|
| {
|
| @@ -1205,7 +1205,7 @@ void RgbByteOrderCompositeRect(CFX_DIBitmap* pBitmap, int left, int top, int wid
|
| width = rect.Width();
|
| int src_r = FXARGB_R(argb), src_g = FXARGB_G(argb), src_b = FXARGB_B(argb);
|
| int Bpp = pBitmap->GetBPP() / 8;
|
| - FX_BOOL bAlpha = pBitmap->HasAlpha();
|
| + bool bAlpha = pBitmap->HasAlpha();
|
| int dib_argb = FXARGB_TOBGRORDERDIB(argb);
|
| uint8_t* pBuffer = pBitmap->GetBuffer();
|
| if (src_alpha == 255) {
|
| @@ -1314,7 +1314,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
|
| }
|
| }
|
| } else {
|
| - ASSERT(FALSE);
|
| + ASSERT(false);
|
| }
|
| } else if (dest_format == FXDIB_Argb || dest_format == FXDIB_Rgb32) {
|
| if (src_format == FXDIB_Rgb) {
|
| @@ -1348,7 +1348,7 @@ void RgbByteOrderTransferBitmap(CFX_DIBitmap* pBitmap, int dest_left, int dest_t
|
| }
|
| }
|
| } else {
|
| - ASSERT(FALSE);
|
| + ASSERT(false);
|
| }
|
| }
|
| FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha)
|
| @@ -1358,9 +1358,9 @@ FX_ARGB _DefaultCMYK2ARGB(FX_CMYK cmyk, uint8_t alpha)
|
| r, g, b);
|
| return ArgbEncode(alpha, r, g, b);
|
| }
|
| -FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
|
| +bool _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
|
| {
|
| - FX_BOOL bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
|
| + bool bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
|
| int alpha = bObjCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
|
| if (pIccTransform) {
|
| ICodec_IccModule* pIccModule = CFX_GEModule::Get()->GetCodecModule()->GetIccModule();
|
| @@ -1373,7 +1373,7 @@ FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int al
|
| } else {
|
| if (pDevice->IsCmykImage()) {
|
| if (!bObjCMYK) {
|
| - return FALSE;
|
| + return false;
|
| }
|
| } else {
|
| if (bObjCMYK) {
|
| @@ -1385,12 +1385,12 @@ FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice, int x, int y, FX_DWORD color, int al
|
| if (pDevice->m_pAlphaMask) {
|
| pDevice->m_pAlphaMask->SetPixel(x, y, alpha << 24);
|
| }
|
| - return TRUE;
|
| + return true;
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
|
| +bool CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_flag, void* pIccTransform)
|
| {
|
| if (m_pBitmap->GetBuffer() == NULL) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| if (!CFX_GEModule::Get()->GetCodecModule() || !CFX_GEModule::Get()->GetCodecModule()->GetIccModule()) {
|
| pIccTransform = NULL;
|
| @@ -1410,12 +1410,12 @@ FX_BOOL CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_fl
|
| }
|
| } else if (m_pClipRgn->GetType() == CFX_ClipRgn::MaskF) {
|
| const CFX_DIBitmap* pMask = m_pClipRgn->GetMask();
|
| - FX_BOOL bCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
|
| + bool bCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
|
| int new_alpha = bCMYK ? FXGETFLAG_ALPHA_FILL(alpha_flag) : FXARGB_A(color);
|
| new_alpha = new_alpha * pMask->GetScanline(y)[x] / 255;
|
| if (m_bRgbByteOrder) {
|
| RgbByteOrderSetPixel(m_pBitmap, x, y, (color & 0xffffff) | (new_alpha << 24));
|
| - return TRUE;
|
| + return true;
|
| }
|
| if (bCMYK) {
|
| FXSETFLAG_ALPHA_FILL(alpha_flag, new_alpha);
|
| @@ -1425,15 +1425,15 @@ FX_BOOL CFX_AggDeviceDriver::SetPixel(int x, int y, FX_DWORD color, int alpha_fl
|
| return _DibSetPixel(m_pBitmap, x, y, color, alpha_flag, pIccTransform);
|
| }
|
| }
|
| - return TRUE;
|
| + return true;
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
|
| +bool CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform, int blend_type)
|
| {
|
| if (blend_type != FXDIB_BLEND_NORMAL) {
|
| - return FALSE;
|
| + return false;
|
| }
|
| if (m_pBitmap->GetBuffer() == NULL) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| FX_RECT clip_rect;
|
| GetClipBox(&clip_rect);
|
| @@ -1442,7 +1442,7 @@ FX_BOOL CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
|
| draw_rect.Intersect(*pRect);
|
| }
|
| if (draw_rect.IsEmpty()) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| if (m_pClipRgn == NULL || m_pClipRgn->GetType() == CFX_ClipRgn::RectI) {
|
| if (m_bRgbByteOrder) {
|
| @@ -1450,27 +1450,27 @@ FX_BOOL CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
|
| } else {
|
| m_pBitmap->CompositeRect(draw_rect.left, draw_rect.top, draw_rect.Width(), draw_rect.Height(), fill_color, alpha_flag, pIccTransform);
|
| }
|
| - return TRUE;
|
| + return true;
|
| }
|
| m_pBitmap->CompositeMask(draw_rect.left, draw_rect.top, draw_rect.Width(), draw_rect.Height(), (const CFX_DIBitmap*)m_pClipRgn->GetMask(),
|
| fill_color, draw_rect.left - clip_rect.left, draw_rect.top - clip_rect.top, FXDIB_BLEND_NORMAL, NULL, m_bRgbByteOrder, alpha_flag, pIccTransform);
|
| - return TRUE;
|
| + return true;
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::GetClipBox(FX_RECT* pRect)
|
| +bool CFX_AggDeviceDriver::GetClipBox(FX_RECT* pRect)
|
| {
|
| if (m_pClipRgn == NULL) {
|
| pRect->left = pRect->top = 0;
|
| pRect->right = GetDeviceCaps(FXDC_PIXEL_WIDTH);
|
| pRect->bottom = GetDeviceCaps(FXDC_PIXEL_HEIGHT);
|
| - return TRUE;
|
| + return true;
|
| }
|
| *pRect = m_pClipRgn->GetBox();
|
| - return TRUE;
|
| + return true;
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge)
|
| +bool CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, bool bDEdge)
|
| {
|
| if (m_pBitmap->GetBuffer() == NULL) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| if (bDEdge) {
|
| if (m_bRgbByteOrder) {
|
| @@ -1478,23 +1478,23 @@ FX_BOOL CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top,
|
| } else {
|
| return pBitmap->TransferBitmap(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight(), m_pBitmap, left, top, pIccTransform);
|
| }
|
| - return TRUE;
|
| + return true;
|
| }
|
| FX_RECT rect(left, top, left + pBitmap->GetWidth(), top + pBitmap->GetHeight());
|
| CFX_DIBitmap *pBack = NULL;
|
| if (m_pOriDevice) {
|
| pBack = m_pOriDevice->Clone(&rect);
|
| if (!pBack) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| pBack->CompositeBitmap(0, 0, pBack->GetWidth(), pBack->GetHeight(), m_pBitmap, 0, 0);
|
| } else {
|
| pBack = m_pBitmap->Clone(&rect);
|
| }
|
| if (!pBack) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| - FX_BOOL bRet = TRUE;
|
| + bool bRet = true;
|
| left = left >= 0 ? 0 : left;
|
| top = top >= 0 ? 0 : top;
|
| if (m_bRgbByteOrder) {
|
| @@ -1505,11 +1505,11 @@ FX_BOOL CFX_AggDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top,
|
| delete pBack;
|
| return bRet;
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
|
| +bool CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
|
| int alpha_flag, void* pIccTransform)
|
| {
|
| if (m_pBitmap->GetBuffer() == NULL) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| if (pBitmap->IsAlphaMask())
|
| return m_pBitmap->CompositeMask(left, top, pSrcRect->Width(), pSrcRect->Height(), pBitmap, argb,
|
| @@ -1517,12 +1517,12 @@ FX_BOOL CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD ar
|
| return m_pBitmap->CompositeBitmap(left, top, pSrcRect->Width(), pSrcRect->Height(), pBitmap,
|
| pSrcRect->left, pSrcRect->top, blend_type, m_pClipRgn, m_bRgbByteOrder, pIccTransform);
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
|
| +bool CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
|
| int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
|
| int alpha_flag, void* pIccTransform, int blend_type)
|
| {
|
| if (m_pBitmap->GetBuffer() == NULL) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| if (dest_width == pSource->GetWidth() && dest_height == pSource->GetHeight()) {
|
| FX_RECT rect(0, 0, dest_width, dest_height);
|
| @@ -1533,30 +1533,30 @@ FX_BOOL CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWOR
|
| FX_RECT dest_clip = dest_rect;
|
| dest_clip.Intersect(*pClipRect);
|
| CFX_BitmapComposer composer;
|
| - composer.Compose(m_pBitmap, m_pClipRgn, 255, argb, dest_clip, FALSE, FALSE, FALSE, m_bRgbByteOrder, alpha_flag, pIccTransform, blend_type);
|
| + composer.Compose(m_pBitmap, m_pClipRgn, 255, argb, dest_clip, false, false, false, m_bRgbByteOrder, alpha_flag, pIccTransform, blend_type);
|
| dest_clip.Offset(-dest_rect.left, -dest_rect.top);
|
| CFX_ImageStretcher stretcher;
|
| if (stretcher.Start(&composer, pSource, dest_width, dest_height, dest_clip, flags)) {
|
| stretcher.Continue(NULL);
|
| }
|
| - return TRUE;
|
| + return true;
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
|
| +bool CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
|
| const CFX_AffineMatrix* pMatrix, FX_DWORD render_flags, void*& handle,
|
| int alpha_flag, void* pIccTransform, int blend_type)
|
| {
|
| if (m_pBitmap->GetBuffer() == NULL) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| CFX_ImageRenderer* pRenderer = new CFX_ImageRenderer;
|
| pRenderer->Start(m_pBitmap, m_pClipRgn, pSource, bitmap_alpha, argb, pMatrix, render_flags, m_bRgbByteOrder, alpha_flag, pIccTransform);
|
| handle = pRenderer;
|
| - return TRUE;
|
| + return true;
|
| }
|
| -FX_BOOL CFX_AggDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
|
| +bool CFX_AggDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
|
| {
|
| if (m_pBitmap->GetBuffer() == NULL) {
|
| - return TRUE;
|
| + return true;
|
| }
|
| return ((CFX_ImageRenderer*)pHandle)->Continue(pPause);
|
| }
|
| @@ -1569,30 +1569,30 @@ void CFX_AggDeviceDriver::CancelDIBits(void* pHandle)
|
| }
|
| CFX_FxgeDevice::CFX_FxgeDevice()
|
| {
|
| - m_bOwnedBitmap = FALSE;
|
| + m_bOwnedBitmap = false;
|
| }
|
| -FX_BOOL CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
|
| +bool CFX_FxgeDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
|
| {
|
| if (pBitmap == NULL) {
|
| - return FALSE;
|
| + return false;
|
| }
|
| SetBitmap(pBitmap);
|
| IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
|
| SetDeviceDriver(pDriver);
|
| - return TRUE;
|
| + return true;
|
| }
|
| -FX_BOOL CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
|
| +bool CFX_FxgeDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
|
| {
|
| - m_bOwnedBitmap = TRUE;
|
| + m_bOwnedBitmap = true;
|
| CFX_DIBitmap* pBitmap = new CFX_DIBitmap;
|
| if (!pBitmap->Create(width, height, format)) {
|
| delete pBitmap;
|
| - return FALSE;
|
| + return false;
|
| }
|
| SetBitmap(pBitmap);
|
| - IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
|
| + IFX_RenderDeviceDriver* pDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, false, pOriDevice, false);
|
| SetDeviceDriver(pDriver);
|
| - return TRUE;
|
| + return true;
|
| }
|
| CFX_FxgeDevice::~CFX_FxgeDevice()
|
| {
|
|
|