Bug 49560

Summary: [chromium] Avoid copying of SkBitmap in LayerRendererChromium
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: Layout and RenderingAssignee: Kenneth Russell <kbr>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, jamesr, levin, thakis, vangelis
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch jamesr: review+, kbr: commit-queue-

Kenneth Russell
Reported 2010-11-15 13:12:26 PST
Grace Kloba found that LayerRendererChromium was inadvertently causing a copy of the SkBitmap data structure for the root layer's canvas. If the bitmap is using an SkPixelRef internally, this can cause getPixels() to return NULL. The fix is to use a const SkBitmap& like ContentLayerChromium already does.
Attachments
Patch (1.41 KB, patch)
2010-11-15 13:14 PST, Kenneth Russell
jamesr: review+
kbr: commit-queue-
Kenneth Russell
Comment 1 2010-11-15 13:14:30 PST
James Robinson
Comment 2 2010-11-15 13:15:36 PST
Comment on attachment 73925 [details] Patch Good catch!
Kenneth Russell
Comment 3 2010-11-15 13:17:13 PST
Nico Weber
Comment 4 2010-11-15 16:48:29 PST
Accessing pixels() without calling lockPixels() isn't guaranteed to work.
James Robinson
Comment 5 2010-11-15 16:57:23 PST
Yeah, this really should call accessBitmap(true) as well, no?
Kenneth Russell
Comment 6 2010-11-15 17:02:08 PST
(In reply to comment #4) > Accessing pixels() without calling lockPixels() isn't guaranteed to work. This is definitely true for an ordinary SkBitmap, but what about the bitmaps that are managed by an SkDevice?
Kenneth Russell
Comment 7 2010-11-15 17:02:34 PST
(In reply to comment #5) > Yeah, this really should call accessBitmap(true) as well, no? No; the bitmap's pixels are only accessed to upload them to OpenGL, and aren't modified.
Note You need to log in before you can comment on or make changes to this bug.