Bug 126056 - Get rid of USE(IOSURFACE_CANVAS_BACKING_STORE)
Summary: Get rid of USE(IOSURFACE_CANVAS_BACKING_STORE)
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-19 23:43 PST by Tim Horton
Modified: 2014-04-05 15:01 PDT (History)
10 users (show)

See Also:


Attachments
patch (23.91 KB, patch)
2013-12-20 00:33 PST, Tim Horton
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2013-12-19 23:43:56 PST
PLATFORM(MAC) should use ENABLE(ACCELERATED_2D_CANVAS) to indicate that it will use an accelerated backing store for Canvas2D, just like all the other platforms.

It should *not* have its own separate and oddly named/placed USE().

I have a patch.
Comment 1 Tim Horton 2013-12-19 23:45:21 PST
<rdar://problem/15705228>
Comment 2 Tim Horton 2013-12-20 00:33:10 PST
Created attachment 219736 [details]
patch

I would like a review specifically from Simon for this one since he was just working in this area today and it's slightly wacky.
Comment 3 Tim Horton 2013-12-20 00:56:36 PST
Comment on attachment 219736 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=219736&action=review

> Source/WebCore/html/HTMLCanvasElement.cpp:375
> +    auto compositingStrategy = canvasCompositingStrategy(*renderer());

This probably needs a USE(ACCELERATED_COMPOSITING) check and a renderer null check of some sort.

Also I wonder if canvasCompositingStrategy should be checking renderBox()->hasAcceleratedCompositing() in the !PLATFORM(MAC) case, because I'm not sure the non-Mac ports can have accelerated canvas if the renderer doesn't have a compositing layer (which Mac can do).
Comment 4 Simon Fraser (smfr) 2013-12-20 09:22:17 PST
Comment on attachment 219736 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=219736&action=review

What about the WebKits prefs?

Please don't land this yet. I need to think about some parts when more awake.

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:1374
> +#if ENABLE(ACCELERATED_2D_CANVAS) && !PLATFORM(MAC) // mac doesn't need this because.... ?

Yeah, tricky. Would have to look at ImageBufferCG(Data) to see what's going on here.
Comment 5 Myles C. Maxfield 2013-12-20 11:25:58 PST
This has repercussions for https://bugs.webkit.org/show_bug.cgi?id=125477 (in-flight) as well
Comment 6 Tim Horton 2013-12-20 12:17:46 PST
(In reply to comment #4)
> (From update of attachment 219736 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219736&action=review
> 
> What about the WebKits prefs?

What do the WebKit prefs have to do with what's compiled in? Anyway, they already have the right name.

> Please don't land this yet. I need to think about some parts when more awake.

Yup.

> > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:1374
> > +#if ENABLE(ACCELERATED_2D_CANVAS) && !PLATFORM(MAC) // mac doesn't need this because.... ?
> 
> Yeah, tricky. Would have to look at ImageBufferCG(Data) to see what's going on here.

Yeah. We'll think about this more.
Comment 7 Tim Horton 2013-12-20 12:18:11 PST
(In reply to comment #5)
> This has repercussions for https://bugs.webkit.org/show_bug.cgi?id=125477 (in-flight) as well

Besides merging repercussions, I don't think so.
Comment 8 Tim Horton 2013-12-20 12:25:01 PST
(In reply to comment #4)
> (From update of attachment 219736 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219736&action=review
> 
> What about the WebKits prefs?

Simon points out canvasUsesAcceleratedDrawing and accelerated2dCanvasEnabled both exist in WebKit1. Since there's no reason historically that anyone would have used accelerated2dCanvasEnabled but canvasUsesAcceleratedDrawing is more likely, we should get rid of accelerated2dCanvasEnabled.

This is somewhat tangential since we choose the right preference in HTMLCanvasElement::shouldAccelerate, in this patch.
Comment 9 Dirk Schulze 2014-04-05 13:57:08 PDT
(In reply to comment #8)
> (In reply to comment #4)
> > (From update of attachment 219736 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=219736&action=review
> > 
> > What about the WebKits prefs?
> 
> Simon points out canvasUsesAcceleratedDrawing and accelerated2dCanvasEnabled both exist in WebKit1. Since there's no reason historically that anyone would have used accelerated2dCanvasEnabled but canvasUsesAcceleratedDrawing is more likely, we should get rid of accelerated2dCanvasEnabled.
> 
> This is somewhat tangential since we choose the right preference in HTMLCanvasElement::shouldAccelerate, in this patch.

Any update on this patch?
Comment 10 Tim Horton 2014-04-05 15:01:11 PDT
(In reply to comment #9)
> Any update on this patch?

No, IIRC it got confusing and I had other things to do :) You're welcome to pick it up but there is a high likelihood of breaking something even with care taken.