summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcaryclark <caryclark@google.com>2016-04-14 09:09:44 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-14 09:09:44 -0700
commit725a49f7a64a3537c081cd23cf7d5d6578efdfa1 (patch)
tree39609367ed481fbee11a343d1d049768bdcbaebe
parentbd9748d504555f100d34025d76a9e0119986bc3f (diff)
downloadpdfium-725a49f7a64a3537c081cd23cf7d5d6578efdfa1.tar.xz
skia bugs found with first test pdf
The first PDF attempted by the Skia infra team uncovered three bugs. This gets past those bugs crashing; more work to do to get the correct output. R=rmistry@google.com,dsinclair@chromium.org BUG=skia:5183 Review URL: https://codereview.chromium.org/1887073002
-rw-r--r--core/fxge/skia/fx_skia_device.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index e617630bdc..b00bc8e5c5 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();