summaryrefslogtreecommitdiff
path: root/core/src/fxge/skia
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
commitff46aaf499edcf153ee2f57c7016587aa96dcfa0 (patch)
tree0a0d92713af476897899b126d180cc6294433d10 /core/src/fxge/skia
parentaafeff816e22c1333c17d8a0eb4fe8927c28142d (diff)
downloadpdfium-ff46aaf499edcf153ee2f57c7016587aa96dcfa0.tar.xz
FX Bool considered harmful, part 3
Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 .
Diffstat (limited to 'core/src/fxge/skia')
-rw-r--r--core/src/fxge/skia/fx_skia_blitter_new.cpp18
-rw-r--r--core/src/fxge/skia/fx_skia_blitter_new.h8
-rw-r--r--core/src/fxge/skia/fx_skia_device.cpp102
-rw-r--r--core/src/fxge/skia/fx_skia_device.h38
4 files changed, 83 insertions, 83 deletions
diff --git a/core/src/fxge/skia/fx_skia_blitter_new.cpp b/core/src/fxge/skia/fx_skia_blitter_new.cpp
index 3437eb497d..13bb753e45 100644
--- a/core/src/fxge/skia/fx_skia_blitter_new.cpp
+++ b/core/src/fxge/skia/fx_skia_blitter_new.cpp
@@ -1298,7 +1298,7 @@
//--------------------------------------------------------------------
- FX_BOOL CFX_SkiaRenderer::Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bRgbByteOrder,
+ bool CFX_SkiaRenderer::Init(CFX_DIBitmap* pDevice, CFX_DIBitmap* pOriDevice, const CFX_ClipRgn* pClipRgn, FX_DWORD color, bool bFullCover, bool bRgbByteOrder,
int alpha_flag, void* pIccTransform) //The alpha flag must be fill_flag if exist.
{
m_pDevice = pDevice;
@@ -1331,8 +1331,8 @@
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);
@@ -1377,7 +1377,7 @@
pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&m_Color, (const uint8_t*)&m_Color, 1);
} else { // Object RGB
if (!pIccTransform)
- return FALSE;
+ return false;
color = FXARGB_TODIB(color);
pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&m_Color, (const uint8_t*)&color, 1);
}
@@ -1385,7 +1385,7 @@
m_Green = ((uint8_t*)&m_Color)[1];
m_Blue = ((uint8_t*)&m_Color)[2];
m_Gray = ((uint8_t*)&m_Color)[3];
- return TRUE;
+ return true;
}
if (pIccTransform) {
color = bObjectCMYK ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
@@ -1496,8 +1496,8 @@
break;
}
if (composite_span == NULL)
- return FALSE;
- return TRUE;
+ return false;
+ return true;
}
/*----------------------------------------------------------------------------------------------------*/
@@ -1595,7 +1595,7 @@
blitV(x, y, height, rightAlpha);
}
- FX_BOOL CFX_SkiaA8Renderer::Init(CFX_DIBitmap* pDevice, int Left, int Top)
+ bool CFX_SkiaA8Renderer::Init(CFX_DIBitmap* pDevice, int Left, int Top)
{
m_pDevice = pDevice;
m_Left = Left;
@@ -1604,6 +1604,6 @@
m_dstWidth = m_Left + pDevice->GetWidth();
m_dstHeight = m_Top + pDevice->GetHeight();
}
- return TRUE;
+ return true;
}
#endif
diff --git a/core/src/fxge/skia/fx_skia_blitter_new.h b/core/src/fxge/skia/fx_skia_blitter_new.h
index e60c6398d2..cd411da9f5 100644
--- a/core/src/fxge/skia/fx_skia_blitter_new.h
+++ b/core/src/fxge/skia/fx_skia_blitter_new.h
@@ -15,9 +15,9 @@ protected:
m_Blue, // Yellow
m_Gray; // Black
FX_DWORD m_Color; // FX_ARGB or FX_CMYK
- FX_BOOL m_bFullCover;
+ bool m_bFullCover;
int m_ProcessFilter;
- FX_BOOL m_bRgbByteOrder;
+ bool m_bRgbByteOrder;
FX_RECT m_ClipBox;
CFX_DIBitmap* m_pDevice;
@@ -205,7 +205,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); //The alpha flag must be fill_flag if exist.
};
class CFX_SkiaA8Renderer : public SkBlitter
@@ -218,7 +218,7 @@ public:
virtual void blitRect(int x, int y, int width, int height);
virtual void blitAntiRect(int x, int y, int width, int height, SkAlpha leftAlpha, SkAlpha rightAlpha);
//--------------------------------------------------------------------
- FX_BOOL Init(CFX_DIBitmap* pDevice, int Left, int Top);
+ bool Init(CFX_DIBitmap* pDevice, int Left, int Top);
CFX_DIBitmap* m_pDevice;
int m_Left;
int m_Top;
diff --git a/core/src/fxge/skia/fx_skia_device.cpp b/core/src/fxge/skia/fx_skia_device.cpp
index 41ce077976..72478b1097 100644
--- a/core/src/fxge/skia/fx_skia_device.cpp
+++ b/core/src/fxge/skia/fx_skia_device.cpp
@@ -46,24 +46,24 @@ class SuperBlitter_skia
public:
static void DrawPath(const SkPath& srcPath, SkBlitter* blitter, const SkRasterClip& rect, const SkPaint& origPaint);
};
-FX_BOOL FxSkDrawTreatAsHairline(const SkPaint& paint, SkScalar* coverage) {
+bool FxSkDrawTreatAsHairline(const SkPaint& paint, SkScalar* coverage) {
if (SkPaint::kStroke_Style != paint.getStyle())
- return FALSE;
+ return false;
FXSYS_assert(coverage);
SkScalar strokeWidth = paint.getStrokeWidth();
if (0 == strokeWidth) {
*coverage = SK_Scalar1;
- return TRUE;
+ return true;
}
// if we get here, we need to try to fake a thick-stroke with a modulated
// hairline
if (!paint.isAntiAlias())
- return FALSE;
+ return false;
if (strokeWidth <= SK_Scalar1) {
*coverage = strokeWidth;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void SuperBlitter_skia::DrawPath(const SkPath& srcPath, SkBlitter* blitter, const SkRasterClip& rect, const SkPaint& origPaint)
@@ -167,7 +167,7 @@ void CSkia_PathData::BuildPath(const CFX_PathData* pPathData, const CFX_AffineMa
static void SkRasterizeStroke(SkPaint& spaint, SkPath* dstPathData, SkPath& path_data,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState, FX_FIXFLOAT scale = FIX8_ONE,
- FX_BOOL bStrokeAdjust = FALSE, FX_BOOL bTextMode = FALSE)
+ bool bStrokeAdjust = false, bool bTextMode = false)
{
SkPaint::Cap cap;
switch (pGraphState->m_LineCap) {
@@ -203,7 +203,7 @@ static void SkRasterizeStroke(SkPaint& spaint, SkPath* dstPathData, SkPath& path
stroker.setJoin(join);
stroker.setMiterLimit(pGraphState->m_MiterLimit);
stroker.setWidth(width);
- stroker.setDoFill(FALSE);
+ stroker.setDoFill(false);
stroker.strokePath(path_data, dstPathData);
SkMatrix smatrix;
smatrix.setAll(pObject2Device->a, pObject2Device->c, pObject2Device->e, pObject2Device->b, pObject2Device->d, pObject2Device->f, 0, 0, 1);
@@ -235,7 +235,7 @@ static void SkRasterizeStroke(SkPaint& spaint, SkPath* dstPathData, SkPath& path
}
}
-CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
+CFX_SkiaDeviceDriver::CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
{
m_pAggDriver = new CFX_AggDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
}
@@ -243,7 +243,7 @@ CFX_SkiaDeviceDriver::~CFX_SkiaDeviceDriver()
{
delete m_pAggDriver;
}
-FX_BOOL CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FIXFLOAT font_size, FX_DWORD color,
int alpha_flag, void* pIccTransform)
{
@@ -259,7 +259,7 @@ void CFX_SkiaDeviceDriver::SaveState()
m_pAggDriver->SaveState();
}
-void CFX_SkiaDeviceDriver::RestoreState(FX_BOOL bKeepSaved)
+void CFX_SkiaDeviceDriver::RestoreState(bool bKeepSaved)
{
m_pAggDriver->RestoreState(bKeepSaved);
}
@@ -294,7 +294,7 @@ void CFX_SkiaDeviceDriver::SetClipMask(SkPath& skPath, SkPaint* spaint)
m_pAggDriver->m_pClipRgn->IntersectMaskF(clip_box.fLeft, clip_box.fTop, mask);
}
-FX_BOOL CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // path info
+bool CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
int fill_mode // fill mode, WINDING or ALTERNATE
)
@@ -308,7 +308,7 @@ FX_BOOL CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, //
rectf.Intersect(CFX_FloatRect(0, 0, (FX_FIXFLOAT)GetDeviceCaps(FXDC_PIXEL_WIDTH), (FX_FIXFLOAT)GetDeviceCaps(FXDC_PIXEL_HEIGHT)));
FX_RECT rect = rectf.GetOutterRect();
m_pAggDriver->m_pClipRgn->IntersectRect(rect);
- return TRUE;
+ return true;
}
}
CSkia_PathData path_data;
@@ -318,15 +318,15 @@ FX_BOOL CFX_SkiaDeviceDriver::SetClip_PathFill(const CFX_PathData* pPathData, //
SkPaint spaint;
spaint.setColor(0xffffffff);
- spaint.setAntiAlias(TRUE);
+ spaint.setAntiAlias(true);
spaint.setStyle(SkPaint::kFill_Style);
SetClipMask(path_data.m_PathData, &spaint);
- return TRUE;
+ return true;
}
-FX_BOOL CFX_SkiaDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, // path info
+bool CFX_SkiaDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState // graphic state, for pen attributes
)
@@ -342,36 +342,36 @@ FX_BOOL CFX_SkiaDeviceDriver::SetClip_PathStroke(const CFX_PathData* pPathData,
SkPaint spaint;
spaint.setColor(0xffffffff);
spaint.setStyle(SkPaint::kStroke_Style);
- spaint.setAntiAlias(TRUE);
+ spaint.setAntiAlias(true);
SkPath dst_path;
- SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, pObject2Device, pGraphState, 1, FALSE, 0);
+ SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, pObject2Device, pGraphState, 1, false, 0);
spaint.setStyle(SkPaint::kFill_Style);
SetClipMask(dst_path, &spaint);
- return TRUE;
+ return true;
}
-FX_BOOL CFX_SkiaDeviceDriver::RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
+bool CFX_SkiaDeviceDriver::RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->RenderRasterizer(rasterizer, color, bFullCover, bGroupKnockout,alpha_flag, pIccTransform);
}
-FX_BOOL CFX_SkiaDeviceDriver::RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
- int alpha_flag, void* pIccTransform, FX_BOOL bFill)
+bool CFX_SkiaDeviceDriver::RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+ int alpha_flag, void* pIccTransform, bool bFill)
{
CFX_DIBitmap* pt = bGroupKnockout?m_pAggDriver->GetBackDrop():NULL;
CFX_SkiaRenderer render;
if (!render.Init(m_pAggDriver->m_pBitmap, pt, m_pAggDriver->m_pClipRgn, color, bFullCover, m_pAggDriver->m_bRgbByteOrder, alpha_flag, pIccTransform))
- return FALSE;
+ return false;
SkRasterClip rasterClip(rect);
SuperBlitter_skia::DrawPath(skPath, (SkBlitter*)&render, rasterClip, origPaint);
- return TRUE;
+ return true;
}
-FX_BOOL CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
+bool CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState, // graphic state, for pen attributes
FX_DWORD fill_color, // fill color
@@ -381,7 +381,7 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path in
void* pIccTransform
)
{
- if (GetBuffer() == NULL) return TRUE;
+ if (GetBuffer() == NULL) return true;
FOXIT_DEBUG1("CFX_SkiaDeviceDriver::DrawPath: entering");
SkIRect rect;
rect.set(0, 0, GetDeviceCaps(FXDC_PIXEL_WIDTH), GetDeviceCaps(FXDC_PIXEL_HEIGHT));
@@ -396,11 +396,11 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path in
path_data.m_PathData.setFillType((fill_mode&3) == FXFILL_WINDING? SkPath::kWinding_FillType:SkPath::kEvenOdd_FillType);
SkPaint spaint;
- spaint.setAntiAlias(TRUE);
+ spaint.setAntiAlias(true);
spaint.setStyle(SkPaint::kFill_Style);
spaint.setColor(fill_color);
- if (!RenderRasterizerSkia(path_data.m_PathData, spaint, rect, fill_color, fill_mode & FXFILL_FULLCOVER, FALSE, alpha_flag, pIccTransform))
- return FALSE;
+ if (!RenderRasterizerSkia(path_data.m_PathData, spaint, rect, 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);
@@ -427,48 +427,48 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawPath(const CFX_PathData* pPathData, // path in
SkPaint spaint;
spaint.setColor(stroke_color);
spaint.setStyle(SkPaint::kStroke_Style);
- spaint.setAntiAlias(TRUE);
+ spaint.setAntiAlias(true);
SkPath dst_path;
- SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, FALSE, 0);
+ SkRasterizeStroke(spaint, &dst_path, path_data.m_PathData, &matrix2, pGraphState, matrix1.a, false, 0);
spaint.setStyle(SkPaint::kFill_Style);
int fill_flag = FXGETFLAG_COLORTYPE(alpha_flag)<<8 | FXGETFLAG_ALPHA_STROKE(alpha_flag);
- if (!RenderRasterizerSkia(dst_path, spaint, rect, stroke_color, fill_mode & FXFILL_FULLCOVER, FALSE, fill_flag, pIccTransform, FALSE))
- return FALSE;
+ if (!RenderRasterizerSkia(dst_path, spaint, rect, stroke_color, fill_mode & FXFILL_FULLCOVER, false, fill_flag, pIccTransform, false))
+ return false;
}
- return TRUE;
+ return true;
}
-FX_BOOL CFX_SkiaDeviceDriver::SetPixel(int x, int y, FX_DWORD color,
+bool CFX_SkiaDeviceDriver::SetPixel(int x, int y, FX_DWORD color,
int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->SetPixel(x, y, color, alpha_flag, pIccTransform);
}
-FX_BOOL CFX_SkiaDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform)
+bool CFX_SkiaDeviceDriver::FillRect(const FX_RECT* pRect, FX_DWORD fill_color, int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->FillRect(pRect, fill_color, alpha_flag, pIccTransform);
}
-FX_BOOL CFX_SkiaDeviceDriver::GetClipBox(FX_RECT* pRect)
+bool CFX_SkiaDeviceDriver::GetClipBox(FX_RECT* pRect)
{
return m_pAggDriver->GetClipBox(pRect);
}
-FX_BOOL CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, FX_BOOL bDEdge)
+bool CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform, bool bDEdge)
{
return m_pAggDriver->GetDIBits(pBitmap, left, top, pIccTransform, bDEdge);
}
-FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
+bool CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD argb, const FX_RECT* pSrcRect, int left, int top, int blend_type,
int alpha_flag, void* pIccTransform)
{
return m_pAggDriver->SetDIBits(pBitmap, argb, pSrcRect, left, top, blend_type, alpha_flag, pIccTransform);
}
-FX_BOOL CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWORD argb, int dest_left, int dest_top,
+bool CFX_SkiaDeviceDriver::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)
{
@@ -477,7 +477,7 @@ FX_BOOL CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource, FX_DWO
alpha_flag, pIccTransform);
}
-FX_BOOL CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitmap_alpha, FX_DWORD argb,
+bool CFX_SkiaDeviceDriver::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)
{
@@ -485,7 +485,7 @@ FX_BOOL CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource, int bitm
pMatrix, render_flags, handle, alpha_flag, pIccTransform);
}
-FX_BOOL CFX_SkiaDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
+bool CFX_SkiaDeviceDriver::ContinueDIBits(void* pHandle, IFX_Pause* pPause)
{
return m_pAggDriver->ContinueDIBits(pHandle, pPause);
}
@@ -497,31 +497,31 @@ void CFX_SkiaDeviceDriver::CancelDIBits(void* pHandle)
CFX_SkiaDevice::CFX_SkiaDevice()
{
- m_bOwnedBitmap = FALSE;
+ m_bOwnedBitmap = false;
}
-FX_BOOL CFX_SkiaDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout)
+bool CFX_SkiaDevice::Attach(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout)
{
if (pBitmap == NULL)
- return FALSE;
+ return false;
SetBitmap(pBitmap);
CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, bRgbByteOrder, pOriDevice, bGroupKnockout);
SetDeviceDriver(pDriver);
- return TRUE;
+ return true;
}
-FX_BOOL CFX_SkiaDevice::Create(int width, int height, FXDIB_Format format, int dither_bits, CFX_DIBitmap* pOriDevice)
+bool CFX_SkiaDevice::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);
- CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, FALSE, pOriDevice, FALSE);
+ CFX_SkiaDeviceDriver* pDriver = new CFX_SkiaDeviceDriver(pBitmap, dither_bits, false, pOriDevice, false);
SetDeviceDriver(pDriver);
- return TRUE;
+ return true;
}
CFX_SkiaDevice::~CFX_SkiaDevice()
{
diff --git a/core/src/fxge/skia/fx_skia_device.h b/core/src/fxge/skia/fx_skia_device.h
index ab51e51a33..7278671dc7 100644
--- a/core/src/fxge/skia/fx_skia_device.h
+++ b/core/src/fxge/skia/fx_skia_device.h
@@ -9,7 +9,7 @@
class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver
{
public:
- CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, FX_BOOL bRgbByteOrder, CFX_DIBitmap* pOriDevice, FX_BOOL bGroupKnockout);
+ CFX_SkiaDeviceDriver(CFX_DIBitmap* pBitmap, int dither_bits, bool bRgbByteOrder, CFX_DIBitmap* pOriDevice, bool bGroupKnockout);
virtual ~CFX_SkiaDeviceDriver();
/** Options */
@@ -17,22 +17,22 @@ public:
/** Save and restore all graphic states */
virtual void SaveState();
- virtual void RestoreState(FX_BOOL bKeepSaved);
+ virtual void RestoreState(bool bKeepSaved);
/** Set clipping path using filled region */
- virtual FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, // path info
+ virtual bool SetClip_PathFill(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
int fill_mode // fill mode, WINDING or ALTERNATE
);
/** Set clipping path using stroked region */
- virtual FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, // path info
+ virtual bool SetClip_PathStroke(const CFX_PathData* pPathData, // path info
const CFX_AffineMatrix* pObject2Device, // optional transformation
const CFX_GraphStateData* pGraphState // graphic state, for pen attributes
);
/** Draw a path */
- virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
+ virtual bool DrawPath(const CFX_PathData* pPathData,
const CFX_AffineMatrix* pObject2Device,
const CFX_GraphStateData* pGraphState,
FX_DWORD fill_color,
@@ -42,44 +42,44 @@ public:
void* pIccTransform = NULL
);
- virtual FX_BOOL SetPixel(int x, int y, FX_DWORD color,
+ virtual bool SetPixel(int x, int y, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
+ virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color,
int alpha_flag = 0, void* pIccTransform = NULL);
/** Draw a single pixel (device dependant) line */
- virtual FX_BOOL DrawCosmeticLine(FX_FIXFLOAT x1, FX_FIXFLOAT y1, FX_FIXFLOAT x2, FX_FIXFLOAT y2, FX_DWORD color,
- int alpha_flag, void* pIccTransform, int blend_type) { return FALSE; }
+ virtual bool DrawCosmeticLine(FX_FIXFLOAT x1, FX_FIXFLOAT y1, FX_FIXFLOAT x2, FX_FIXFLOAT y2, FX_DWORD color,
+ int alpha_flag, void* pIccTransform, int blend_type) { return false; }
- virtual FX_BOOL GetClipBox(FX_RECT* pRect);
+ virtual bool GetClipBox(FX_RECT* pRect);
/** Load device buffer into a DIB */
- virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, FX_BOOL bDEdge = FALSE);
+ virtual bool GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void* pIccTransform = NULL, bool bDEdge = false);
virtual CFX_DIBitmap* GetBackDrop() { return m_pAggDriver->GetBackDrop(); }
- virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
+ virtual bool SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, const FX_RECT* pSrcRect,
int dest_left, int dest_top, int blend_type,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
+ virtual bool StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color, int dest_left, int dest_top,
int dest_width, int dest_height, const FX_RECT* pClipRect, FX_DWORD flags,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
+ virtual bool StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alpha, FX_DWORD color,
const CFX_AffineMatrix* pMatrix, FX_DWORD flags, void*& handle,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause);
+ virtual bool ContinueDIBits(void* handle, IFX_Pause* pPause);
virtual void CancelDIBits(void* handle);
- virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
+ virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_Font* pFont,
CFX_FontCache* pCache, const CFX_AffineMatrix* pObject2Device, FX_FIXFLOAT font_size, FX_DWORD color,
int alpha_flag = 0, void* pIccTransform = NULL);
- virtual FX_BOOL RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
+ virtual bool RenderRasterizer(rasterizer_scanline_aa& rasterizer, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
int alpha_flag, void* pIccTransform);
- virtual FX_BOOL RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, FX_BOOL bFullCover, FX_BOOL bGroupKnockout,
- int alpha_flag, void* pIccTransform, FX_BOOL bFill = TRUE);
+ virtual bool RenderRasterizerSkia(SkPath& skPath, const SkPaint& origPaint, SkIRect& rect, FX_DWORD color, bool bFullCover, bool bGroupKnockout,
+ int alpha_flag, void* pIccTransform, bool bFill = true);
void SetClipMask(rasterizer_scanline_aa& rasterizer);
void SetClipMask(SkPath& skPath, SkPaint* spaint);
virtual uint8_t* GetBuffer() const {return m_pAggDriver->GetBuffer();}