[webkit-reviews] review granted: [Bug 49388] Share code between Mac (CA) and Windows (CACF) GraphicsLayer implementations : [Attachment 78200] Final Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 6 18:37:50 PST 2011


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Chris Marrin
<cmarrin at apple.com>'s request for review:
Bug 49388: Share code between Mac (CA) and Windows (CACF) GraphicsLayer
implementations
https://bugs.webkit.org/show_bug.cgi?id=49388

Attachment 78200: Final Patch
https://bugs.webkit.org/attachment.cgi?id=78200&action=review

------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
r=me with comments, and questions about the vcproj change.

> WebCore/WebCore.vcproj/WebCore.vcproj:22
>		<Configuration
>			Name="Debug|Win32"
>			ConfigurationType="4"
> -		       
InheritedPropertySheets="$(WebKitVSPropsRedirectionDir)..\..\WebKitLibraries\wi
n\tools\vsprops\FeatureDefines.vsprops;$(WebKitVSPropsRedirectionDir)..\..\WebK
itLibraries\win\tools\vsprops\common.vsprops;$(WebKitVSPropsRedirectionDir)..\.
.\WebKitLibraries\win\tools\vsprops\debug.vsprops;.\WebCoreCommon.vsprops;.\Web
CoreCG.vsprops;.\WebCoreCFNetwork.vsprops;.\WebCorePthreads.vsprops;.\WebCoreMe
diaQT.vsprops;.\WebCoreQuartzCore.vsprops"
> +		       
InheritedPropertySheets="..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines
.vsprops;..\..\WebKitLibraries\win\tools\vsprops\common.vsprops;..\..\WebKitLib
raries\win\tools\vsprops\debug.vsprops;.\WebCoreCommon.vsprops;.\WebCoreCG.vspr
ops;.\WebCoreCFNetwork.vsprops;.\WebCorePthreads.vsprops;.\WebCoreMediaQT.vspro
ps;.\WebCoreQuartzCore.vsprops"
>			CharacterSet="1"

Many of these changes look bad. You might want to hand-edit the project file.

