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

Unified Diff: core/fxge/skia/fx_skia_device.cpp

Issue 1887073002: skia bugs found with first test pdf (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/skia/fx_skia_device.cpp
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index e617630bdcb6aef8dabbb06717e7265b7167b801..b00bc8e5c5e72114dd3bc175851ef1b1e60c5036 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -723,7 +723,11 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawPath(
SkIRect rect;
rect.set(0, 0, GetDeviceCaps(FXDC_PIXEL_WIDTH),
GetDeviceCaps(FXDC_PIXEL_HEIGHT));
- SkMatrix skMatrix = ToSkMatrix(*pObject2Device);
+ SkMatrix skMatrix;
+ if (pObject2Device)
+ skMatrix = ToSkMatrix(*pObject2Device);
+ else
+ skMatrix.setIdentity();
SkPaint skPaint;
skPaint.setAntiAlias(true);
int stroke_alpha = FXGETFLAG_COLORTYPE(alpha_flag)
@@ -933,7 +937,7 @@ FX_BOOL CFX_SkiaDeviceDriver::GetDIBits(CFX_DIBitmap* pBitmap,
int top,
void* pIccTransform,
FX_BOOL bDEdge) {
- if (!m_pBitmap->GetBuffer())
+ if (!m_pBitmap || !m_pBitmap->GetBuffer())
return TRUE;
if (bDEdge) {
if (m_bRgbByteOrder) {
@@ -982,7 +986,7 @@ FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
int blend_type,
int alpha_flag,
void* pIccTransform) {
- if (!m_pBitmap->GetBuffer())
+ if (!m_pBitmap || !m_pBitmap->GetBuffer())
return TRUE;
if (pBitmap->IsAlphaMask()) {
return m_pBitmap->CompositeMask(
@@ -1065,6 +1069,9 @@ FX_BOOL CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource,
rowBytes = width;
colorType = SkColorType::kGray_8_SkColorType;
} break;
+ case 8:
+ colorType = SkColorType::kGray_8_SkColorType;
+ break;
case 24: {
dst32Storage.reset(FX_Alloc2D(uint32_t, width, height));
uint32_t* dst32Pixels = dst32Storage.get();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698