Bug 26061

Summary: [SKIA] Crash when filling an empty pattern
Product: WebKit Reporter: Dean McNamee <deanm>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, skylined
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
patch
eric: review+
Patch with indention fixed none

Description Dean McNamee 2009-05-28 06:08:25 PDT
Skia-specific crash, where we assume that the bitmap for a pattern is valid.  In reality it can return NULL.  For example:

createPattern(new Image, "repeat")

Original Chromium bug:

http://code.google.com/p/chromium/issues/detail?id=10881
Comment 1 Dean McNamee 2009-05-28 06:10:57 PDT
Created attachment 30735 [details]
patch
Comment 2 Eric Seidel (no email) 2009-06-04 09:05:16 PDT
Comment on attachment 30735 [details]
patch

The patch looks fine.

I would have used a named constant for the color.  I'm surprised that skia doesn't have a "transparent" constant that you can return instead of having to manually construct a color.

Color::transparent is identical, and is guaranteed to be the right format due to COMPILE_ASSERT checks in ColorSkia.cpp.

Tab indent should be 4 spaces, not 2.

Those are both nits someone could fix when landing.
Comment 3 Dean McNamee 2009-06-10 05:54:27 PDT
Created attachment 31129 [details]
Patch with indention fixed

Fixed the indention line.  I don't think making a constant (since Skia doesn't already have one) is worthwhile, it's pretty clear from the comment that I'm creating a transparent color.  I don't like using Color in place of SkColor, even though I realize they have the same layout.
Comment 4 Brent Fulgham 2009-06-10 11:05:29 PDT
Please don't remove "Reviewed by (OOPS)" comment created by prepare-ChangeLog.

Confirmed p-1.txt and p-2.txt differed only by spacing per Eric's comment and landed.

Landed in @r44575.