> WebCore/WebCore.vcproj/WebCoreCommon.vsprops:11
> -	       
AdditionalIncludeDirectories="&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..
\accessibility&quot;;&quot;$(ProjectDir)..\accessibility\win&quot;;&quot;$(Proj
ectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)
..\bridge\jsc&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editi
ng&quot;;&quot;$(ProjectDir)..\fileapi&quot;;&quot;$(ProjectDir)..\rendering&qu
ot;;&quot;$(ProjectDir)..\rendering\style&quot;;&quot;$(ProjectDir)..\rendering
\svg&quot;;&quot;$(ProjectDir)..\bindings&quot;;&quot;$(ProjectDir)..\bindings\
generic&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\bin
dings\js\specialization&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDi
r)..\dom\default&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir).
.\html&quot;;&quot;$(ProjectDir)..\html\canvas&quot;;&quot;$(ProjectDir)..\html
\parser&quot;;&quot;$(ProjectDir)..\html\shadow&quot;;&quot;$(ProjectDir)..\ins
pector&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\ap
pcache&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\l
oader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\cache&quot;;&quot;$(Project
Dir)..\loader\icon&quot;;&quot;$(ProjectDir)..\mathml&quot;;&quot;$(ProjectDir)
..\notifications&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\p
age\animation&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\
platform&quot;;&quot;$(ProjectDir)..\platform\animation&quot;;&quot;$(ProjectDi
r)..\platform\mock&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(Proje
ctDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;
$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&qu
ot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platfor
m\graphics\filters&quot;;&quot;$(ProjectDir)..\platform\graphics\opentype&quot;
;&quot;$(ProjectDir)..\platform\graphics\transforms&quot;;&quot;$(ProjectDir)..
\platform\text&quot;;&quot;$(ProjectDir)..\platform\text\transcoder&quot;;&quot
;$(ProjectDir)..\platform\graphics\win&quot;;&quot;$(ProjectDir)..\xml&quot;;&q
uot;$(ConfigurationBuildDir)\obj\WebCore\DerivedSources&quot;;&quot;$(ProjectDi
r)..\plugins&quot;;&quot;$(ProjectDir)..\plugins\win&quot;;&quot;$(ProjectDir).
.\svg\animation&quot;;&quot;$(ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectD
ir)..\svg\properties&quot;;&quot;$(ProjectDir)..\svg\graphics\filters&quot;;&qu
ot;$(ProjectDir)..\svg&quot;;&quot;$(ProjectDir)..\wml&quot;;&quot;$(ProjectDir
)..\storage&quot;;&quot;$(ProjectDir)..\websockets&quot;;&quot;$(ProjectDir)..\
workers&quot;;&quot;$(ConfigurationBuildDir)\include&quot;;&quot;$(Configuratio
nBuildDir)\include\private&quot;;&quot;$(ConfigurationBuildDir)\include\JavaScr
iptCore&quot;;&quot;$(ConfigurationBuildDir)\include\private\JavaScriptCore&quo
t;;&quot;$(ProjectDir)..\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\in
clude&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;;&quot;$(WebKitLib
rariesDir)\include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\inc
lude\pthreads&quot;;&quot;$(WebKitLibrariesDir)\include\sqlite&quot;;&quot;$(We
bKitLibrariesDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\incl
ude\zlib&quot;"
> +	       
AdditionalIncludeDirectories="&quot;$(ProjectDir)..&quot;;&quot;$(ProjectDir)..
\accessibility&quot;;&quot;$(ProjectDir)..\accessibility\win&quot;;&quot;$(Proj
ectDir)..\bridge&quot;;&quot;$(ProjectDir)..\bridge\c&quot;;&quot;$(ProjectDir)
..\bridge\jsc&quot;;&quot;$(ProjectDir)..\css&quot;;&quot;$(ProjectDir)..\editi
ng&quot;;&quot;$(ProjectDir)..\fileapi&quot;;&quot;$(ProjectDir)..\rendering&qu
ot;;&quot;$(ProjectDir)..\rendering\style&quot;;&quot;$(ProjectDir)..\rendering
\svg&quot;;&quot;$(ProjectDir)..\bindings&quot;;&quot;$(ProjectDir)..\bindings\
generic&quot;;&quot;$(ProjectDir)..\bindings\js&quot;;&quot;$(ProjectDir)..\bin
dings\js\specialization&quot;;&quot;$(ProjectDir)..\dom&quot;;&quot;$(ProjectDi
r)..\dom\default&quot;;&quot;$(ProjectDir)..\history&quot;;&quot;$(ProjectDir).
.\html&quot;;&quot;$(ProjectDir)..\html\canvas&quot;;&quot;$(ProjectDir)..\html
\parser&quot;;&quot;$(ProjectDir)..\html\shadow&quot;;&quot;$(ProjectDir)..\ins
pector&quot;;&quot;$(ProjectDir)..\loader&quot;;&quot;$(ProjectDir)..\loader\ap
pcache&quot;;&quot;$(ProjectDir)..\loader\archive&quot;;&quot;$(ProjectDir)..\l
oader\archive\cf&quot;;&quot;$(ProjectDir)..\loader\cache&quot;;&quot;$(Project
Dir)..\loader\icon&quot;;&quot;$(ProjectDir)..\mathml&quot;;&quot;$(ProjectDir)
..\notifications&quot;;&quot;$(ProjectDir)..\page&quot;;&quot;$(ProjectDir)..\p
age\animation&quot;;&quot;$(ProjectDir)..\page\win&quot;;&quot;$(ProjectDir)..\
platform&quot;;&quot;$(ProjectDir)..\platform\animation&quot;;&quot;$(ProjectDi
r)..\platform\mock&quot;;&quot;$(ProjectDir)..\platform\sql&quot;;&quot;$(Proje
ctDir)..\platform\win&quot;;&quot;$(ProjectDir)..\platform\network&quot;;&quot;
$(ProjectDir)..\platform\network\win&quot;;&quot;$(ProjectDir)..\platform\cf&qu
ot;;&quot;$(ProjectDir)..\platform\graphics&quot;;&quot;$(ProjectDir)..\platfor
m\graphics\ca&quot;;&quot;$(ProjectDir)..\platform\graphics\filters&quot;;&quot
;$(ProjectDir)..\platform\graphics\opentype&quot;;&quot;$(ProjectDir)..\platfor
m\graphics\transforms&quot;;&quot;$(ProjectDir)..\platform\text&quot;;&quot;$(P
rojectDir)..\platform\text\transcoder&quot;;&quot;$(ProjectDir)..\platform\grap
hics\win&quot;;&quot;$(ProjectDir)..\xml&quot;;&quot;$(ConfigurationBuildDir)\o
bj\WebCore\DerivedSources&quot;;&quot;$(ProjectDir)..\plugins&quot;;&quot;$(Pro
jectDir)..\plugins\win&quot;;&quot;$(ProjectDir)..\svg\animation&quot;;&quot;$(
ProjectDir)..\svg\graphics&quot;;&quot;$(ProjectDir)..\svg\properties&quot;;&qu
ot;$(ProjectDir)..\svg\graphics\filters&quot;;&quot;$(ProjectDir)..\svg&quot;;&
quot;$(ProjectDir)..\wml&quot;;&quot;$(ProjectDir)..\storage&quot;;&quot;$(Proj
ectDir)..\websockets&quot;;&quot;$(ProjectDir)..\workers&quot;;&quot;$(Configur
ationBuildDir)\include&quot;;&quot;$(ConfigurationBuildDir)\include\private&quo
t;;&quot;$(ConfigurationBuildDir)\include\JavaScriptCore&quot;;&quot;$(Configur
ationBuildDir)\include\private\JavaScriptCore&quot;;&quot;$(ProjectDir)..\Forwa
rdingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibr
ariesDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include\private\Jav
aScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(We
bKitLibrariesDir)\include\sqlite&quot;;&quot;$(WebKitLibrariesDir)\include\Java
ScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\zlib&quot;"
>	       
PreprocessorDefinitions="__WIN32__;DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS"

Do you really want this change?

> WebCore/html/canvas/CanvasRenderingContext.h:63
> -    virtual PlatformLayer* platformLayer() const { return 0; }
> +//	 virtual PlatformLayer* platformLayer() const { return 0; }

No commenting out please!

> WebCore/platform/graphics/ca/PlatformCAAnimation.h:47
> +typedef struct _CACFAnimation *CACFAnimationRef;

The * should be on the other side here.

> WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp:2
> + * Copyright (C) 2010 Apple Inc. All rights reserved.

2011!

> WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp:153
> +static void initialize(PlatformCAAnimation* animation)
> +{
> +}

Unused?

> WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp:188
> +    RetainPtr<CFStringRef> s(AdoptCF,
animation->keyPath().createCFString());
> +    CACFAnimationSetKeyPath(m_animation.get(), s.get());

Please rename 's' to keyPath or similar.

> WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp:220
> +bool PlatformCAAnimation::supportsValueFunction()
> +{
> +    return true;
> +}

Method should be const, could be inline.

> WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp:300
> +    RetainPtr<CFStringRef> s(AdoptCF,
toCACFFillModeType(value).createCFString());
> +    CACFAnimationSetFillMode(m_animation.get(), s.get());

Please rename 's'.

> WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp:341
> +    RetainPtr<CFStringRef> s(AdoptCF,
toCACFValueFunctionType(value).createCFString());
> +    CACFAnimationSetValueFunction(m_animation.get(),
CACFValueFunctionGetFunctionWithName(s.get()));

ditto

> WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp:2
> + * Copyright (C) 2010 Apple Inc. All rights reserved.

2011!

> WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp:47
> +bool PlatformCALayer::isValueFunctionSupported()
> +{
> +    return true;
> +}

Should be const and inline.

> WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp:303
> +PassRefPtr<PlatformCAAnimation> PlatformCALayer::animationForKey(const
String& key)

Method should be const.

> WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp:460
> +    return const_cast<void*>(CACFLayerGetContents(m_layer.get()));

Is that the right cast?

> WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:2
> + * Copyright (C) 2010 Apple Inc. All rights reserved.

2011!

> WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:63
> +    if (!owner() || !owner()->owner())

owner()->owner() is weird.

> WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h:2
> + * Copyright (C) 2010 Apple Inc. All rights reserved.

2011

> WebCore/platform/graphics/win/GraphicsContextCGWin.cpp:48
> +    if (info.bmBitsPixel != 32)
> +	   return 0;

Why this change?

>
WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:104
> +    virtual void platformCALayerLayoutSublayersOfLayer(PlatformCALayer*);
> +    virtual bool platformCALayerRespondsToLayoutChanges() const { return
true; }
> +
> +    virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) {
}
> +    virtual GraphicsLayer::CompositingCoordinatesOrientation
platformCALayerContentsOrientation() const { return
GraphicsLayer::CompositingCoordinatesBottomUp; }
> +    virtual void platformCALayerPaintContents(GraphicsContext&, const
IntRect& inClip) { }
> +    virtual bool platformCALayerShowDebugBorders() const { return false; }
> +    virtual bool platformCALayerShowRepaintCounter() const { return false; }

> +    virtual int platformCALayerIncrementRepaintCount() { return 0; }
> +
> +    virtual bool platformCALayerContentsOpaque() const { return false; }
> +    virtual bool platformCALayerDrawsContent() const { return false; }
> +    virtual void platformCALayerLayerDidDisplay(PlatformLayer*) { }

Make these private if possible.

> WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp:481
> +    if (!wkCACFContextBeginUpdate(m_context, space, sizeof(space),
CACurrentMediaTime(), bounds, windowDirtyRects.data(),
windowDirtyRects.size()))

Share the same CACurrentMediaTime you used above?

> WebKit/win/FullscreenVideoController.cpp:193
> +    virtual void platformCALayerLayoutSublayersOfLayer(PlatformCALayer*);
> +    virtual bool platformCALayerRespondsToLayoutChanges() const { return
true; }
> +
> +    virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) {
}
> +    virtual GraphicsLayer::CompositingCoordinatesOrientation
platformCALayerContentsOrientation() const { return
GraphicsLayer::CompositingCoordinatesBottomUp; }
> +    virtual void platformCALayerPaintContents(GraphicsContext&, const
IntRect& inClip) { }
> +    virtual bool platformCALayerShowDebugBorders() const { return false; }
> +    virtual bool platformCALayerShowRepaintCounter() const { return false; }

> +    virtual int platformCALayerIncrementRepaintCount() { return 0; }
> +
> +    virtual bool platformCALayerContentsOpaque() const { return false; }
> +    virtual bool platformCALayerDrawsContent() const { return false; }
> +    virtual void platformCALayerLayerDidDisplay(PlatformLayer*) { }

Make private?


More information about the webkit-reviews mailing list