RESOLVED FIXED 103896
[skia] Improve performance of GraphicsContext::createCompatibleBuffer by using SkDevice:createCompatibleDevice
https://bugs.webkit.org/show_bug.cgi?id=103896
Summary [skia] Improve performance of GraphicsContext::createCompatibleBuffer by usin...
Justin Novosad
Reported 2012-12-03 08:17:15 PST
[skia] Improve performance of GraphicsContext::createCompatibleBuffer by using SkDevice:createCompatibleDevice
Attachments
Patch (12.51 KB, patch)
2012-12-03 08:39 PST, Justin Novosad
no flags
Patch (12.44 KB, patch)
2012-12-03 11:48 PST, Justin Novosad
no flags
Patch (13.57 KB, patch)
2012-12-03 12:12 PST, Justin Novosad
no flags
Patch (13.58 KB, patch)
2012-12-03 12:41 PST, Justin Novosad
no flags
Justin Novosad
Comment 1 2012-12-03 08:39:51 PST
Early Warning System Bot
Comment 2 2012-12-03 08:45:57 PST
Early Warning System Bot
Comment 3 2012-12-03 08:47:30 PST
Build Bot
Comment 4 2012-12-03 08:49:03 PST
EFL EWS Bot
Comment 5 2012-12-03 08:49:55 PST
Build Bot
Comment 6 2012-12-03 08:56:53 PST
WebKit Review Bot
Comment 7 2012-12-03 09:23:17 PST
Comment on attachment 177261 [details] Patch Attachment 177261 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/15100560 New failing tests: fast/backgrounds/gradient-background-leakage.html
Stephen White
Comment 8 2012-12-03 09:23:57 PST
Comment on attachment 177261 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=177261&action=review > Source/WebCore/platform/graphics/GraphicsContext.h:437 > + PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, bool hasAlpha = true) const; Prefer a flags enum to a bool here, to make the callsites self-documenting. See WebKit coding style. > Source/WebCore/platform/graphics/ImageBuffer.cpp:79 > +ImageBuffer::ImageBuffer(const IntSize&, float resolutionScale, ColorSpace colorSpace, const GraphicsContext* compatibleContext, bool hasAlpha, bool& success) > + : ImageBuffer(IntSize&, resolutionScale, colorSpace, compatibleContext->isAccelerated() ? Accelerated : Unaccelerated, NonDeferred, success) > +{ } Hmm, yeah, that's not going to work. You could use an init() function, but I wonder if it would be possible to simply add the GraphicsContext* to the existing constructor. If you pass NULL, it does the regular construction, otherwise it does the compatible construction. You'd also have to put back the accelerated flag. > Source/WebCore/platform/graphics/ImageBuffer.h:96 > + // Creates a buffer compativble with 'context'. Will return a null pointer on allocation failure. Typo: compativble.
kov's GTK+ EWS bot
Comment 9 2012-12-03 09:25:29 PST
Justin Novosad
Comment 10 2012-12-03 11:47:19 PST
> Prefer a flags enum to a bool here, to make the callsites self-documenting. See WebKit coding style. > Style guide, rule 10: "Prefer enums to bools on function parameters if callers are likely to be passing constants".
Justin Novosad
Comment 11 2012-12-03 11:48:05 PST
Early Warning System Bot
Comment 12 2012-12-03 11:54:10 PST
Early Warning System Bot
Comment 13 2012-12-03 11:54:15 PST
Stephen White
Comment 14 2012-12-03 11:57:52 PST
(In reply to comment #10) > > Prefer a flags enum to a bool here, to make the callsites self-documenting. See WebKit coding style. > > > > Style guide, rule 10: "Prefer enums to bools on function parameters if callers are likely to be passing constants". Good point. Justin pointed out to me offline that the callsites are all passing foo->hasAlpha(), which is self-documenting.
Justin Novosad
Comment 15 2012-12-03 12:12:34 PST
kov's GTK+ EWS bot
Comment 16 2012-12-03 12:22:51 PST
Early Warning System Bot
Comment 17 2012-12-03 12:25:14 PST
Build Bot
Comment 18 2012-12-03 12:30:41 PST
Early Warning System Bot
Comment 19 2012-12-03 12:31:07 PST
Justin Novosad
Comment 20 2012-12-03 12:41:52 PST
Stephen White
Comment 21 2012-12-04 13:35:17 PST
Comment on attachment 177311 [details] Patch OK. r=me
WebKit Review Bot
Comment 22 2012-12-05 13:41:21 PST
Comment on attachment 177311 [details] Patch Clearing flags on attachment: 177311 Committed r136755: <http://trac.webkit.org/changeset/136755>
WebKit Review Bot
Comment 23 2012-12-05 13:41:25 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.