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

Unified Diff: core/src/fxge/skia/fx_skia_blitter_new.cpp

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxge/ge/fx_ge_text.cpp ('k') | core/src/fxge/skia/fx_skia_device.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/skia/fx_skia_blitter_new.cpp
diff --git a/core/src/fxge/skia/fx_skia_blitter_new.cpp b/core/src/fxge/skia/fx_skia_blitter_new.cpp
index ed7b1c74bfc756ef0514d83e2ea5898e006442ea..85391cb77ab628ed9729ce144b9adef897a7394c 100644
--- a/core/src/fxge/skia/fx_skia_blitter_new.cpp
+++ b/core/src/fxge/skia/fx_skia_blitter_new.cpp
@@ -16,7 +16,7 @@ void CFX_SkiaRenderer::blitAntiH(int x,
const SkAlpha antialias[],
const int16_t runs[]) {
FXSYS_assert(m_Alpha);
- if (m_pOriDevice == NULL && composite_span == NULL)
+ if (!m_pOriDevice && !composite_span)
return;
if (y < m_ClipBox.top || y >= m_ClipBox.bottom)
return;
@@ -106,12 +106,13 @@ void CFX_SkiaRenderer::CompositeSpan1bpp_0(uint8_t* dest_scan,
dest_scan += col_start / 8;
int index = 0;
- if (m_pDevice->GetPalette() == NULL)
- index = ((uint8_t)m_Color == 0xff) ? 1 : 0;
- else {
- for (int i = 0; i < 2; i++)
+ if (m_pDevice->GetPalette()) {
+ for (int i = 0; i < 2; i++) {
if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color)
index = i;
+ }
+ } else {
+ index = ((uint8_t)m_Color == 0xff) ? 1 : 0;
}
uint8_t* dest_scan1 = dest_scan;
int src_alpha = m_Alpha * cover_scan / 255;
@@ -150,12 +151,13 @@ void CFX_SkiaRenderer::CompositeSpan1bpp_4(uint8_t* dest_scan,
dest_scan += col_start / 8;
int index = 0;
- if (m_pDevice->GetPalette() == NULL)
- index = ((uint8_t)m_Color == 0xff) ? 1 : 0;
- else {
- for (int i = 0; i < 2; i++)
+ if (m_pDevice->GetPalette()) {
+ for (int i = 0; i < 2; i++) {
if (FXARGB_TODIB(m_pDevice->GetPalette()[i]) == m_Color)
index = i;
+ }
+ } else {
+ index = ((uint8_t)m_Color == 0xff) ? 1 : 0;
}
uint8_t* dest_scan1 = dest_scan;
int src_alpha = m_Alpha * cover_scan / 255;
@@ -1736,9 +1738,7 @@ FX_BOOL CFX_SkiaRenderer::Init(
composite_span = &CFX_SkiaRenderer::CompositeSpanRGB24_14;
break;
}
- if (composite_span == NULL)
- return FALSE;
- return TRUE;
+ return !!composite_span;
}
/*----------------------------------------------------------------------------------------------------*/
« no previous file with comments | « core/src/fxge/ge/fx_ge_text.cpp ('k') | core/src/fxge/skia/fx_skia_device.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698