[Webkit-unassigned] [Bug 66226] Chromium Mac: Rubber banding gutter drawing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 15 12:08:47 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=66226





--- Comment #6 from asvitkine at chromium.org  2011-08-15 12:08:47 PST ---
(In reply to comment #2)
> (From update of attachment 103914 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=103914&action=review
> 
> > Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h:-77
> > -    void preferencesChanged();
> 
> I think moving this up makes sense but it's probably better not to do these kind of changes until ScrollbarThemeChromiumMac.* and ScrollbarThemeMac.* are merged back together (hopefully soon).
> Alternatively, you could make this change in both files.
> 
> > Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm:202
> > +                NSData* tiffData =  [image TIFFRepresentation];
> 
> I don't think this is a good way convert to CGImage. It's much better to create a CGBitmap and draw into it.

Doing it the way you suggest requires more code and appears to be slower in this case (perhaps the TIFFRepresentation data is already available for this image).

The CGBitmap code consistently takes 6ms to execute compared to the TIFFRepresentation path, which takes 5ms consistently.

FWIW, I tried it using this code:

http://codesearch.google.com/#OAMlx_jo-ck/src/base/mac/mac_util.mm&exact_package=chromium&q=CopyNSImageToCGImage&type=cs&l=382

> 
> Also, if all you need to do is fill a rect with a patter than you don't even need a CGImage. You can use the NSImage directly. See LocalCurrentGraphicsContext.

The current code has the advantage that the drawing code is not Mac specific - so for example it could be easily re-used for other platforms if desired (they just need to provide a different Pattern).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list