Changeset 166542 in webkit
- Timestamp:
- Mar 31, 2014 4:15:58 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 added
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166537 r166542 1 2014-03-31 Simon Fraser <simon.fraser@apple.com> 2 3 [UI-side compositing] Proxy animations to the UI process 4 https://bugs.webkit.org/show_bug.cgi?id=130946 5 6 Reviewed by Tim Horton. 7 8 To proxy CA animations, make PlatformCAAnimation a pure virtual base class 9 and subclass for Mac, Windows, and Remote (just like PlatformCALayer). 10 11 Add coding support for TimingFunctions. 12 13 Do some minor #include tidyup. 14 15 Minor refactor in GraphicsLayerCA to share some animations code. 16 17 * WebCore.exp.in: 18 * WebCore.xcodeproj/project.pbxproj: 19 * platform/animation/TimingFunction.h: Add setters need for encode/decode. 20 (WebCore::CubicBezierTimingFunction::setValues): 21 (WebCore::CubicBezierTimingFunction::setTimingFunctionPreset): 22 (WebCore::StepsTimingFunction::create): 23 (WebCore::StepsTimingFunction::setNumberOfSteps): 24 (WebCore::StepsTimingFunction::setStepAtStart): 25 * platform/graphics/ca/GraphicsLayerCA.cpp: 26 (WebCore::GraphicsLayerCA::createPlatformCAAnimation): 27 (WebCore::GraphicsLayerCA::animationCanBeAccelerated): Minor refactor so we can share 28 code with GraphicsLayerCARemote. 29 (WebCore::GraphicsLayerCA::addAnimation): 30 (WebCore::GraphicsLayerCA::createBasicAnimation): 31 (WebCore::PassRefPtr<PlatformCAAnimation>GraphicsLayerCA::createKeyframeAnimation): 32 * platform/graphics/ca/GraphicsLayerCA.h: 33 * platform/graphics/ca/PlatformCAAnimation.h: 34 (WebCore::PlatformCAAnimation::~PlatformCAAnimation): 35 (WebCore::PlatformCAAnimation::isPlatformCAAnimationMac): 36 (WebCore::PlatformCAAnimation::isPlatformCAAnimationWin): 37 (WebCore::PlatformCAAnimation::isPlatformCAAnimationRemote): 38 (WebCore::PlatformCAAnimation::PlatformCAAnimation): 39 (WebCore::PlatformCAAnimation::setType): 40 * platform/graphics/ca/PlatformCALayer.h: 41 * platform/graphics/ca/mac/PlatformCAAnimationMac.h: Added. 42 * platform/graphics/ca/mac/PlatformCAAnimationMac.mm: 43 * platform/graphics/ca/mac/PlatformCALayerMac.mm: 44 (PlatformCALayerMac::addAnimationForKey): 45 (PlatformCALayerMac::animationForKey): 46 * platform/graphics/ca/mac/TileController.mm: 47 * platform/graphics/ca/win/PlatformCAAnimationWin.cpp: 48 * platform/graphics/ca/win/PlatformCAAnimationWin.h: Added. 49 1 50 2014-03-31 Benjamin Poulain <benjamin@webkit.org> 2 51 -
trunk/Source/WebCore/WebCore.exp.in
r166531 r166542 718 718 __ZN7WebCore16startOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE 719 719 __ZN7WebCore16threadGlobalDataEv 720 __ZN7WebCore16toCAFillModeTypeENS_19PlatformCAAnimation12FillModeTypeE 720 721 __ZN7WebCore17CredentialStorage24getFromPersistentStorageERKNS_15ProtectionSpaceE 721 722 __ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE … … 793 794 __ZN7WebCore19MediaSessionManager30didReceiveRemoteControlCommandENS_12MediaSession24RemoteControlCommandTypeE 794 795 __ZN7WebCore19MediaSessionManager9addClientEPNS_25MediaSessionManagerClientE 795 __ZN7WebCore19PlatformCAAnimation10setToValueERKNS_20TransformationMatrixE796 __ZN7WebCore19PlatformCAAnimation6createEP19CAPropertyAnimation797 __ZN7WebCore19PlatformCAAnimationD1Ev798 796 __ZN7WebCore19ResourceRequestBase11setHTTPBodyEN3WTF10PassRefPtrINS_8FormDataEEE 799 797 __ZN7WebCore19ResourceRequestBase13setHTTPMethodERKN3WTF6StringE … … 902 900 __ZN7WebCore21setGlobalIconDatabaseEPNS_16IconDatabaseBaseE 903 901 __ZN7WebCore21setPlatformStrategiesEPNS_18PlatformStrategiesE 902 __ZN7WebCore21toCAValueFunctionTypeENS_19PlatformCAAnimation17ValueFunctionTypeE 904 903 __ZN7WebCore22HTMLPlugInImageElement24restartSnapshottedPlugInEv 905 904 __ZN7WebCore22HTMLPlugInImageElement29setIsPrimarySnapshottedPlugInEb 906 905 __ZN7WebCore22MutableStyleProperties25ensureCSSStyleDeclarationEv 907 906 __ZN7WebCore22MutableStylePropertiesD1Ev 907 __ZN7WebCore22PlatformCAAnimationMac6createEP19CAPropertyAnimation 908 908 __ZN7WebCore22RuntimeEnabledFeatures14sharedFeaturesEv 909 909 __ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv … … 941 941 __ZN7WebCore23getFileModificationTimeERKN3WTF6StringERl 942 942 __ZN7WebCore23getHostnamesWithCookiesERKNS_21NetworkStorageSessionERN3WTF7HashSetINS3_6StringENS3_10StringHashENS3_10HashTraitsIS5_EEEE 943 __ZN7WebCore23toCAMediaTimingFunctionEPKNS_14TimingFunctionEb 943 944 __ZN7WebCore24CachedResourceHandleBase11setResourceEPNS_14CachedResourceE 944 945 __ZN7WebCore24DocumentMarkerController10markersForEPNS_4NodeENS_14DocumentMarker11MarkerTypesE … … 1645 1646 __ZNK7WebCore15GraphicsLayerCA21canThrottleLayerFlushEv 1646 1647 __ZNK7WebCore15GraphicsLayerCA24dumpAdditionalPropertiesERNS_10TextStreamEij 1648 __ZNK7WebCore15GraphicsLayerCA25animationCanBeAcceleratedERKNS_17KeyframeValueListEPKNS_9AnimationE 1647 1649 __ZNK7WebCore15GraphicsLayerCA25shouldRepaintOnSizeChangeEv 1648 1650 __ZNK7WebCore15GraphicsLayerCA26backingStoreMemoryEstimateEv -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r166506 r166542 19153 19153 <ClInclude Include="..\platform\graphics\cairo\TileCairo.h" /> 19154 19154 <ClInclude Include="..\platform\graphics\ca\PlatformCAFilters.h" /> 19155 <ClInclude Include="..\platform\graphics\ca\win\PlatformCAAnimationWin.h" /> 19155 19156 <ClInclude Include="..\platform\graphics\ca\win\PlatformCALayerWin.h" /> 19156 19157 <ClInclude Include="..\platform\graphics\GLContext.h" /> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r166529 r166542 505 505 0F5B7A5410F65D7A00376302 /* RenderEmbeddedObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */; }; 506 506 0F5B7A5510F65D7A00376302 /* RenderEmbeddedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; 507 0F5E200618E771FC003EC3E5 /* PlatformCAAnimationMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E200518E771FC003EC3E5 /* PlatformCAAnimationMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; 507 508 0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F605AEA15F94848004DF0C0 /* ScrollingConstraints.cpp */; }; 508 509 0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 7326 7327 0F5B7A5210F65D7A00376302 /* RenderEmbeddedObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderEmbeddedObject.cpp; sourceTree = "<group>"; }; 7327 7328 0F5B7A5310F65D7A00376302 /* RenderEmbeddedObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderEmbeddedObject.h; sourceTree = "<group>"; }; 7329 0F5E200518E771FC003EC3E5 /* PlatformCAAnimationMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformCAAnimationMac.h; path = ca/mac/PlatformCAAnimationMac.h; sourceTree = "<group>"; }; 7328 7330 0F605AEA15F94848004DF0C0 /* ScrollingConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingConstraints.cpp; sourceTree = "<group>"; }; 7329 7331 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingConstraints.h; sourceTree = "<group>"; }; … … 15596 15598 93F72AF11666EDFC002A02BD /* LayerPool.h */, 15597 15599 93F72AF21666EDFC002A02BD /* LayerPool.mm */, 15600 0F5E200518E771FC003EC3E5 /* PlatformCAAnimationMac.h */, 15598 15601 4958781F12A57DDF007238AC /* PlatformCAAnimationMac.mm */, 15599 15602 D66B2D5B186830050073C4DD /* PlatformCAFiltersMac.h */, … … 24387 24390 BC4918C90BFEA050009D6316 /* JSHTMLIFrameElement.h in Headers */, 24388 24391 1AE2AA980A1CDD2D00B42B25 /* JSHTMLImageElement.h in Headers */, 24392 0F5E200618E771FC003EC3E5 /* PlatformCAAnimationMac.h in Headers */, 24389 24393 A80E7E970A1A83E3007FB8C5 /* JSHTMLInputElement.h in Headers */, 24390 24394 E1AD14231295EA7F00ACA989 /* JSHTMLInputElementCustom.h in Headers */, -
trunk/Source/WebCore/platform/animation/TimingFunction.h
r162139 r166542 33 33 public: 34 34 35 virtual PassRefPtr<TimingFunction> clone() const = 0; 36 35 37 enum TimingFunctionType { 36 38 LinearFunction, CubicBezierFunction, StepsFunction … … 69 71 return other.isLinearTimingFunction(); 70 72 } 71 73 72 74 private: 73 75 LinearTimingFunction() … … 75 77 { 76 78 } 77 }; 78 79 80 virtual PassRefPtr<TimingFunction> clone() const override 81 { 82 return adoptRef(new LinearTimingFunction); 83 } 84 }; 85 79 86 class CubicBezierTimingFunction : public TimingFunction { 80 87 public: … … 133 140 double y2() const { return m_y2; } 134 141 142 void setValues(double x1, double y1, double x2, double y2) 143 { 144 m_x1 = x1; 145 m_y1 = y1; 146 m_x2 = x2; 147 m_y2 = y2; 148 } 149 135 150 TimingFunctionPreset timingFunctionPreset() const { return m_timingFunctionPreset; } 151 void setTimingFunctionPreset(TimingFunctionPreset preset) { m_timingFunctionPreset = preset; } 136 152 137 153 static const CubicBezierTimingFunction* defaultTimingFunction() … … 157 173 } 158 174 175 virtual PassRefPtr<TimingFunction> clone() const override 176 { 177 return adoptRef(new CubicBezierTimingFunction(m_timingFunctionPreset, m_x1, m_y1, m_x2, m_y2)); 178 } 179 159 180 double m_x1; 160 181 double m_y1; … … 166 187 class StepsTimingFunction : public TimingFunction { 167 188 public: 189 168 190 static PassRefPtr<StepsTimingFunction> create(int steps, bool stepAtStart) 169 191 { 170 192 return adoptRef(new StepsTimingFunction(steps, stepAtStart)); 193 } 194 static PassRefPtr<StepsTimingFunction> create() 195 { 196 return adoptRef(new StepsTimingFunction(1, true)); 171 197 } 172 198 … … 183 209 184 210 int numberOfSteps() const { return m_steps; } 211 void setNumberOfSteps(int steps) { m_steps = steps; } 212 185 213 bool stepAtStart() const { return m_stepAtStart; } 214 void setStepAtStart(bool stepAtStart) { m_stepAtStart = stepAtStart; } 186 215 187 216 private: … … 192 221 { 193 222 } 223 224 virtual PassRefPtr<TimingFunction> clone() const override 225 { 226 return adoptRef(new StepsTimingFunction(m_steps, m_stepAtStart)); 227 } 194 228 195 229 int m_steps; 196 230 bool m_stepAtStart; 197 231 }; 198 232 199 233 } // namespace WebCore 200 234 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r166516 r166542 32 32 #include "FloatRect.h" 33 33 #include "GraphicsLayerFactory.h" 34 #include "Image.h" 34 35 #include "PlatformCAFilters.h" 35 36 #include "PlatformCALayer.h" … … 52 53 53 54 #if PLATFORM(COCOA) 55 #include "PlatformCAAnimationMac.h" 54 56 #include "PlatformCALayerMac.h" 55 57 #include "WebCoreSystemInterface.h" … … 57 59 58 60 #if PLATFORM(WIN) 61 #include "PlatformCAAnimationWin.h" 59 62 #include "PlatformCALayerWin.h" 60 63 #endif … … 342 345 } 343 346 347 PassRefPtr<PlatformCAAnimation> GraphicsLayerCA::createPlatformCAAnimation(PlatformCAAnimation::AnimationType type, const String& keyPath) 348 { 349 #if PLATFORM(COCOA) 350 return PlatformCAAnimationMac::create(type, keyPath); 351 #elif PLATFORM(WIN) 352 return PlatformCAAnimationWin::create(type, keyPath); 353 #endif 354 } 355 344 356 GraphicsLayerCA::GraphicsLayerCA(GraphicsLayerClient* client) 345 357 : GraphicsLayer(client) … … 788 800 } 789 801 790 bool GraphicsLayerCA::addAnimation(const KeyframeValueList& valueList, const FloatSize& boxSize, const Animation* anim, const String& animationName, double timeOffset) 791 { 792 ASSERT(!animationName.isEmpty()); 793 802 bool GraphicsLayerCA::animationCanBeAccelerated(const KeyframeValueList& valueList, const Animation* anim) const 803 { 794 804 if (!anim || anim->isEmptyOrZeroDuration() || valueList.size() < 2) 795 805 return false; 796 806 797 // CoreAnimation does not handle the steps() timing function. Fall back798 // to software animation in that case.799 807 if (animationHasStepsTimingFunction(valueList, anim)) 808 return false; 809 810 return true; 811 } 812 813 bool GraphicsLayerCA::addAnimation(const KeyframeValueList& valueList, const FloatSize& boxSize, const Animation* anim, const String& animationName, double timeOffset) 814 { 815 ASSERT(!animationName.isEmpty()); 816 817 if (!animationCanBeAccelerated(valueList, anim)) 800 818 return false; 801 819 … … 2577 2595 PassRefPtr<PlatformCAAnimation> GraphicsLayerCA::createBasicAnimation(const Animation* anim, const String& keyPath, bool additive) 2578 2596 { 2579 RefPtr<PlatformCAAnimation> basicAnim = PlatformCAAnimation::create(PlatformCAAnimation::Basic, keyPath);2597 RefPtr<PlatformCAAnimation> basicAnim = createPlatformCAAnimation(PlatformCAAnimation::Basic, keyPath); 2580 2598 setupAnimation(basicAnim.get(), anim, additive); 2581 2599 return basicAnim; … … 2584 2602 PassRefPtr<PlatformCAAnimation>GraphicsLayerCA::createKeyframeAnimation(const Animation* anim, const String& keyPath, bool additive) 2585 2603 { 2586 RefPtr<PlatformCAAnimation> keyframeAnim = PlatformCAAnimation::create(PlatformCAAnimation::Keyframe, keyPath);2604 RefPtr<PlatformCAAnimation> keyframeAnim = createPlatformCAAnimation(PlatformCAAnimation::Keyframe, keyPath); 2587 2605 setupAnimation(keyframeAnim.get(), anim, additive); 2588 2606 return keyframeAnim; -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r166516 r166542 28 28 29 29 #include "GraphicsLayer.h" 30 #include "Image.h"31 30 #include "PlatformCAAnimation.h" 32 31 #include "PlatformCALayer.h" … … 43 42 namespace WebCore { 44 43 44 class Image; 45 45 class TransformState; 46 46 … … 171 171 protected: 172 172 virtual void setOpacityInternal(float); 173 174 bool animationCanBeAccelerated(const KeyframeValueList&, const Animation*) const; 173 175 174 176 private: … … 215 217 virtual PassRefPtr<PlatformCALayer> createPlatformCALayer(PlatformCALayer::LayerType, PlatformCALayerClient* owner); 216 218 virtual PassRefPtr<PlatformCALayer> createPlatformCALayer(PlatformLayer*, PlatformCALayerClient* owner); 219 virtual PassRefPtr<PlatformCAAnimation> createPlatformCAAnimation(PlatformCAAnimation::AnimationType, const String& keyPath); 217 220 218 221 PlatformCALayer* primaryLayer() const { return m_structuralLayer.get() ? m_structuralLayer.get() : m_layer.get(); } -
trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h
r165676 r166542 32 32 #include "TransformationMatrix.h" 33 33 #include <wtf/RefCounted.h> 34 #include <wtf/RetainPtr.h>35 34 #include <wtf/Vector.h> 36 37 #if PLATFORM(COCOA)38 OBJC_CLASS CAPropertyAnimation;39 typedef CAPropertyAnimation* PlatformAnimationRef;40 #elif PLATFORM(WIN)41 typedef struct _CACFAnimation* CACFAnimationRef;42 typedef CACFAnimationRef PlatformAnimationRef;43 #endif44 35 45 36 namespace WebCore { 46 37 47 38 class FloatRect; 48 class PlatformCAAnimation;49 39 class TimingFunction; 50 40 51 41 class PlatformCAAnimation : public RefCounted<PlatformCAAnimation> { 52 42 public: 53 friend class PlatformCALayer;54 #if PLATFORM(COCOA)55 friend class PlatformCALayerMac;56 #elif PLATFORM(WIN)57 friend class PlatformCALayerWin;58 #endif59 60 43 enum AnimationType { Basic, Keyframe }; 61 44 enum FillModeType { NoFillMode, Forwards, Backwards, Both }; 62 45 enum ValueFunctionType { NoValueFunction, RotateX, RotateY, RotateZ, ScaleX, ScaleY, ScaleZ, Scale, TranslateX, TranslateY, TranslateZ, Translate }; 63 46 64 static PassRefPtr<PlatformCAAnimation> create(AnimationType, const String& keyPath); 65 static PassRefPtr<PlatformCAAnimation> create(PlatformAnimationRef); 47 virtual ~PlatformCAAnimation() { } 66 48 67 ~PlatformCAAnimation(); 49 virtual bool isPlatformCAAnimationMac() const { return false; } 50 virtual bool isPlatformCAAnimationWin() const { return false; } 51 virtual bool isPlatformCAAnimationRemote() const { return false; } 68 52 69 PassRefPtr<PlatformCAAnimation> copy() const; 70 71 PlatformAnimationRef platformAnimation() const; 53 virtual PassRefPtr<PlatformCAAnimation> copy() const = 0; 72 54 73 55 AnimationType animationType() const { return m_type; } 74 String keyPath() const;56 virtual String keyPath() const = 0; 75 57 76 CFTimeInterval beginTime() const;77 v oid setBeginTime(CFTimeInterval);58 virtual CFTimeInterval beginTime() const = 0; 59 virtual void setBeginTime(CFTimeInterval) = 0; 78 60 79 CFTimeInterval duration() const;80 v oid setDuration(CFTimeInterval);61 virtual CFTimeInterval duration() const = 0; 62 virtual void setDuration(CFTimeInterval) = 0; 81 63 82 float speed() const;83 v oid setSpeed(float);64 virtual float speed() const = 0; 65 virtual void setSpeed(float) = 0; 84 66 85 CFTimeInterval timeOffset() const;86 v oid setTimeOffset(CFTimeInterval);67 virtual CFTimeInterval timeOffset() const = 0; 68 virtual void setTimeOffset(CFTimeInterval) = 0; 87 69 88 float repeatCount() const;89 v oid setRepeatCount(float);70 virtual float repeatCount() const = 0; 71 virtual void setRepeatCount(float) = 0; 90 72 91 bool autoreverses() const;92 v oid setAutoreverses(bool);73 virtual bool autoreverses() const = 0; 74 virtual void setAutoreverses(bool) = 0; 93 75 94 FillModeType fillMode() const;95 v oid setFillMode(FillModeType);76 virtual FillModeType fillMode() const = 0; 77 virtual void setFillMode(FillModeType) = 0; 96 78 97 v oid setTimingFunction(const TimingFunction*, bool reverse = false);98 v oid copyTimingFunctionFrom(const PlatformCAAnimation*);79 virtual void setTimingFunction(const TimingFunction*, bool reverse = false) = 0; 80 virtual void copyTimingFunctionFrom(const PlatformCAAnimation*) = 0; 99 81 100 bool isRemovedOnCompletion() const;101 v oid setRemovedOnCompletion(bool);82 virtual bool isRemovedOnCompletion() const = 0; 83 virtual void setRemovedOnCompletion(bool) = 0; 102 84 103 bool isAdditive() const;104 v oid setAdditive(bool);85 virtual bool isAdditive() const = 0; 86 virtual void setAdditive(bool) = 0; 105 87 106 ValueFunctionType valueFunction() const;107 v oid setValueFunction(ValueFunctionType);88 virtual ValueFunctionType valueFunction() const = 0; 89 virtual void setValueFunction(ValueFunctionType) = 0; 108 90 109 91 // Basic-animation properties. 110 v oid setFromValue(float);111 v oid setFromValue(const WebCore::TransformationMatrix&);112 v oid setFromValue(const FloatPoint3D&);113 v oid setFromValue(const WebCore::Color&);92 virtual void setFromValue(float) = 0; 93 virtual void setFromValue(const WebCore::TransformationMatrix&) = 0; 94 virtual void setFromValue(const FloatPoint3D&) = 0; 95 virtual void setFromValue(const WebCore::Color&) = 0; 114 96 #if ENABLE(CSS_FILTERS) 115 v oid setFromValue(const FilterOperation*, int internalFilterPropertyIndex);97 virtual void setFromValue(const FilterOperation*, int internalFilterPropertyIndex) = 0; 116 98 #endif 117 v oid copyFromValueFrom(const PlatformCAAnimation*);99 virtual void copyFromValueFrom(const PlatformCAAnimation*) = 0; 118 100 119 v oid setToValue(float);120 v oid setToValue(const WebCore::TransformationMatrix&);121 v oid setToValue(const FloatPoint3D&);122 v oid setToValue(const WebCore::Color&);101 virtual void setToValue(float) = 0; 102 virtual void setToValue(const WebCore::TransformationMatrix&) = 0; 103 virtual void setToValue(const FloatPoint3D&) = 0; 104 virtual void setToValue(const WebCore::Color&) = 0; 123 105 #if ENABLE(CSS_FILTERS) 124 v oid setToValue(const FilterOperation*, int internalFilterPropertyIndex);106 virtual void setToValue(const FilterOperation*, int internalFilterPropertyIndex) = 0; 125 107 #endif 126 v oid copyToValueFrom(const PlatformCAAnimation*);108 virtual void copyToValueFrom(const PlatformCAAnimation*) = 0; 127 109 128 110 // Keyframe-animation properties. 129 v oid setValues(const Vector<float>&);130 v oid setValues(const Vector<WebCore::TransformationMatrix>&);131 v oid setValues(const Vector<FloatPoint3D>&);132 v oid setValues(const Vector<WebCore::Color>&);111 virtual void setValues(const Vector<float>&) = 0; 112 virtual void setValues(const Vector<WebCore::TransformationMatrix>&) = 0; 113 virtual void setValues(const Vector<FloatPoint3D>&) = 0; 114 virtual void setValues(const Vector<WebCore::Color>&) = 0; 133 115 #if ENABLE(CSS_FILTERS) 134 v oid setValues(const Vector<RefPtr<FilterOperation>>&, int internalFilterPropertyIndex);116 virtual void setValues(const Vector<RefPtr<FilterOperation>>&, int internalFilterPropertyIndex) = 0; 135 117 #endif 136 v oid copyValuesFrom(const PlatformCAAnimation*);118 virtual void copyValuesFrom(const PlatformCAAnimation*) = 0; 137 119 138 v oid setKeyTimes(const Vector<float>&);139 v oid copyKeyTimesFrom(const PlatformCAAnimation*);120 virtual void setKeyTimes(const Vector<float>&) = 0; 121 virtual void copyKeyTimesFrom(const PlatformCAAnimation*) = 0; 140 122 141 void setTimingFunctions(const Vector<const TimingFunction*>&, bool reverse = false); 142 void copyTimingFunctionsFrom(const PlatformCAAnimation*); 143 144 protected: 145 PlatformCAAnimation(AnimationType, const String& keyPath); 146 PlatformCAAnimation(PlatformAnimationRef); 123 virtual void setTimingFunctions(const Vector<const TimingFunction*>&, bool reverse = false) = 0; 124 virtual void copyTimingFunctionsFrom(const PlatformCAAnimation*) = 0; 147 125 148 126 void setActualStartTimeIfNeeded(CFTimeInterval t) … … 151 129 setBeginTime(t); 152 130 } 131 132 protected: 133 PlatformCAAnimation(AnimationType type = Basic) 134 : m_type(type) 135 { 136 } 137 138 void setType(AnimationType type) { m_type = type; } 153 139 154 140 private: 155 141 AnimationType m_type; 156 157 #if PLATFORM(COCOA)158 RetainPtr<CAPropertyAnimation> m_animation;159 #elif PLATFORM(WIN)160 RetainPtr<CACFAnimationRef> m_animation;161 #endif162 142 }; 143 144 #define PLATFORM_CAANIMATION_TYPE_CASTS(ToValueTypeName, predicate) \ 145 TYPE_CASTS_BASE(ToValueTypeName, WebCore::PlatformCAAnimation, object, object->predicate, object.predicate) 163 146 164 147 } -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r166308 r166542 27 27 #define PlatformCALayer_h 28 28 29 #include "GraphicsContext.h"30 29 #include "GraphicsLayer.h" 31 #include "PlatformCAAnimation.h"32 30 #include "PlatformCALayerClient.h" 33 31 #include <QuartzCore/CABase.h> … … 43 41 OBJC_CLASS AVPlayerLayer; 44 42 43 #if PLATFORM(COCOA) 44 typedef struct CGContext *CGContextRef; 45 #endif 46 45 47 namespace WebCore { 46 48 47 49 class PlatformCALayer; 50 class PlatformCAAnimation; 48 51 49 52 typedef Vector<RefPtr<PlatformCALayer>> PlatformCALayerList; -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm
r165676 r166542 1 1 /* 2 * Copyright (C) 201 0Apple Inc. All rights reserved.2 * Copyright (C) 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #include "config.h" 27 27 28 #import "PlatformCAAnimation .h"28 #import "PlatformCAAnimationMac.h" 29 29 30 30 #import "FloatConversion.h" … … 41 41 static bool hasNonZeroBeginTimeFlag(const PlatformCAAnimation* animation) 42 42 { 43 return [[ animation->platformAnimation() valueForKey:WKNonZeroBeginTimeFlag] boolValue];43 return [[toPlatformCAAnimationMac(animation)->platformAnimation() valueForKey:WKNonZeroBeginTimeFlag] boolValue]; 44 44 } 45 45 46 46 static void setNonZeroBeginTimeFlag(PlatformCAAnimation* animation, bool value) 47 47 { 48 [ animation->platformAnimation() setValue:[NSNumber numberWithBool:value] forKey:WKNonZeroBeginTimeFlag];49 } 50 51 static NSString*toCAFillModeType(PlatformCAAnimation::FillModeType type)48 [toPlatformCAAnimationMac(animation)->platformAnimation() setValue:[NSNumber numberWithBool:value] forKey:WKNonZeroBeginTimeFlag]; 49 } 50 51 NSString* WebCore::toCAFillModeType(PlatformCAAnimation::FillModeType type) 52 52 { 53 53 switch (type) { … … 71 71 } 72 72 73 static NSString*toCAValueFunctionType(PlatformCAAnimation::ValueFunctionType type)73 NSString* WebCore::toCAValueFunctionType(PlatformCAAnimation::ValueFunctionType type) 74 74 { 75 75 switch (type) { … … 128 128 } 129 129 130 static CAMediaTimingFunction*toCAMediaTimingFunction(const TimingFunction* timingFunction, bool reverse)130 CAMediaTimingFunction* WebCore::toCAMediaTimingFunction(const TimingFunction* timingFunction, bool reverse) 131 131 { 132 132 ASSERT(timingFunction); … … 147 147 } 148 148 149 ASSERT(timingFunction->type() == TimingFunction::LinearFunction); 149 150 return [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 150 151 } 151 152 152 PassRefPtr<PlatformCAAnimation> PlatformCAAnimation ::create(AnimationType type, const String& keyPath)153 { 154 return adoptRef(new PlatformCAAnimation (type, keyPath));155 } 156 157 PassRefPtr<PlatformCAAnimation> PlatformCAAnimation ::create(PlatformAnimationRef animation)158 { 159 return adoptRef(new PlatformCAAnimation (animation));160 } 161 162 PlatformCAAnimation ::PlatformCAAnimation(AnimationType type, const String& keyPath)163 : m_type(type)153 PassRefPtr<PlatformCAAnimation> PlatformCAAnimationMac::create(AnimationType type, const String& keyPath) 154 { 155 return adoptRef(new PlatformCAAnimationMac(type, keyPath)); 156 } 157 158 PassRefPtr<PlatformCAAnimation> PlatformCAAnimationMac::create(PlatformAnimationRef animation) 159 { 160 return adoptRef(new PlatformCAAnimationMac(animation)); 161 } 162 163 PlatformCAAnimationMac::PlatformCAAnimationMac(AnimationType type, const String& keyPath) 164 : PlatformCAAnimation(type) 164 165 { 165 166 if (type == Basic) … … 169 170 } 170 171 171 PlatformCAAnimation ::PlatformCAAnimation(PlatformAnimationRef animation)172 PlatformCAAnimationMac::PlatformCAAnimationMac(PlatformAnimationRef animation) 172 173 { 173 174 if ([static_cast<CAAnimation*>(animation) isKindOfClass:[CABasicAnimation class]]) 174 m_type = Basic;175 setType(Basic); 175 176 else if ([static_cast<CAAnimation*>(animation) isKindOfClass:[CAKeyframeAnimation class]]) 176 m_type = Keyframe;177 setType(Keyframe); 177 178 else { 178 179 ASSERT(0); … … 183 184 } 184 185 185 PassRefPtr<PlatformCAAnimation> PlatformCAAnimation::copy() const 186 PlatformCAAnimationMac::~PlatformCAAnimationMac() 187 { 188 } 189 190 PassRefPtr<PlatformCAAnimation> PlatformCAAnimationMac::copy() const 186 191 { 187 192 RefPtr<PlatformCAAnimation> animation = create(animationType(), keyPath()); … … 213 218 return animation; 214 219 } 215 PlatformCAAnimation::~PlatformCAAnimation() 216 { 217 } 218 219 PlatformAnimationRef PlatformCAAnimation::platformAnimation() const 220 221 PlatformAnimationRef PlatformCAAnimationMac::platformAnimation() const 220 222 { 221 223 return m_animation.get(); 222 224 } 223 225 224 String PlatformCAAnimation ::keyPath() const226 String PlatformCAAnimationMac::keyPath() const 225 227 { 226 228 return [m_animation.get() keyPath]; 227 229 } 228 230 229 CFTimeInterval PlatformCAAnimation ::beginTime() const231 CFTimeInterval PlatformCAAnimationMac::beginTime() const 230 232 { 231 233 return [m_animation.get() beginTime]; 232 234 } 233 235 234 void PlatformCAAnimation ::setBeginTime(CFTimeInterval value)236 void PlatformCAAnimationMac::setBeginTime(CFTimeInterval value) 235 237 { 236 238 [m_animation.get() setBeginTime:value]; … … 244 246 } 245 247 246 CFTimeInterval PlatformCAAnimation ::duration() const248 CFTimeInterval PlatformCAAnimationMac::duration() const 247 249 { 248 250 return [m_animation.get() duration]; 249 251 } 250 252 251 void PlatformCAAnimation ::setDuration(CFTimeInterval value)253 void PlatformCAAnimationMac::setDuration(CFTimeInterval value) 252 254 { 253 255 [m_animation.get() setDuration:value]; 254 256 } 255 257 256 float PlatformCAAnimation ::speed() const258 float PlatformCAAnimationMac::speed() const 257 259 { 258 260 return [m_animation.get() speed]; 259 261 } 260 262 261 void PlatformCAAnimation ::setSpeed(float value)263 void PlatformCAAnimationMac::setSpeed(float value) 262 264 { 263 265 [m_animation.get() setSpeed:value]; 264 266 } 265 267 266 CFTimeInterval PlatformCAAnimation ::timeOffset() const268 CFTimeInterval PlatformCAAnimationMac::timeOffset() const 267 269 { 268 270 return [m_animation.get() timeOffset]; 269 271 } 270 272 271 void PlatformCAAnimation ::setTimeOffset(CFTimeInterval value)273 void PlatformCAAnimationMac::setTimeOffset(CFTimeInterval value) 272 274 { 273 275 [m_animation.get() setTimeOffset:value]; 274 276 } 275 277 276 float PlatformCAAnimation ::repeatCount() const278 float PlatformCAAnimationMac::repeatCount() const 277 279 { 278 280 return [m_animation.get() repeatCount]; 279 281 } 280 282 281 void PlatformCAAnimation ::setRepeatCount(float value)283 void PlatformCAAnimationMac::setRepeatCount(float value) 282 284 { 283 285 [m_animation.get() setRepeatCount:value]; 284 286 } 285 287 286 bool PlatformCAAnimation ::autoreverses() const288 bool PlatformCAAnimationMac::autoreverses() const 287 289 { 288 290 return [m_animation.get() autoreverses]; 289 291 } 290 292 291 void PlatformCAAnimation ::setAutoreverses(bool value)293 void PlatformCAAnimationMac::setAutoreverses(bool value) 292 294 { 293 295 [m_animation.get() setAutoreverses:value]; 294 296 } 295 297 296 PlatformCAAnimation::FillModeType PlatformCAAnimation ::fillMode() const298 PlatformCAAnimation::FillModeType PlatformCAAnimationMac::fillMode() const 297 299 { 298 300 return fromCAFillModeType([m_animation.get() fillMode]); 299 301 } 300 302 301 void PlatformCAAnimation ::setFillMode(FillModeType value)303 void PlatformCAAnimationMac::setFillMode(FillModeType value) 302 304 { 303 305 [m_animation.get() setFillMode:toCAFillModeType(value)]; 304 306 } 305 307 306 void PlatformCAAnimation ::setTimingFunction(const TimingFunction* value, bool reverse)308 void PlatformCAAnimationMac::setTimingFunction(const TimingFunction* value, bool reverse) 307 309 { 308 310 [m_animation.get() setTimingFunction:toCAMediaTimingFunction(value, reverse)]; 309 311 } 310 312 311 void PlatformCAAnimation ::copyTimingFunctionFrom(const PlatformCAAnimation* value)312 { 313 [m_animation.get() setTimingFunction:[ value->m_animation.get() timingFunction]];314 } 315 316 bool PlatformCAAnimation ::isRemovedOnCompletion() const313 void PlatformCAAnimationMac::copyTimingFunctionFrom(const PlatformCAAnimation* value) 314 { 315 [m_animation.get() setTimingFunction:[toPlatformCAAnimationMac(value)->m_animation.get() timingFunction]]; 316 } 317 318 bool PlatformCAAnimationMac::isRemovedOnCompletion() const 317 319 { 318 320 return [m_animation.get() isRemovedOnCompletion]; 319 321 } 320 322 321 void PlatformCAAnimation ::setRemovedOnCompletion(bool value)323 void PlatformCAAnimationMac::setRemovedOnCompletion(bool value) 322 324 { 323 325 [m_animation.get() setRemovedOnCompletion:value]; 324 326 } 325 327 326 bool PlatformCAAnimation ::isAdditive() const328 bool PlatformCAAnimationMac::isAdditive() const 327 329 { 328 330 return [m_animation.get() isAdditive]; 329 331 } 330 332 331 void PlatformCAAnimation ::setAdditive(bool value)333 void PlatformCAAnimationMac::setAdditive(bool value) 332 334 { 333 335 [m_animation.get() setAdditive:value]; 334 336 } 335 337 336 PlatformCAAnimation::ValueFunctionType PlatformCAAnimation ::valueFunction() const338 PlatformCAAnimation::ValueFunctionType PlatformCAAnimationMac::valueFunction() const 337 339 { 338 340 CAValueFunction* vf = [m_animation.get() valueFunction]; … … 340 342 } 341 343 342 void PlatformCAAnimation ::setValueFunction(ValueFunctionType value)344 void PlatformCAAnimationMac::setValueFunction(ValueFunctionType value) 343 345 { 344 346 [m_animation.get() setValueFunction:[CAValueFunction functionWithName:toCAValueFunctionType(value)]]; 345 347 } 346 348 347 void PlatformCAAnimation ::setFromValue(float value)349 void PlatformCAAnimationMac::setFromValue(float value) 348 350 { 349 351 if (animationType() != Basic) … … 352 354 } 353 355 354 void PlatformCAAnimation ::setFromValue(const WebCore::TransformationMatrix& value)356 void PlatformCAAnimationMac::setFromValue(const WebCore::TransformationMatrix& value) 355 357 { 356 358 if (animationType() != Basic) … … 360 362 } 361 363 362 void PlatformCAAnimation ::setFromValue(const FloatPoint3D& value)364 void PlatformCAAnimationMac::setFromValue(const FloatPoint3D& value) 363 365 { 364 366 if (animationType() != Basic) … … 373 375 } 374 376 375 void PlatformCAAnimation ::setFromValue(const WebCore::Color& value)377 void PlatformCAAnimationMac::setFromValue(const WebCore::Color& value) 376 378 { 377 379 if (animationType() != Basic) … … 388 390 389 391 #if ENABLE(CSS_FILTERS) 390 void PlatformCAAnimation ::setFromValue(const FilterOperation* operation, int internalFilterPropertyIndex)392 void PlatformCAAnimationMac::setFromValue(const FilterOperation* operation, int internalFilterPropertyIndex) 391 393 { 392 394 RetainPtr<id> value = PlatformCAFilters::filterValueForOperation(operation, internalFilterPropertyIndex); … … 395 397 #endif 396 398 397 void PlatformCAAnimation ::copyFromValueFrom(const PlatformCAAnimation* value)399 void PlatformCAAnimationMac::copyFromValueFrom(const PlatformCAAnimation* value) 398 400 { 399 401 if (animationType() != Basic || value->animationType() != Basic) 400 402 return; 401 403 402 CABasicAnimation* otherAnimation = static_cast<CABasicAnimation*>( value->m_animation.get());404 CABasicAnimation* otherAnimation = static_cast<CABasicAnimation*>(toPlatformCAAnimationMac(value)->m_animation.get()); 403 405 [static_cast<CABasicAnimation*>(m_animation.get()) setFromValue:[otherAnimation fromValue]]; 404 406 } 405 407 406 void PlatformCAAnimation ::setToValue(float value)408 void PlatformCAAnimationMac::setToValue(float value) 407 409 { 408 410 if (animationType() != Basic) … … 411 413 } 412 414 413 void PlatformCAAnimation ::setToValue(const WebCore::TransformationMatrix& value)415 void PlatformCAAnimationMac::setToValue(const WebCore::TransformationMatrix& value) 414 416 { 415 417 if (animationType() != Basic) … … 419 421 } 420 422 421 void PlatformCAAnimation ::setToValue(const FloatPoint3D& value)423 void PlatformCAAnimationMac::setToValue(const FloatPoint3D& value) 422 424 { 423 425 if (animationType() != Basic) … … 432 434 } 433 435 434 void PlatformCAAnimation ::setToValue(const WebCore::Color& value)436 void PlatformCAAnimationMac::setToValue(const WebCore::Color& value) 435 437 { 436 438 if (animationType() != Basic) … … 447 449 448 450 #if ENABLE(CSS_FILTERS) 449 void PlatformCAAnimation ::setToValue(const FilterOperation* operation, int internalFilterPropertyIndex)451 void PlatformCAAnimationMac::setToValue(const FilterOperation* operation, int internalFilterPropertyIndex) 450 452 { 451 453 RetainPtr<id> value = PlatformCAFilters::filterValueForOperation(operation, internalFilterPropertyIndex); … … 454 456 #endif 455 457 456 void PlatformCAAnimation ::copyToValueFrom(const PlatformCAAnimation* value)458 void PlatformCAAnimationMac::copyToValueFrom(const PlatformCAAnimation* value) 457 459 { 458 460 if (animationType() != Basic || value->animationType() != Basic) 459 461 return; 460 462 461 CABasicAnimation* otherAnimation = static_cast<CABasicAnimation*>( value->m_animation.get());463 CABasicAnimation* otherAnimation = static_cast<CABasicAnimation*>(toPlatformCAAnimationMac(value)->m_animation.get()); 462 464 [static_cast<CABasicAnimation*>(m_animation.get()) setToValue:[otherAnimation toValue]]; 463 465 } … … 465 467 466 468 // Keyframe-animation properties. 467 void PlatformCAAnimation ::setValues(const Vector<float>& value)469 void PlatformCAAnimationMac::setValues(const Vector<float>& value) 468 470 { 469 471 if (animationType() != Keyframe) … … 476 478 } 477 479 478 void PlatformCAAnimation ::setValues(const Vector<WebCore::TransformationMatrix>& value)480 void PlatformCAAnimationMac::setValues(const Vector<WebCore::TransformationMatrix>& value) 479 481 { 480 482 if (animationType() != Keyframe) … … 489 491 } 490 492 491 void PlatformCAAnimation ::setValues(const Vector<FloatPoint3D>& value)493 void PlatformCAAnimationMac::setValues(const Vector<FloatPoint3D>& value) 492 494 { 493 495 if (animationType() != Keyframe) … … 507 509 } 508 510 509 void PlatformCAAnimation ::setValues(const Vector<WebCore::Color>& value)511 void PlatformCAAnimationMac::setValues(const Vector<WebCore::Color>& value) 510 512 { 511 513 if (animationType() != Keyframe) … … 527 529 528 530 #if ENABLE(CSS_FILTERS) 529 void PlatformCAAnimation ::setValues(const Vector<RefPtr<FilterOperation>>& values, int internalFilterPropertyIndex)531 void PlatformCAAnimationMac::setValues(const Vector<RefPtr<FilterOperation>>& values, int internalFilterPropertyIndex) 530 532 { 531 533 if (animationType() != Keyframe) … … 542 544 #endif 543 545 544 void PlatformCAAnimation ::copyValuesFrom(const PlatformCAAnimation* value)546 void PlatformCAAnimationMac::copyValuesFrom(const PlatformCAAnimation* value) 545 547 { 546 548 if (animationType() != Keyframe || value->animationType() != Keyframe) 547 549 return; 548 550 549 CAKeyframeAnimation* otherAnimation = static_cast<CAKeyframeAnimation*>( value->m_animation.get());551 CAKeyframeAnimation* otherAnimation = static_cast<CAKeyframeAnimation*>(toPlatformCAAnimationMac(value)->m_animation.get()); 550 552 [static_cast<CAKeyframeAnimation*>(m_animation.get()) setValues:[otherAnimation values]]; 551 553 } 552 554 553 void PlatformCAAnimation ::setKeyTimes(const Vector<float>& value)555 void PlatformCAAnimationMac::setKeyTimes(const Vector<float>& value) 554 556 { 555 557 NSMutableArray* array = [NSMutableArray array]; … … 561 563 } 562 564 563 void PlatformCAAnimation ::copyKeyTimesFrom(const PlatformCAAnimation* value)564 { 565 CAKeyframeAnimation* other = static_cast<CAKeyframeAnimation*>( value->m_animation.get());565 void PlatformCAAnimationMac::copyKeyTimesFrom(const PlatformCAAnimation* value) 566 { 567 CAKeyframeAnimation* other = static_cast<CAKeyframeAnimation*>(toPlatformCAAnimationMac(value)->m_animation.get()); 566 568 [static_cast<CAKeyframeAnimation*>(m_animation.get()) setKeyTimes:[other keyTimes]]; 567 569 } 568 570 569 void PlatformCAAnimation ::setTimingFunctions(const Vector<const TimingFunction*>& value, bool reverse)571 void PlatformCAAnimationMac::setTimingFunctions(const Vector<const TimingFunction*>& value, bool reverse) 570 572 { 571 573 NSMutableArray* array = [NSMutableArray array]; … … 577 579 } 578 580 579 void PlatformCAAnimation ::copyTimingFunctionsFrom(const PlatformCAAnimation* value)580 { 581 CAKeyframeAnimation* other = static_cast<CAKeyframeAnimation*>( value->m_animation.get());581 void PlatformCAAnimationMac::copyTimingFunctionsFrom(const PlatformCAAnimation* value) 582 { 583 CAKeyframeAnimation* other = static_cast<CAKeyframeAnimation*>(toPlatformCAAnimationMac(value)->m_animation.get()); 582 584 [static_cast<CAKeyframeAnimation*>(m_animation.get()) setTimingFunctions:[other timingFunctions]]; 583 585 } -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r166308 r166542 33 33 #import "GraphicsLayerCA.h" 34 34 #import "LengthFunctions.h" 35 #import "PlatformCAAnimationMac.h" 35 36 #import "PlatformCAFilters.h" 36 37 #import "PlatformCAFiltersMac.h" … … 396 397 } 397 398 398 CAPropertyAnimation* propertyAnimation = static_cast<CAPropertyAnimation*>( animation->platformAnimation());399 CAPropertyAnimation* propertyAnimation = static_cast<CAPropertyAnimation*>(toPlatformCAAnimationMac(animation)->platformAnimation()); 399 400 if (![propertyAnimation delegate]) 400 401 [propertyAnimation setDelegate:static_cast<id>(m_delegate.get())]; 401 402 402 403 BEGIN_BLOCK_OBJC_EXCEPTIONS 403 [m_layer.get() addAnimation: animation->m_animation.get()forKey:key];404 [m_layer.get() addAnimation:propertyAnimation forKey:key]; 404 405 END_BLOCK_OBJC_EXCEPTIONS 405 406 } … … 417 418 if (!propertyAnimation) 418 419 return 0; 419 return PlatformCAAnimation ::create(propertyAnimation);420 return PlatformCAAnimationMac::create(propertyAnimation); 420 421 } 421 422 -
trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm
r166516 r166542 27 27 #import "TileController.h" 28 28 29 #import "GraphicsContext.h" 29 30 #import "IntRect.h" 30 31 #import "PlatformCALayer.h" -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCAAnimationWin.cpp
r165676 r166542 1 1 /* 2 * Copyright (C) 201 1Apple Inc. All rights reserved.2 * Copyright (C) 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #include "config.h" 27 27 28 #include "PlatformCAAnimation.h" 28 #if PLATFORM(WIN) 29 #include "PlatformCAAnimationWin.h" 29 30 30 31 #include "FloatConversion.h" … … 142 143 } 143 144 144 PassRefPtr<PlatformCAAnimation> PlatformCAAnimation ::create(AnimationType type, const String& keyPath)145 { 146 return adoptRef(new PlatformCAAnimation (type, keyPath));147 } 148 149 PassRefPtr<PlatformCAAnimation> PlatformCAAnimation ::create(PlatformAnimationRef animation)150 { 151 return adoptRef(new PlatformCAAnimation (animation));152 } 153 154 PlatformCAAnimation ::PlatformCAAnimation(AnimationType type, const String& keyPath)155 : m_type(type)145 PassRefPtr<PlatformCAAnimation> PlatformCAAnimationWin::create(AnimationType type, const String& keyPath) 146 { 147 return adoptRef(new PlatformCAAnimationWin(type, keyPath)); 148 } 149 150 PassRefPtr<PlatformCAAnimation> PlatformCAAnimationWin::create(PlatformAnimationRef animation) 151 { 152 return adoptRef(new PlatformCAAnimationWin(animation)); 153 } 154 155 PlatformCAAnimationWin::PlatformCAAnimationWin(AnimationType type, const String& keyPath) 156 : PlatformCAAnimation(type) 156 157 { 157 158 if (type == Basic) … … 163 164 } 164 165 165 PlatformCAAnimation ::PlatformCAAnimation(PlatformAnimationRef animation)166 PlatformCAAnimationWin::PlatformCAAnimationWin(PlatformAnimationRef animation) 166 167 { 167 168 if (CACFAnimationGetClass(animation) == kCACFBasicAnimation) 168 m_type = Basic;169 setType(Basic); 169 170 else if (CACFAnimationGetClass(animation) == kCACFKeyframeAnimation) 170 m_type = Keyframe;171 setType(Keyframe); 171 172 else { 172 173 ASSERT_NOT_REACHED(); … … 177 178 } 178 179 179 PassRefPtr<PlatformCAAnimation> PlatformCAAnimation ::copy() const180 PassRefPtr<PlatformCAAnimation> PlatformCAAnimationWin::copy() const 180 181 { 181 182 RefPtr<PlatformCAAnimation> animation = create(animationType(), keyPath()); … … 207 208 } 208 209 209 PlatformCAAnimation ::~PlatformCAAnimation()210 { 211 } 212 213 PlatformAnimationRef PlatformCAAnimation ::platformAnimation() const210 PlatformCAAnimationWin::~PlatformCAAnimationWin() 211 { 212 } 213 214 PlatformAnimationRef PlatformCAAnimationWin::platformAnimation() const 214 215 { 215 216 return m_animation.get(); 216 217 } 217 218 218 String PlatformCAAnimation ::keyPath() const219 String PlatformCAAnimationWin::keyPath() const 219 220 { 220 221 return CACFAnimationGetKeyPath(m_animation.get()); 221 222 } 222 223 223 CFTimeInterval PlatformCAAnimation ::beginTime() const224 CFTimeInterval PlatformCAAnimationWin::beginTime() const 224 225 { 225 226 return CACFAnimationGetBeginTime(m_animation.get()); 226 227 } 227 228 228 void PlatformCAAnimation ::setBeginTime(CFTimeInterval value)229 void PlatformCAAnimationWin::setBeginTime(CFTimeInterval value) 229 230 { 230 231 CACFAnimationSetBeginTime(m_animation.get(), value); 231 232 } 232 233 233 CFTimeInterval PlatformCAAnimation ::duration() const234 CFTimeInterval PlatformCAAnimationWin::duration() const 234 235 { 235 236 return CACFAnimationGetDuration(m_animation.get()); 236 237 } 237 238 238 void PlatformCAAnimation ::setDuration(CFTimeInterval value)239 void PlatformCAAnimationWin::setDuration(CFTimeInterval value) 239 240 { 240 241 CACFAnimationSetDuration(m_animation.get(), value); 241 242 } 242 243 243 float PlatformCAAnimation ::speed() const244 float PlatformCAAnimationWin::speed() const 244 245 { 245 246 return CACFAnimationGetSpeed(m_animation.get()); 246 247 } 247 248 248 void PlatformCAAnimation ::setSpeed(float value)249 void PlatformCAAnimationWin::setSpeed(float value) 249 250 { 250 251 CACFAnimationSetSpeed(m_animation.get(), value); 251 252 } 252 253 253 CFTimeInterval PlatformCAAnimation ::timeOffset() const254 CFTimeInterval PlatformCAAnimationWin::timeOffset() const 254 255 { 255 256 return CACFAnimationGetTimeOffset(m_animation.get()); 256 257 } 257 258 258 void PlatformCAAnimation ::setTimeOffset(CFTimeInterval value)259 void PlatformCAAnimationWin::setTimeOffset(CFTimeInterval value) 259 260 { 260 261 CACFAnimationSetTimeOffset(m_animation.get(), value); 261 262 } 262 263 263 float PlatformCAAnimation ::repeatCount() const264 float PlatformCAAnimationWin::repeatCount() const 264 265 { 265 266 return CACFAnimationGetRepeatCount(m_animation.get()); 266 267 } 267 268 268 void PlatformCAAnimation ::setRepeatCount(float value)269 void PlatformCAAnimationWin::setRepeatCount(float value) 269 270 { 270 271 CACFAnimationSetRepeatCount(m_animation.get(), value); 271 272 } 272 273 273 bool PlatformCAAnimation ::autoreverses() const274 bool PlatformCAAnimationWin::autoreverses() const 274 275 { 275 276 return CACFAnimationGetAutoreverses(m_animation.get()); 276 277 } 277 278 278 void PlatformCAAnimation ::setAutoreverses(bool value)279 void PlatformCAAnimationWin::setAutoreverses(bool value) 279 280 { 280 281 CACFAnimationSetAutoreverses(m_animation.get(), value); 281 282 } 282 283 283 PlatformCAAnimation ::FillModeType PlatformCAAnimation::fillMode() const284 PlatformCAAnimationWin::FillModeType PlatformCAAnimationWin::fillMode() const 284 285 { 285 286 return fromCACFFillModeType(CACFAnimationGetFillMode(m_animation.get())); 286 287 } 287 288 288 void PlatformCAAnimation ::setFillMode(FillModeType value)289 void PlatformCAAnimationWin::setFillMode(FillModeType value) 289 290 { 290 291 CACFAnimationSetFillMode(m_animation.get(), toCACFFillModeType(value)); 291 292 } 292 293 293 void PlatformCAAnimation ::setTimingFunction(const TimingFunction* value, bool reverse)294 void PlatformCAAnimationWin::setTimingFunction(const TimingFunction* value, bool reverse) 294 295 { 295 296 UNUSED_PARAM(reverse); … … 297 298 } 298 299 299 void PlatformCAAnimation ::copyTimingFunctionFrom(const PlatformCAAnimation* value)300 { 301 CACFTimingFunctionRef timingFunc = CACFAnimationGetTimingFunction( value->m_animation.get());300 void PlatformCAAnimationWin::copyTimingFunctionFrom(const PlatformCAAnimation* value) 301 { 302 CACFTimingFunctionRef timingFunc = CACFAnimationGetTimingFunction(toPlatformCAAnimationWin(value)->m_animation.get()); 302 303 if (timingFunc) 303 304 CACFAnimationSetTimingFunction(m_animation.get(), timingFunc); 304 305 } 305 306 306 bool PlatformCAAnimation ::isRemovedOnCompletion() const307 bool PlatformCAAnimationWin::isRemovedOnCompletion() const 307 308 { 308 309 return CACFAnimationIsRemovedOnCompletion(m_animation.get()); 309 310 } 310 311 311 void PlatformCAAnimation ::setRemovedOnCompletion(bool value)312 void PlatformCAAnimationWin::setRemovedOnCompletion(bool value) 312 313 { 313 314 CACFAnimationSetRemovedOnCompletion(m_animation.get(), value); 314 315 } 315 316 316 bool PlatformCAAnimation ::isAdditive() const317 bool PlatformCAAnimationWin::isAdditive() const 317 318 { 318 319 return CACFAnimationIsAdditive(m_animation.get()); 319 320 } 320 321 321 void PlatformCAAnimation ::setAdditive(bool value)322 void PlatformCAAnimationWin::setAdditive(bool value) 322 323 { 323 324 CACFAnimationSetAdditive(m_animation.get(), value); 324 325 } 325 326 326 PlatformCAAnimation::ValueFunctionType PlatformCAAnimation ::valueFunction() const327 PlatformCAAnimation::ValueFunctionType PlatformCAAnimationWin::valueFunction() const 327 328 { 328 329 CACFValueFunctionRef func = CACFAnimationGetValueFunction(m_animation.get()); … … 330 331 } 331 332 332 void PlatformCAAnimation ::setValueFunction(ValueFunctionType value)333 void PlatformCAAnimationWin::setValueFunction(ValueFunctionType value) 333 334 { 334 335 CFStringRef valueString = toCACFValueFunctionType(value); … … 336 337 } 337 338 338 void PlatformCAAnimation ::setFromValue(float value)339 void PlatformCAAnimationWin::setFromValue(float value) 339 340 { 340 341 if (animationType() != Basic) … … 345 346 } 346 347 347 void PlatformCAAnimation ::setFromValue(const WebCore::TransformationMatrix& value)348 void PlatformCAAnimationWin::setFromValue(const WebCore::TransformationMatrix& value) 348 349 { 349 350 if (animationType() != Basic) … … 354 355 } 355 356 356 void PlatformCAAnimation ::setFromValue(const FloatPoint3D& value)357 void PlatformCAAnimationWin::setFromValue(const FloatPoint3D& value) 357 358 { 358 359 if (animationType() != Basic) … … 364 365 } 365 366 366 void PlatformCAAnimation ::setFromValue(const WebCore::Color& value)367 void PlatformCAAnimationWin::setFromValue(const WebCore::Color& value) 367 368 { 368 369 if (animationType() != Basic) … … 375 376 376 377 #if ENABLE(CSS_FILTERS) 377 void PlatformCAAnimation ::setFromValue(const FilterOperation*, int)378 void PlatformCAAnimationWin::setFromValue(const FilterOperation*, int) 378 379 { 379 380 // FIXME: Hardware filter animation not implemented on Windows … … 381 382 #endif 382 383 383 void PlatformCAAnimation ::copyFromValueFrom(const PlatformCAAnimation* value)384 void PlatformCAAnimationWin::copyFromValueFrom(const PlatformCAAnimation* value) 384 385 { 385 386 if (animationType() != Basic || value->animationType() != Basic) 386 387 return; 387 388 388 CACFAnimationSetFromValue(m_animation.get(), CACFAnimationGetFromValue( value->platformAnimation()));389 } 390 391 void PlatformCAAnimation ::setToValue(float value)389 CACFAnimationSetFromValue(m_animation.get(), CACFAnimationGetFromValue(toPlatformCAAnimationWin(value)->platformAnimation())); 390 } 391 392 void PlatformCAAnimationWin::setToValue(float value) 392 393 { 393 394 if (animationType() != Basic) … … 398 399 } 399 400 400 void PlatformCAAnimation ::setToValue(const WebCore::TransformationMatrix& value)401 void PlatformCAAnimationWin::setToValue(const WebCore::TransformationMatrix& value) 401 402 { 402 403 if (animationType() != Basic) … … 407 408 } 408 409 409 void PlatformCAAnimation ::setToValue(const FloatPoint3D& value)410 void PlatformCAAnimationWin::setToValue(const FloatPoint3D& value) 410 411 { 411 412 if (animationType() != Basic) … … 417 418 } 418 419 419 void PlatformCAAnimation ::setToValue(const WebCore::Color& value)420 void PlatformCAAnimationWin::setToValue(const WebCore::Color& value) 420 421 { 421 422 if (animationType() != Basic) … … 428 429 429 430 #if ENABLE(CSS_FILTERS) 430 void PlatformCAAnimation ::setToValue(const FilterOperation*, int)431 void PlatformCAAnimationWin::setToValue(const FilterOperation*, int) 431 432 { 432 433 // FIXME: Hardware filter animation not implemented on Windows … … 434 435 #endif 435 436 436 void PlatformCAAnimation ::copyToValueFrom(const PlatformCAAnimation* value)437 void PlatformCAAnimationWin::copyToValueFrom(const PlatformCAAnimation* value) 437 438 { 438 439 if (animationType() != Basic || value->animationType() != Basic) 439 440 return; 440 441 441 CACFAnimationSetToValue(m_animation.get(), CACFAnimationGetToValue(value->platformAnimation())); 442 } 443 442 CACFAnimationSetToValue(m_animation.get(), CACFAnimationGetToValue(toPlatformCAAnimationWin(value)->platformAnimation())); 443 } 444 444 445 445 // Keyframe-animation properties. 446 void PlatformCAAnimation ::setValues(const Vector<float>& value)446 void PlatformCAAnimationWin::setValues(const Vector<float>& value) 447 447 { 448 448 if (animationType() != Keyframe) … … 458 458 } 459 459 460 void PlatformCAAnimation ::setValues(const Vector<WebCore::TransformationMatrix>& value)460 void PlatformCAAnimationWin::setValues(const Vector<WebCore::TransformationMatrix>& value) 461 461 { 462 462 if (animationType() != Keyframe) … … 472 472 } 473 473 474 void PlatformCAAnimation ::setValues(const Vector<FloatPoint3D>& value)474 void PlatformCAAnimationWin::setValues(const Vector<FloatPoint3D>& value) 475 475 { 476 476 if (animationType() != Keyframe) … … 487 487 } 488 488 489 void PlatformCAAnimation ::setValues(const Vector<WebCore::Color>& value)489 void PlatformCAAnimationWin::setValues(const Vector<WebCore::Color>& value) 490 490 { 491 491 if (animationType() != Keyframe) … … 503 503 504 504 #if ENABLE(CSS_FILTERS) 505 void PlatformCAAnimation ::setValues(const Vector<RefPtr<FilterOperation> >&, int)505 void PlatformCAAnimationWin::setValues(const Vector<RefPtr<FilterOperation> >&, int) 506 506 { 507 507 // FIXME: Hardware filter animation not implemented on Windows … … 509 509 #endif 510 510 511 void PlatformCAAnimation ::copyValuesFrom(const PlatformCAAnimation* value)511 void PlatformCAAnimationWin::copyValuesFrom(const PlatformCAAnimation* value) 512 512 { 513 513 if (animationType() != Keyframe || value->animationType() != Keyframe) 514 514 return; 515 515 516 CACFAnimationSetValues(m_animation.get(), CACFAnimationGetValues( value->platformAnimation()));517 } 518 519 void PlatformCAAnimation ::setKeyTimes(const Vector<float>& value)516 CACFAnimationSetValues(m_animation.get(), CACFAnimationGetValues(toPlatformCAAnimationWin(value)->platformAnimation())); 517 } 518 519 void PlatformCAAnimationWin::setKeyTimes(const Vector<float>& value) 520 520 { 521 521 if (animationType() != Keyframe) … … 531 531 } 532 532 533 void PlatformCAAnimation ::copyKeyTimesFrom(const PlatformCAAnimation* value)534 { 535 if (animationType() != Keyframe) 536 return; 537 538 CACFAnimationSetKeyTimes(m_animation.get(), CACFAnimationGetKeyTimes( value->platformAnimation()));539 } 540 541 void PlatformCAAnimation ::setTimingFunctions(const Vector<const TimingFunction*>& value, bool reverse)533 void PlatformCAAnimationWin::copyKeyTimesFrom(const PlatformCAAnimation* value) 534 { 535 if (animationType() != Keyframe) 536 return; 537 538 CACFAnimationSetKeyTimes(m_animation.get(), CACFAnimationGetKeyTimes(toPlatformCAAnimationWin(value)->platformAnimation())); 539 } 540 541 void PlatformCAAnimationWin::setTimingFunctions(const Vector<const TimingFunction*>& value, bool reverse) 542 542 { 543 543 UNUSED_PARAM(reverse); … … 554 554 } 555 555 556 void PlatformCAAnimation::copyTimingFunctionsFrom(const PlatformCAAnimation* value) 557 { 558 CACFAnimationSetTimingFunctions(m_animation.get(), CACFAnimationGetTimingFunctions(value->platformAnimation())); 559 } 556 void PlatformCAAnimationWin::copyTimingFunctionsFrom(const PlatformCAAnimation* value) 557 { 558 CACFAnimationSetTimingFunctions(m_animation.get(), CACFAnimationGetTimingFunctions(toPlatformCAAnimationWin(value)->platformAnimation())); 559 } 560 561 #endif // PLATFORM(WIN) -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
r166310 r166542 31 31 #include "Font.h" 32 32 #include "GraphicsContext.h" 33 #include "PlatformCAAnimationWin.h" 33 34 #include "PlatformCALayerWinInternal.h" 34 35 #include <QuartzCore/CoreAnimationCF.h> … … 285 286 m_animations.add(key, animation); 286 287 287 CACFLayerAddAnimation(m_layer.get(), key.createCFString().get(), animation->platformAnimation());288 CACFLayerAddAnimation(m_layer.get(), key.createCFString().get(), toPlatformCAAnimationWin(animation)->platformAnimation()); 288 289 setNeedsCommit(); 289 290 -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp
r165676 r166542 30 30 #include "Font.h" 31 31 #include "FontCache.h" 32 #include "GraphicsContext.h" 32 33 #include "PlatformCALayer.h" 33 34 #include "TextRun.h" -
trunk/Source/WebKit2/ChangeLog
r166541 r166542 1 2014-03-31 Simon Fraser <simon.fraser@apple.com> 2 3 [UI-side compositing] Proxy animations to the UI process 4 https://bugs.webkit.org/show_bug.cgi?id=130946 5 6 Reviewed by Tim Horton. 7 8 Add encoding/decoding of TimingFunctions. Add encoding support 9 for HashSet. 10 11 Add PlatformCAAnimationRemote and have PlatformCALayerRemote allow 12 animations now. PlatformCALayerRemote's properties are defined in the class, 13 as is the encoding/decoding (much cleaner than having them in the transaction 14 class I think). 15 16 Add support for the "animationDidStart" callback and sending this back to the 17 web process. This involves a HashMap of layerID->WKAnimationDelegate stored 18 on the RemoteLayerTreeHost, and a message send via the DrawingArea. On the 19 other side, RemoteLayerTreeContext stores a HashMap of layerID->PlatformCALayerRemote* 20 for layers which have just started animations, which is used to get the 21 PlatformCALayer* to call animationDidStart() on. 22 23 This requires that the RemoteLayerTreeHost* be passed down into property application, 24 and that the RemoteLayerTreeHost have a reference to the drawing area. 25 26 To every CALayer in the UI process we -setValue:forKey: to track the PlatformLayerID, 27 so we can get back to it in order to dispatch "animationDidStart". 28 29 Replace some "using namespace WebKit" with "namespace WebKit { }". 30 31 * Platform/IPC/ArgumentCoders.h: 32 * Shared/WebCoreArgumentCoders.cpp: 33 (IPC::ArgumentCoder<LinearTimingFunction>::encode): 34 (IPC::ArgumentCoder<LinearTimingFunction>::decode): 35 (IPC::ArgumentCoder<CubicBezierTimingFunction>::encode): 36 (IPC::ArgumentCoder<CubicBezierTimingFunction>::decode): 37 (IPC::ArgumentCoder<StepsTimingFunction>::encode): 38 (IPC::ArgumentCoder<StepsTimingFunction>::decode): 39 * Shared/WebCoreArgumentCoders.h: 40 * Shared/mac/RemoteLayerBackingStore.mm: 41 * Shared/mac/RemoteLayerTreePropertyApplier.h: 42 * Shared/mac/RemoteLayerTreePropertyApplier.mm: 43 (WebKit::applyPropertiesToLayer): 44 (WebKit::RemoteLayerTreePropertyApplier::applyProperties): 45 * Shared/mac/RemoteLayerTreeTransaction.h: 46 * Shared/mac/RemoteLayerTreeTransaction.mm: 47 (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): 48 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): 49 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): 50 (WebKit::dumpChangedLayers): 51 * UIProcess/ios/RemoteLayerTreeHostIOS.mm: 52 (WebKit::RemoteLayerTreeHost::layerID): 53 (WebKit::RemoteLayerTreeHost::createLayer): 54 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: 55 * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: 56 (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): 57 (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart): 58 (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): 59 * UIProcess/mac/RemoteLayerTreeHost.h: 60 (WebKit::RemoteLayerTreeHost::animationDelegates): 61 * UIProcess/mac/RemoteLayerTreeHost.mm: 62 (WebKit::RemoteLayerTreeHost::RemoteLayerTreeHost): 63 (WebKit::RemoteLayerTreeHost::updateLayerTree): 64 (WebKit::RemoteLayerTreeHost::layerWillBeRemoved): 65 (WebKit::RemoteLayerTreeHost::animationDidStart): 66 (WebKit::RemoteLayerTreeHost::layerID): 67 (WebKit::RemoteLayerTreeHost::createLayer): 68 * WebKit2.xcodeproj/project.pbxproj: 69 * WebProcess/WebPage/DrawingArea.h: 70 (WebKit::DrawingArea::acceleratedAnimationDidStart): 71 * WebProcess/WebPage/DrawingArea.messages.in: 72 * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp: 73 (WebKit::GraphicsLayerCARemote::createPlatformCAAnimation): 74 * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: 75 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: Added. 76 * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: Added. 77 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: 78 (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): 79 (WebKit::PlatformCALayerRemote::animationStarted): 80 (WebKit::PlatformCALayerRemote::addAnimationForKey): 81 (WebKit::PlatformCALayerRemote::removeAnimationForKey): 82 (WebKit::PlatformCALayerRemote::animationForKey): 83 (PlatformCALayerRemote::recursiveBuildTransaction): Deleted. 84 (PlatformCALayerRemote::addAnimationForKey): Deleted. 85 (PlatformCALayerRemote::removeAnimationForKey): Deleted. 86 (PlatformCALayerRemote::animationForKey): Deleted. 87 * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: 88 * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp: 89 * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: 90 * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: 91 (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed): 92 (WebKit::RemoteLayerTreeContext::willStartAnimationOnLayer): 93 (WebKit::RemoteLayerTreeContext::animationDidStart): 94 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: 95 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: 96 (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart): 97 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 98 (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): 99 1 100 2014-03-31 Tim Horton <timothy_horton@apple.com> 2 101 -
trunk/Source/WebKit2/Platform/IPC/ArgumentCoders.h
r163509 r166542 32 32 #include <wtf/Forward.h> 33 33 #include <wtf/HashMap.h> 34 #include <wtf/HashSet.h> 34 35 #include <wtf/Vector.h> 35 36 … … 194 195 }; 195 196 197 template<typename KeyArg, typename HashArg, typename KeyTraitsArg> struct ArgumentCoder<HashSet<KeyArg, HashArg, KeyTraitsArg>> { 198 typedef HashSet<KeyArg, HashArg, KeyTraitsArg> HashSetType; 199 200 static void encode(ArgumentEncoder& encoder, const HashSetType& hashSet) 201 { 202 encoder << static_cast<uint64_t>(hashSet.size()); 203 for (typename HashSetType::const_iterator it = hashSet.begin(), end = hashSet.end(); it != end; ++it) 204 encoder << *it; 205 } 206 207 static bool decode(ArgumentDecoder& decoder, HashSetType& hashSet) 208 { 209 uint64_t hashSetSize; 210 if (!decoder.decode(hashSetSize)) 211 return false; 212 213 HashSetType tempHashSet; 214 for (uint64_t i = 0; i < hashSetSize; ++i) { 215 KeyArg key; 216 if (!decoder.decode(key)) 217 return false; 218 219 if (!tempHashSet.add(key).isNewEntry) { 220 // The hash map already has the specified key, bail. 221 decoder.markInvalid(); 222 return false; 223 } 224 } 225 226 hashSet.swap(tempHashSet); 227 return true; 228 } 229 }; 230 196 231 template<> struct ArgumentCoder<AtomicString> { 197 232 static void encode(ArgumentEncoder&, const AtomicString&); -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
r166317 r166542 60 60 #include <WebCore/SessionID.h> 61 61 #include <WebCore/TextCheckerClient.h> 62 #include <WebCore/TimingFunction.h> 62 63 #include <WebCore/TransformationMatrix.h> 63 64 #include <WebCore/URL.h> … … 91 92 } 92 93 93 94 94 void ArgumentCoder<TransformationMatrix>::encode(ArgumentEncoder& encoder, const TransformationMatrix& transformationMatrix) 95 95 { … … 100 100 { 101 101 return SimpleArgumentCoder<TransformationMatrix>::decode(decoder, transformationMatrix); 102 } 103 104 void ArgumentCoder<LinearTimingFunction>::encode(ArgumentEncoder& encoder, const LinearTimingFunction& timingFunction) 105 { 106 encoder.encodeEnum(timingFunction.type()); 107 } 108 109 bool ArgumentCoder<LinearTimingFunction>::decode(ArgumentDecoder& decoder, LinearTimingFunction& timingFunction) 110 { 111 // Type is decoded by the caller. Nothing else to decode. 112 return true; 113 } 114 115 void ArgumentCoder<CubicBezierTimingFunction>::encode(ArgumentEncoder& encoder, const CubicBezierTimingFunction& timingFunction) 116 { 117 encoder.encodeEnum(timingFunction.type()); 118 119 encoder << timingFunction.x1(); 120 encoder << timingFunction.y1(); 121 encoder << timingFunction.x2(); 122 encoder << timingFunction.y2(); 123 124 encoder.encodeEnum(timingFunction.timingFunctionPreset()); 125 } 126 127 bool ArgumentCoder<CubicBezierTimingFunction>::decode(ArgumentDecoder& decoder, CubicBezierTimingFunction& timingFunction) 128 { 129 // Type is decoded by the caller. 130 double x1; 131 if (!decoder.decode(x1)) 132 return false; 133 134 double y1; 135 if (!decoder.decode(y1)) 136 return false; 137 138 double x2; 139 if (!decoder.decode(x2)) 140 return false; 141 142 double y2; 143 if (!decoder.decode(y2)) 144 return false; 145 146 CubicBezierTimingFunction::TimingFunctionPreset preset; 147 if (!decoder.decodeEnum(preset)) 148 return false; 149 150 timingFunction.setValues(x1, y1, x2, y2); 151 timingFunction.setTimingFunctionPreset(preset); 152 153 return true; 154 } 155 156 void ArgumentCoder<StepsTimingFunction>::encode(ArgumentEncoder& encoder, const StepsTimingFunction& timingFunction) 157 { 158 encoder.encodeEnum(timingFunction.type()); 159 160 encoder << timingFunction.numberOfSteps(); 161 encoder << timingFunction.stepAtStart(); 162 } 163 164 bool ArgumentCoder<StepsTimingFunction>::decode(ArgumentDecoder& decoder, StepsTimingFunction& timingFunction) 165 { 166 // Type is decoded by the caller. 167 int numSteps; 168 if (!decoder.decode(numSteps)) 169 return false; 170 171 bool stepAtStart; 172 if (!decoder.decode(stepAtStart)) 173 return false; 174 175 timingFunction.setNumberOfSteps(numSteps); 176 timingFunction.setStepAtStart(stepAtStart); 177 178 return true; 102 179 } 103 180 -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h
r164726 r166542 35 35 class Color; 36 36 class Credential; 37 class CubicBezierTimingFunction; 37 38 class Cursor; 38 39 class DatabaseDetails; … … 49 50 class IntSize; 50 51 class KeyframeValueList; 51 class URL;52 class LinearTimingFunction; 52 53 class Notification; 53 54 class ProtectionSpace; … … 57 58 class ResourceResponse; 58 59 class SessionID; 60 class StepsTimingFunction; 59 61 class StickyPositionViewportConstraints; 60 62 class TextCheckingRequestData; … … 62 64 class UserStyleSheet; 63 65 class UserScript; 66 class URL; 64 67 struct CompositionUnderline; 65 68 struct Cookie; … … 113 116 }; 114 117 118 template<> struct ArgumentCoder<WebCore::LinearTimingFunction> { 119 static void encode(ArgumentEncoder&, const WebCore::LinearTimingFunction&); 120 static bool decode(ArgumentDecoder&, WebCore::LinearTimingFunction&); 121 }; 122 123 template<> struct ArgumentCoder<WebCore::CubicBezierTimingFunction> { 124 static void encode(ArgumentEncoder&, const WebCore::CubicBezierTimingFunction&); 125 static bool decode(ArgumentDecoder&, WebCore::CubicBezierTimingFunction&); 126 }; 127 128 template<> struct ArgumentCoder<WebCore::StepsTimingFunction> { 129 static void encode(ArgumentEncoder&, const WebCore::StepsTimingFunction&); 130 static bool decode(ArgumentDecoder&, WebCore::StepsTimingFunction&); 131 }; 132 115 133 template<> struct ArgumentCoder<WebCore::CertificateInfo> { 116 134 static void encode(ArgumentEncoder&, const WebCore::CertificateInfo&); -
trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm
r166541 r166542 50 50 51 51 using namespace WebCore; 52 using namespace WebKit; 52 53 namespace WebKit { 53 54 54 55 RemoteLayerBackingStore::RemoteLayerBackingStore() … … 326 327 layer.contents = (id)m_frontBuffer->makeCGImageCopy().get(); 327 328 } 329 330 } // namespace WebKit -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h
r164890 r166542 33 33 namespace WebKit { 34 34 35 class RemoteLayerTreeHost; 36 35 37 class RemoteLayerTreePropertyApplier { 36 38 public: 37 39 typedef HashMap<WebCore::GraphicsLayer::PlatformLayerID, LayerOrView *> RelatedLayerMap; 38 static void applyProperties(CALayer *, const RemoteLayerTreeTransaction::LayerProperties&, const RelatedLayerMap&);40 static void applyProperties(CALayer *, RemoteLayerTreeHost*, const RemoteLayerTreeTransaction::LayerProperties&, const RelatedLayerMap&); 39 41 #if PLATFORM(IOS) 40 static void applyProperties(UIView *, const RemoteLayerTreeTransaction::LayerProperties&, const RelatedLayerMap&);42 static void applyProperties(UIView *, RemoteLayerTreeHost*, const RemoteLayerTreeTransaction::LayerProperties&, const RelatedLayerMap&); 41 43 #endif 42 44 }; -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm
r165863 r166542 27 27 #import "RemoteLayerTreePropertyApplier.h" 28 28 29 #import "PlatformCAAnimationRemote.h" 29 30 #import "PlatformCALayerRemote.h" 31 #import "RemoteLayerTreeHost.h" 30 32 #import <QuartzCore/CALayer.h> 31 33 #import <WebCore/BlockExceptions.h> … … 112 114 } 113 115 114 static void applyPropertiesToLayer(CALayer *layer, const RemoteLayerTreeTransaction::LayerProperties& properties)116 static void applyPropertiesToLayer(CALayer *layer, RemoteLayerTreeHost* layerTreeHost, const RemoteLayerTreeTransaction::LayerProperties& properties) 115 117 { 116 118 if (properties.changedProperties & RemoteLayerTreeTransaction::NameChanged) … … 129 131 if (properties.changedProperties & RemoteLayerTreeTransaction::SizeChanged) 130 132 layer.bounds = FloatRect(FloatPoint(), properties.size); 131 133 132 134 if (properties.changedProperties & RemoteLayerTreeTransaction::BackgroundColorChanged) 133 135 layer.backgroundColor = cgColorFromColor(properties.backgroundColor).get(); … … 193 195 PlatformCAFilters::setFiltersOnLayer(layer, properties.filters ? *properties.filters : FilterOperations()); 194 196 197 if (properties.changedProperties & RemoteLayerTreeTransaction::AnimationsChanged) 198 PlatformCAAnimationRemote::updateLayerAnimations(layer, layerTreeHost, properties.addedAnimations, properties.keyPathsOfAnimationsToRemove); 199 195 200 if (properties.changedProperties & RemoteLayerTreeTransaction::EdgeAntialiasingMaskChanged) 196 201 layer.edgeAntialiasingMask = properties.edgeAntialiasingMask; … … 200 205 } 201 206 202 void RemoteLayerTreePropertyApplier::applyProperties(CALayer *layer, const RemoteLayerTreeTransaction::LayerProperties& properties, const RelatedLayerMap& relatedLayers)207 void RemoteLayerTreePropertyApplier::applyProperties(CALayer *layer, RemoteLayerTreeHost* layerTreeHost, const RemoteLayerTreeTransaction::LayerProperties& properties, const RelatedLayerMap& relatedLayers) 203 208 { 204 209 BEGIN_BLOCK_OBJC_EXCEPTIONS; 205 applyPropertiesToLayer(layer, properties);210 applyPropertiesToLayer(layer, layerTreeHost, properties); 206 211 207 212 if (properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) { … … 237 242 238 243 #if PLATFORM(IOS) 239 void RemoteLayerTreePropertyApplier::applyProperties(UIView *view, const RemoteLayerTreeTransaction::LayerProperties& properties, const RelatedLayerMap& relatedLayers)244 void RemoteLayerTreePropertyApplier::applyProperties(UIView *view, RemoteLayerTreeHost* layerTreeHost, const RemoteLayerTreeTransaction::LayerProperties& properties, const RelatedLayerMap& relatedLayers) 240 245 { 241 246 BEGIN_BLOCK_OBJC_EXCEPTIONS; 242 applyPropertiesToLayer(view.layer, properties);247 applyPropertiesToLayer(view.layer, layerTreeHost, properties); 243 248 244 249 if (properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) { -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
r166308 r166542 27 27 #define RemoteLayerTreeTransaction_h 28 28 29 #include "PlatformCAAnimationRemote.h" 29 30 #include "RemoteLayerBackingStore.h" 30 31 #include <WebCore/Color.h> … … 35 36 #include <WebCore/TransformationMatrix.h> 36 37 #include <wtf/HashMap.h> 38 #include <wtf/HashSet.h> 37 39 #include <wtf/text/WTFString.h> 38 40 … … 75 77 BackingStoreChanged = 1 << 24, 76 78 FiltersChanged = 1 << 25, 77 EdgeAntialiasingMaskChanged = 1 << 26, 78 CustomAppearanceChanged = 1 << 27, 79 CustomBehaviorChanged = 1 << 28 79 AnimationsChanged = 1 << 26, 80 EdgeAntialiasingMaskChanged = 1 << 27, 81 CustomAppearanceChanged = 1 << 28, 82 CustomBehaviorChanged = 1 << 29 80 83 }; 81 84 typedef unsigned LayerChange; … … 113 116 std::unique_ptr<WebCore::TransformationMatrix> sublayerTransform; 114 117 Vector<WebCore::GraphicsLayer::PlatformLayerID> children; 118 119 HashMap<String, PlatformCAAnimationRemote::Properties> addedAnimations; 120 HashSet<String> keyPathsOfAnimationsToRemove; 121 115 122 WebCore::FloatPoint3D position; 116 123 WebCore::FloatPoint3D anchorPoint; -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r166308 r166542 104 104 , name(other.name) 105 105 , children(other.children) 106 , addedAnimations(other.addedAnimations) 107 , keyPathsOfAnimationsToRemove(other.keyPathsOfAnimationsToRemove) 106 108 , position(other.position) 107 109 , anchorPoint(other.anchorPoint) … … 150 152 encoder << children; 151 153 154 if (changedProperties & AnimationsChanged) { 155 encoder << addedAnimations; 156 encoder << keyPathsOfAnimationsToRemove; 157 } 158 152 159 if (changedProperties & PositionChanged) 153 160 encoder << position; … … 250 257 return false; 251 258 } 259 } 260 261 if (result.changedProperties & AnimationsChanged) { 262 if (!decoder.decode(result.addedAnimations)) 263 return false; 264 265 if (!decoder.decode(result.keyPathsOfAnimationsToRemove)) 266 return false; 252 267 } 253 268 … … 736 751 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) 737 752 dumpProperty<Vector<GraphicsLayer::PlatformLayerID>>(ts, "children", layerProperties.children); 753 754 // FIXME: dump animations 738 755 739 756 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::PositionChanged) -
trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm
r166333 r166542 38 38 using namespace WebCore; 39 39 40 @interface UIView(WKViewInternals)41 - (void)_createLayerWithFrame:(CGRect)frame;42 @end43 44 40 @interface CALayer(WKLayerInternal) 45 41 - (void)setContextId:(uint32_t)contextID; … … 77 73 namespace WebKit { 78 74 75 static NSString* const WKLayerIDPropertyKey = @"WKLayerID"; 76 77 WebCore::GraphicsLayer::PlatformLayerID RemoteLayerTreeHost::layerID(LayerOrView* layer) 78 { 79 return [[layer valueForKey:WKLayerIDPropertyKey] unsignedLongLongValue]; 80 } 81 79 82 LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties, const RemoteLayerTreeTransaction::LayerProperties* layerProperties) 80 83 { … … 111 114 // FIXME: Do through the view. 112 115 [[layerOrView layer] web_disableAllActions]; 116 [[layerOrView layer] setValue:[NSNumber numberWithUnsignedLongLong:properties.layerID] forKey:WKLayerIDPropertyKey]; 113 117 114 118 return layerOrView.get(); -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
r166540 r166542 44 44 45 45 const RemoteLayerTreeHost& remoteLayerTreeHost() const { return m_remoteLayerTreeHost; } 46 47 void acceleratedAnimationDidStart(uint64_t layerID, double startTime); 46 48 47 49 void coreAnimationDidCommitLayers(); -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
r166540 r166542 44 44 RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy(WebPageProxy* webPageProxy) 45 45 : DrawingAreaProxy(DrawingAreaTypeRemoteLayerTree, webPageProxy) 46 , m_remoteLayerTreeHost( )46 , m_remoteLayerTreeHost(*this) 47 47 , m_isWaitingForDidUpdateGeometry(false) 48 48 { … … 140 140 141 141 scheduleCoreAnimationLayerCommitObserver(); 142 } 143 144 void RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart(uint64_t layerID, double startTime) 145 { 146 m_webPageProxy->process().send(Messages::DrawingArea::AcceleratedAnimationDidStart(layerID, startTime), m_webPageProxy->pageID()); 142 147 } 143 148 … … 247 252 } 248 253 249 m_debugIndicatorLayerTreeHost = std::make_unique<RemoteLayerTreeHost>( );254 m_debugIndicatorLayerTreeHost = std::make_unique<RemoteLayerTreeHost>(*this); 250 255 m_debugIndicatorLayerTreeHost->setIsDebugLayerTreeHost(true); 251 256 -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h
r166333 r166542 33 33 #include <wtf/RetainPtr.h> 34 34 35 OBJC_CLASS WKAnimationDelegate; 36 35 37 namespace WebKit { 36 38 39 class RemoteLayerTreeDrawingAreaProxy; 37 40 class WebPageProxy; 38 41 39 42 class RemoteLayerTreeHost { 40 43 public: 41 explicit RemoteLayerTreeHost( );44 explicit RemoteLayerTreeHost(RemoteLayerTreeDrawingAreaProxy&); 42 45 virtual ~RemoteLayerTreeHost(); 43 46 44 47 LayerOrView *getLayer(WebCore::GraphicsLayer::PlatformLayerID) const; 45 48 LayerOrView *rootLayer() const { return m_rootLayer; } 49 50 static WebCore::GraphicsLayer::PlatformLayerID layerID(LayerOrView*); 46 51 47 52 // Returns true if the root layer changed. … … 51 56 bool isDebugLayerTreeHost() const { return m_isDebugLayerTreeHost; } 52 57 58 typedef HashMap<WebCore::GraphicsLayer::PlatformLayerID, RetainPtr<WKAnimationDelegate>> LayerAnimationDelegateMap; 59 LayerAnimationDelegateMap& animationDelegates() { return m_animationDelegates; } 60 61 void animationDidStart(WebCore::GraphicsLayer::PlatformLayerID, double startTime); 62 53 63 private: 54 64 LayerOrView *createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties&, const RemoteLayerTreeTransaction::LayerProperties*); 55 65 66 void layerWillBeRemoved(WebCore::GraphicsLayer::PlatformLayerID); 67 68 RemoteLayerTreeDrawingAreaProxy& m_drawingArea; 56 69 LayerOrView *m_rootLayer; 57 70 HashMap<WebCore::GraphicsLayer::PlatformLayerID, RetainPtr<LayerOrView>> m_layers; 71 HashMap<WebCore::GraphicsLayer::PlatformLayerID, RetainPtr<WKAnimationDelegate>> m_animationDelegates; 58 72 bool m_isDebugLayerTreeHost; 59 73 }; -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
r166333 r166542 27 27 #import "RemoteLayerTreeHost.h" 28 28 29 #import "RemoteLayerTreeDrawingAreaProxy.h" 29 30 #import "RemoteLayerTreePropertyApplier.h" 30 31 #import "RemoteLayerTreeTransaction.h" … … 42 43 namespace WebKit { 43 44 44 RemoteLayerTreeHost::RemoteLayerTreeHost() 45 : m_rootLayer(nullptr) 45 RemoteLayerTreeHost::RemoteLayerTreeHost(RemoteLayerTreeDrawingAreaProxy& drawingArea) 46 : m_drawingArea(drawingArea) 47 , m_rootLayer(nullptr) 46 48 , m_isDebugLayerTreeHost(false) 47 49 { … … 88 90 propertiesCopy.borderWidth *= 1 / indicatorScaleFactor; 89 91 90 RemoteLayerTreePropertyApplier::applyProperties(layer, propertiesCopy, relatedLayers);92 RemoteLayerTreePropertyApplier::applyProperties(layer, this, propertiesCopy, relatedLayers); 91 93 } else 92 RemoteLayerTreePropertyApplier::applyProperties(layer, properties, relatedLayers);94 RemoteLayerTreePropertyApplier::applyProperties(layer, this, properties, relatedLayers); 93 95 } 94 96 95 97 for (auto& destroyedLayer : transaction.destroyedLayers()) 96 m_layers.remove(destroyedLayer);98 layerWillBeRemoved(destroyedLayer); 97 99 98 100 return rootLayerChanged; … … 107 109 } 108 110 111 void RemoteLayerTreeHost::layerWillBeRemoved(WebCore::GraphicsLayer::PlatformLayerID layerID) 112 { 113 m_animationDelegates.remove(layerID); 114 m_layers.remove(layerID); 115 } 116 117 void RemoteLayerTreeHost::animationDidStart(WebCore::GraphicsLayer::PlatformLayerID layerID, double startTime) 118 { 119 m_drawingArea.acceleratedAnimationDidStart(layerID, startTime); 120 } 121 109 122 #if !PLATFORM(IOS) 123 static NSString* const WKLayerIDPropertyKey = @"WKLayerID"; 124 125 WebCore::GraphicsLayer::PlatformLayerID RemoteLayerTreeHost::layerID(LayerOrView* layer) 126 { 127 return [[layer valueForKey:WKLayerIDPropertyKey] unsignedLongLongValue]; 128 } 129 110 130 LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties, const RemoteLayerTreeTransaction::LayerProperties*) 111 131 { … … 138 158 139 159 [layer web_disableAllActions]; 160 [layer setValue:[NSNumber numberWithUnsignedLongLong:properties.layerID] forKey:WKLayerIDPropertyKey]; 140 161 141 162 return layer.get(); -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r166385 r166542 64 64 0F5947A7187B517600437857 /* RemoteScrollingCoordinatorMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5947A5187B517600437857 /* RemoteScrollingCoordinatorMessageReceiver.cpp */; }; 65 65 0F5947A8187B517600437857 /* RemoteScrollingCoordinatorMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5947A6187B517600437857 /* RemoteScrollingCoordinatorMessages.h */; }; 66 0F5E200318E77051003EC3E5 /* PlatformCAAnimationRemote.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F5E200118E77051003EC3E5 /* PlatformCAAnimationRemote.mm */; }; 67 0F5E200418E77051003EC3E5 /* PlatformCAAnimationRemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */; }; 66 68 0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */; }; 67 69 0F931C1D18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */; }; … … 1800 1802 0F5947A5187B517600437857 /* RemoteScrollingCoordinatorMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteScrollingCoordinatorMessageReceiver.cpp; sourceTree = "<group>"; }; 1801 1803 0F5947A6187B517600437857 /* RemoteScrollingCoordinatorMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteScrollingCoordinatorMessages.h; sourceTree = "<group>"; }; 1804 0F5E200118E77051003EC3E5 /* PlatformCAAnimationRemote.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformCAAnimationRemote.mm; sourceTree = "<group>"; }; 1805 0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCAAnimationRemote.h; sourceTree = "<group>"; }; 1802 1806 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeOverflowScrollingNodeIOS.h; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h; sourceTree = "<group>"; }; 1803 1807 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingTreeOverflowScrollingNodeIOS.mm; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm; sourceTree = "<group>"; }; … … 6021 6025 2DA049B5180CCD0A00AAFA9E /* GraphicsLayerCARemote.cpp */, 6022 6026 2DA049B6180CCD0A00AAFA9E /* GraphicsLayerCARemote.h */, 6027 0F5E200118E77051003EC3E5 /* PlatformCAAnimationRemote.mm */, 6028 0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */, 6023 6029 2DA049B1180CCCD300AAFA9E /* PlatformCALayerRemote.cpp */, 6024 6030 2DA049B2180CCCD300AAFA9E /* PlatformCALayerRemote.h */, … … 6922 6928 BCB9E2431120DACA00A137E0 /* WebContext.h in Headers */, 6923 6929 31A505FA1680025500A930EB /* WebContextClient.h in Headers */, 6930 0F5E200418E77051003EC3E5 /* PlatformCAAnimationRemote.h in Headers */, 6924 6931 512A9761180E031D0039A149 /* DatabaseProcessMessages.h in Headers */, 6925 6932 BC09B8F9147460F7005F5625 /* WebContextConnectionClient.h in Headers */, … … 8663 8670 BCD597D1112B56AC00EC8C23 /* WKPreferences.cpp in Sources */, 8664 8671 BCBAACEC145225E30053F82F /* WKProcessGroup.mm in Sources */, 8672 0F5E200318E77051003EC3E5 /* PlatformCAAnimationRemote.mm in Sources */, 8665 8673 512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */, 8666 8674 37948408150C4B9700E52CE9 /* WKRenderLayer.cpp in Sources */, -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
r165748 r166542 92 92 virtual void setExposedRect(const WebCore::FloatRect&) = 0; 93 93 virtual WebCore::FloatRect exposedRect() const = 0; 94 virtual void acceleratedAnimationDidStart(uint64_t /*layerID*/, double /*startTime*/) { } 94 95 #endif 95 96 #if PLATFORM(IOS) -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
r165235 r166542 34 34 AdjustTransientZoom(double scale, WebCore::FloatPoint origin) 35 35 CommitTransientZoom(double scale, WebCore::FloatPoint origin) 36 37 AcceleratedAnimationDidStart(uint64_t layerID, double startTime) 36 38 #endif 37 39 } -
trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp
r165676 r166542 26 26 #include "config.h" 27 27 #include "GraphicsLayerCARemote.h" 28 #include "PlatformCAAnimationRemote.h" 28 29 #include "PlatformCALayerRemote.h" 29 30 … … 53 54 } 54 55 56 PassRefPtr<PlatformCAAnimation> GraphicsLayerCARemote::createPlatformCAAnimation(PlatformCAAnimation::AnimationType type, const String& keyPath) 57 { 58 return PlatformCAAnimationRemote::create(type, keyPath); 55 59 } 60 61 bool GraphicsLayerCARemote::addAnimation(const KeyframeValueList& valueList, const FloatSize&, const Animation* anim, const String&, double) 62 { 63 if (!animationCanBeAccelerated(valueList, anim)) 64 return false; 65 66 #if ENABLE(CSS_FILTERS) 67 if (valueList.property() == AnimatedPropertyWebkitFilter) 68 return false; 69 #endif 70 71 return true; 72 } 73 74 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h
r165676 r166542 53 53 virtual PassRefPtr<WebCore::PlatformCALayer> createPlatformCALayer(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner) override; 54 54 virtual PassRefPtr<WebCore::PlatformCALayer> createPlatformCALayer(PlatformLayer*, WebCore::PlatformCALayerClient* owner) override; 55 56 // No accelerated animations for now. 57 virtual bool addAnimation(const WebCore::KeyframeValueList&, const WebCore::FloatSize&, const WebCore::Animation*, const String&, double) override { return false; } 55 virtual PassRefPtr<WebCore::PlatformCAAnimation> createPlatformCAAnimation(WebCore::PlatformCAAnimation::AnimationType, const String& keyPath) override; 58 56 59 57 // PlatformCALayerRemote can't currently proxy directly composited image contents, so opt out of this optimization. 60 58 virtual bool shouldDirectlyCompositeImage(WebCore::Image*) const override { return false; } 61 59 60 virtual bool addAnimation(const WebCore::KeyframeValueList&, const WebCore::FloatSize&, const WebCore::Animation*, const String&, double); 61 62 62 RemoteLayerTreeContext* m_context; 63 63 }; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
r166308 r166542 43 43 44 44 using namespace WebCore; 45 using namespace WebKit; 45 46 namespace WebKit { 46 47 47 48 PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemote::create(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext* context) … … 125 126 126 127 if (m_layerType == LayerTypeCustom) { 127 RemoteLayerTreePropertyApplier::applyProperties(platformLayer(), m_properties, RemoteLayerTreePropertyApplier::RelatedLayerMap());128 RemoteLayerTreePropertyApplier::applyProperties(platformLayer(), nullptr, m_properties, RemoteLayerTreePropertyApplier::RelatedLayerMap()); 128 129 m_properties.changedProperties = RemoteLayerTreeTransaction::NoChange; 129 130 return; … … 146 147 void PlatformCALayerRemote::animationStarted(CFTimeInterval beginTime) 147 148 { 149 if (m_owner) 150 m_owner->platformCALayerAnimationStarted(beginTime); 148 151 } 149 152 … … 268 271 void PlatformCALayerRemote::addAnimationForKey(const String& key, PlatformCAAnimation* animation) 269 272 { 270 ASSERT_NOT_REACHED(); 273 m_properties.addedAnimations.set(key, toPlatformCAAnimationRemote(animation)->properties()); 274 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::AnimationsChanged); 275 276 m_context->willStartAnimationOnLayer(this); 271 277 } 272 278 273 279 void PlatformCALayerRemote::removeAnimationForKey(const String& key) 274 280 { 275 ASSERT_NOT_REACHED(); 281 // FIXME: remove from m_properties.addedAnimations ? 282 m_properties.keyPathsOfAnimationsToRemove.add(key); 283 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::AnimationsChanged); 276 284 } 277 285 278 286 PassRefPtr<PlatformCAAnimation> PlatformCALayerRemote::animationForKey(const String& key) 279 287 { 280 ASSERT_NOT_REACHED(); 281 288 // FIXME: implement. 282 289 return nullptr; 283 290 } … … 590 597 return 0; 591 598 } 599 600 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm
r165676 r166542 38 38 39 39 using namespace WebCore; 40 using namespace WebKit; 40 41 namespace WebKit { 41 42 42 43 static NSString * const platformCALayerPointer = @"WKPlatformCALayer"; … … 84 85 PlatformCALayerRemote::setNeedsDisplay(rect); 85 86 } 87 88 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp
r165676 r166542 34 34 35 35 using namespace WebCore; 36 using namespace WebKit; 36 37 namespace WebKit { 37 38 38 39 PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext* context) … … 103 104 m_tileController->setTileDebugBorderColor(color); 104 105 } 106 107 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h
r162139 r166542 56 56 void buildTransaction(RemoteLayerTreeTransaction&, WebCore::PlatformCALayer& rootLayer); 57 57 58 // From the UI process 59 void animationDidStart(WebCore::GraphicsLayer::PlatformLayerID, double startTime); 60 61 void willStartAnimationOnLayer(PlatformCALayerRemote*); 62 58 63 private: 59 64 // WebCore::GraphicsLayerFactory … … 67 72 Vector<RemoteLayerTreeTransaction::LayerCreationProperties> m_createdLayers; 68 73 Vector<WebCore::GraphicsLayer::PlatformLayerID> m_destroyedLayers; 74 75 HashMap<WebCore::GraphicsLayer::PlatformLayerID, PlatformCALayerRemote*> m_layersAwaitingAnimationStart; 69 76 }; 70 77 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm
r164910 r166542 66 66 ASSERT(!m_destroyedLayers.contains(layer->layerID())); 67 67 m_destroyedLayers.append(layer->layerID()); 68 69 m_layersAwaitingAnimationStart.remove(layer->layerID()); 68 70 } 69 71 … … 103 105 } 104 106 107 void RemoteLayerTreeContext::willStartAnimationOnLayer(PlatformCALayerRemote* layer) 108 { 109 m_layersAwaitingAnimationStart.add(layer->layerID(), layer); 110 } 111 112 void RemoteLayerTreeContext::animationDidStart(WebCore::GraphicsLayer::PlatformLayerID layerID, double startTime) 113 { 114 auto it = m_layersAwaitingAnimationStart.find(layerID); 115 if (it != m_layersAwaitingAnimationStart.end()) 116 it->value->animationStarted(startTime); 117 } 118 105 119 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
r166540 r166542 76 76 virtual WebCore::FloatRect exposedRect() const override { return m_scrolledExposedRect; } 77 77 78 virtual void acceleratedAnimationDidStart(uint64_t layerID, double startTime) override; 79 78 80 #if PLATFORM(IOS) 79 81 virtual void setExposedContentRect(const WebCore::FloatRect&) override; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
r166540 r166542 243 243 } 244 244 245 void RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart(uint64_t layerID, double startTime) 246 { 247 m_remoteLayerTreeContext->animationDidStart(layerID, startTime); 248 } 249 245 250 void RemoteLayerTreeDrawingArea::setExposedRect(const FloatRect& exposedRect) 246 251 { -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r166516 r166542 45 45 #import <WebCore/MainFrame.h> 46 46 #import <WebCore/Page.h> 47 #import <WebCore/PlatformCAAnimationMac.h> 47 48 #import <WebCore/RenderLayerBacking.h> 48 49 #import <WebCore/RenderLayerCompositor.h> … … 755 756 756 757 RetainPtr<CABasicAnimation> renderViewAnimationCA = transientZoomSnapAnimationForKeyPath("transform"); 757 RefPtr<PlatformCAAnimation> renderViewAnimation = PlatformCAAnimation ::create(renderViewAnimationCA.get());758 RefPtr<PlatformCAAnimation> renderViewAnimation = PlatformCAAnimationMac::create(renderViewAnimationCA.get()); 758 759 renderViewAnimation->setToValue(transform); 759 760
Note: See TracChangeset
for help on using the changeset viewer.