Bug 72044 - Add a simple content layer to TiledCoreAnimationDrawingArea
Summary: Add a simple content layer to TiledCoreAnimationDrawingArea
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-10 12:30 PST by Anders Carlsson
Modified: 2011-11-10 13:07 PST (History)
1 user (show)

See Also:


Attachments
Patch (5.96 KB, patch)
2011-11-10 12:37 PST, Anders Carlsson
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2011-11-10 12:30:32 PST
Add a simple content layer to TiledCoreAnimationDrawingArea
Comment 1 Anders Carlsson 2011-11-10 12:37:33 PST
Created attachment 114544 [details]
Patch
Comment 2 Darin Adler 2011-11-10 12:42:28 PST
Comment on attachment 114544 [details]
Patch

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

> Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:47
> +- (id)_initWithWebPage:(WebKit::WebPage *)webPage;

Why the underscore? If the entire class is private, then I’d expect that to be expressed in the class name. Is there some sense in which this is private?

> Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:86
> -    m_rootLayer.get().frame = (CGRect)m_webPage->bounds();
> +    m_rootLayer.get().frame = static_cast<CGRect>(m_webPage->bounds());

Is there a way we can trigger this conversion without a cast? Maybe use a local variable? Back when I worked on Boost I had proposed an implicit_cast, which would do only conversions that could be done with an assignment and no cast at all. A static_cast seems too powerful to me.
Comment 3 Anders Carlsson 2011-11-10 12:56:03 PST
Comment on attachment 114544 [details]
Patch

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

>> Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:47
>> +- (id)_initWithWebPage:(WebKit::WebPage *)webPage;
> 
> Why the underscore? If the entire class is private, then I’d expect that to be expressed in the class name. Is there some sense in which this is private?

It's just a placeholder for the real tiled layer container. I'll remove the underscore.

>> Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:86
>> +    m_rootLayer.get().frame = static_cast<CGRect>(m_webPage->bounds());
> 
> Is there a way we can trigger this conversion without a cast? Maybe use a local variable? Back when I worked on Boost I had proposed an implicit_cast, which would do only conversions that could be done with an assignment and no cast at all. A static_cast seems too powerful to me.

This is actually a workaround for a bug in GCC where you can't set a property to a temporary. I'll use a local variable.
Comment 4 Anders Carlsson 2011-11-10 13:07:19 PST
Committed r99891: <http://trac.webkit.org/changeset/99891>