Changeset 167553 in webkit
- Timestamp:
- Apr 19, 2014, 3:26:59 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 14 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/WebCore.exp.in (modified) (1 diff)
-
WebCore/platform/graphics/ca/GraphicsLayerCA.h (modified) (1 diff)
-
WebCore/platform/graphics/ca/PlatformCAFilters.h (modified) (1 diff)
-
WebCore/platform/graphics/ca/PlatformCALayer.h (modified) (1 diff)
-
WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm (modified) (5 diffs)
-
WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (modified) (1 diff)
-
WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (modified) (2 diffs)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm (modified) (1 diff)
-
WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (modified) (2 diffs)
-
WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (modified) (7 diffs)
-
WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (modified) (1 diff)
-
WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167551 r167553 1 2014-04-19 Simon Fraser <simon.fraser@apple.com> 2 3 [UI-side compositing] Implement blend modes 4 https://bugs.webkit.org/show_bug.cgi?id=131891 5 <rdar://problem/16490085> 6 7 Reviewed by Tim Horton. 8 9 Implement blend modes with UI-side compositing. 10 11 PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in 12 PlatformCALayerMac and PlatformCALayerRemote. 13 PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform 14 layer, so it can be called from the UI process on a CALayer*. 15 16 Fix an issue with GraphicsLayerCA::LayerChange flags. 1 << 31 shifts 17 a signed integer, so it ended up setting all the high bits in m_uncommittedChanges, 18 causing us to push blend modes to the UI process for every layer. Fix by shifting 19 an unsigned long long (1LLU << 31). This should also fix a build warning on Windows. 20 21 * WebCore.exp.in: 22 * platform/graphics/ca/GraphicsLayerCA.h: 23 * platform/graphics/ca/PlatformCAFilters.h: 24 * platform/graphics/ca/PlatformCALayer.h: 25 * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: 26 (PlatformCAFilters::setBlendingFiltersOnLayer): 27 * platform/graphics/ca/mac/PlatformCALayerMac.h: 28 * platform/graphics/ca/mac/PlatformCALayerMac.mm: 29 (PlatformCALayerMac::setFilters): 30 (PlatformCALayerMac::setBlendMode): 31 (PlatformCALayer::setBlendMode): Deleted. 32 1 33 2014-04-19 Joseph Pecoraro <pecoraro@apple.com> 2 34 -
trunk/Source/WebCore/WebCore.exp.in
r167535 r167553 737 737 __ZN7WebCore17PlatformCAFilters17setFiltersOnLayerEP7CALayerRKNS_16FilterOperationsE 738 738 __ZN7WebCore17PlatformCAFilters23filterValueForOperationEPKNS_15FilterOperationEi 739 __ZN7WebCore17PlatformCAFilters25setBlendingFiltersOnLayerEP7CALayerNS_9BlendModeE 739 740 __ZN7WebCore17SQLiteTransaction5beginEv 740 741 __ZN7WebCore17SQLiteTransaction6commitEv -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r167535 r167553 425 425 enum LayerChange { 426 426 NoChange = 0, 427 NameChanged = 1 << 1,428 ChildrenChanged = 1 << 2, // also used for content layer, and preserves-3d, and size if tiling changes?429 GeometryChanged = 1 << 3,430 TransformChanged = 1 << 4,431 ChildrenTransformChanged = 1 << 5,432 Preserves3DChanged = 1 << 6,433 MasksToBoundsChanged = 1 << 7,434 DrawsContentChanged = 1 << 8,435 BackgroundColorChanged = 1 << 9,436 ContentsOpaqueChanged = 1 << 10,437 BackfaceVisibilityChanged = 1 << 11,438 OpacityChanged = 1 << 12,439 AnimationChanged = 1 << 13,440 DirtyRectsChanged = 1 << 14,441 ContentsImageChanged = 1 << 15,442 ContentsMediaLayerChanged = 1 << 16,443 ContentsCanvasLayerChanged = 1 << 17,444 ContentsColorLayerChanged = 1 << 18,445 ContentsRectsChanged = 1 << 19,446 MaskLayerChanged = 1 << 20,447 ReplicatedLayerChanged = 1 << 21,448 ContentsNeedsDisplay = 1 << 22,449 AcceleratesDrawingChanged = 1 << 23,450 ContentsScaleChanged = 1 << 24,451 ContentsVisibilityChanged = 1 << 25,452 VisibleRectChanged = 1 << 26,453 FiltersChanged = 1 << 27,454 TilingAreaChanged = 1 << 28,455 TilesAdded = 1 < 29,456 DebugIndicatorsChanged = 1 << 30,457 CustomAppearanceChanged = 1 << 31,458 CustomBehaviorChanged = 1 << 32,459 BlendModeChanged = 1 << 33427 NameChanged = 1LLU << 1, 428 ChildrenChanged = 1LLU << 2, // also used for content layer, and preserves-3d, and size if tiling changes? 429 GeometryChanged = 1LLU << 3, 430 TransformChanged = 1LLU << 4, 431 ChildrenTransformChanged = 1LLU << 5, 432 Preserves3DChanged = 1LLU << 6, 433 MasksToBoundsChanged = 1LLU << 7, 434 DrawsContentChanged = 1LLU << 8, 435 BackgroundColorChanged = 1LLU << 9, 436 ContentsOpaqueChanged = 1LLU << 10, 437 BackfaceVisibilityChanged = 1LLU << 11, 438 OpacityChanged = 1LLU << 12, 439 AnimationChanged = 1LLU << 13, 440 DirtyRectsChanged = 1LLU << 14, 441 ContentsImageChanged = 1LLU << 15, 442 ContentsMediaLayerChanged = 1LLU << 16, 443 ContentsCanvasLayerChanged = 1LLU << 17, 444 ContentsColorLayerChanged = 1LLU << 18, 445 ContentsRectsChanged = 1LLU << 19, 446 MaskLayerChanged = 1LLU << 20, 447 ReplicatedLayerChanged = 1LLU << 21, 448 ContentsNeedsDisplay = 1LLU << 22, 449 AcceleratesDrawingChanged = 1LLU << 23, 450 ContentsScaleChanged = 1LLU << 24, 451 ContentsVisibilityChanged = 1LLU << 25, 452 VisibleRectChanged = 1LLU << 26, 453 FiltersChanged = 1LLU << 27, 454 TilingAreaChanged = 1LLU << 28, 455 TilesAdded = 1LLU < 29, 456 DebugIndicatorsChanged = 1LLU << 30, 457 CustomAppearanceChanged = 1LLU << 31, 458 CustomBehaviorChanged = 1LLU << 32, 459 BlendModeChanged = 1LLU << 33 460 460 }; 461 461 typedef uint64_t LayerChangeFlags; -
trunk/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h
r166741 r167553 49 49 public: 50 50 static void setFiltersOnLayer(PlatformLayer*, const FilterOperations&); 51 static void setBlendingFiltersOnLayer(Platform CALayer*, const BlendMode);51 static void setBlendingFiltersOnLayer(PlatformLayer*, const BlendMode); 52 52 static int numAnimatedFilterProperties(FilterOperation::OperationType); 53 53 static const char* animatedFilterPropertyName(FilterOperation::OperationType, int internalFilterPropertyIndex); -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r166542 r167553 184 184 185 185 #if ENABLE(CSS_COMPOSITING) 186 v oid setBlendMode(BlendMode);186 virtual void setBlendMode(BlendMode) = 0; 187 187 #endif 188 188 -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm
r166741 r167553 29 29 30 30 #import "PlatformCAFilters.h" 31 32 31 #import "BlockExceptions.h" 33 32 #import "FloatConversion.h" … … 40 39 41 40 // FIXME: Should share these values with FilterEffectRenderer::build() (https://bugs.webkit.org/show_bug.cgi?id=76008). 42 static double sepiaFullConstants[3][3] = {41 static const double sepiaFullConstants[3][3] = { 43 42 { 0.393, 0.769, 0.189 }, 44 43 { 0.349, 0.686, 0.168 }, … … 46 45 }; 47 46 48 static double sepiaNoneConstants[3][3] = {47 static const double sepiaNoneConstants[3][3] = { 49 48 { 1, 0, 0 }, 50 49 { 0, 1, 0 }, … … 539 538 #endif 540 539 541 void PlatformCAFilters::setBlendingFiltersOnLayer(Platform CALayer* platformCALayer, const BlendMode blendMode)540 void PlatformCAFilters::setBlendingFiltersOnLayer(PlatformLayer* layer, const BlendMode blendMode) 542 541 { 543 542 #if USE_CA_FILTERS 544 CALayer* layer = platformCALayer->platformLayer();545 546 543 BEGIN_BLOCK_OBJC_EXCEPTIONS 547 544 … … 596 593 597 594 END_BLOCK_OBJC_EXCEPTIONS 598 599 #else 600 UNUSED_PARAM(platformCALayer); 595 #else 596 UNUSED_PARAM(layer); 601 597 UNUSED_PARAM(blendMode); 602 598 #endif -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
r166654 r167553 123 123 #endif 124 124 125 #if ENABLE(CSS_COMPOSITING) 126 virtual void setBlendMode(BlendMode) override; 127 #endif 128 125 129 virtual void setName(const String&) override; 126 130 -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r166654 r167553 644 644 void PlatformCALayerMac::setFilters(const FilterOperations& filters) 645 645 { 646 PlatformCAFilters::setFiltersOnLayer( this->platformLayer(), filters);646 PlatformCAFilters::setFiltersOnLayer(platformLayer(), filters); 647 647 } 648 648 … … 680 680 681 681 #if ENABLE(CSS_COMPOSITING) 682 void PlatformCALayer ::setBlendMode(BlendMode blendMode)683 { 684 PlatformCAFilters::setBlendingFiltersOnLayer( this, blendMode);682 void PlatformCALayerMac::setBlendMode(BlendMode blendMode) 683 { 684 PlatformCAFilters::setBlendingFiltersOnLayer(platformLayer(), blendMode); 685 685 } 686 686 #endif -
trunk/Source/WebKit2/ChangeLog
r167552 r167553 1 2014-04-19 Simon Fraser <simon.fraser@apple.com> 2 3 [UI-side compositing] Implement blend modes 4 https://bugs.webkit.org/show_bug.cgi?id=131891 5 <rdar://problem/16490085> 6 7 Reviewed by Tim Horton. 8 9 Implement blend modes with UI-side compositing. 10 11 PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in 12 PlatformCALayerMac and PlatformCALayerRemote. 13 PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform 14 layer, so it can be called from the UI process on a CALayer*. 15 16 Add BlendMode to LayerProperties, and initialize, encode and decode it, 17 as well as adding dumping support for blend modes. 18 19 * Shared/mac/RemoteLayerTreePropertyApplier.mm: 20 (WebKit::applyPropertiesToLayer): 21 * Shared/mac/RemoteLayerTreeTransaction.h: 22 * Shared/mac/RemoteLayerTreeTransaction.mm: 23 (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): 24 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): 25 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): 26 (WebKit::RemoteLayerTreeTextStream::operator<<): 27 (WebKit::dumpChangedLayers): 28 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: 29 (WebKit::PlatformCALayerRemote::setBlendMode): 30 * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 31 1 32 2014-04-19 Joseph Pecoraro <pecoraro@apple.com> 2 33 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm
r167536 r167553 179 179 layer.magnificationFilter = toCAFilterType(properties.magnificationFilter); 180 180 181 if (properties.changedProperties & RemoteLayerTreeTransaction::BlendModeChanged) 182 PlatformCAFilters::setBlendingFiltersOnLayer(layer, properties.blendMode); 183 181 184 if (properties.changedProperties & RemoteLayerTreeTransaction::SpeedChanged) 182 185 layer.speed = properties.speed; -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
r166545 r167553 73 73 MinificationFilterChanged = 1 << 20, 74 74 MagnificationFilterChanged = 1 << 21, 75 SpeedChanged = 1 << 22, 76 TimeOffsetChanged = 1 << 23, 77 BackingStoreChanged = 1 << 24, 78 FiltersChanged = 1 << 25, 79 AnimationsChanged = 1 << 26, 80 EdgeAntialiasingMaskChanged = 1 << 27, 81 CustomAppearanceChanged = 1 << 28, 82 CustomBehaviorChanged = 1 << 29 75 BlendModeChanged = 1 << 22, 76 SpeedChanged = 1 << 23, 77 TimeOffsetChanged = 1 << 24, 78 BackingStoreChanged = 1 << 25, 79 FiltersChanged = 1 << 26, 80 AnimationsChanged = 1 << 27, 81 EdgeAntialiasingMaskChanged = 1 << 28, 82 CustomAppearanceChanged = 1 << 29, 83 CustomBehaviorChanged = 1 << 30 83 84 }; 84 85 typedef unsigned LayerChange; … … 144 145 WebCore::PlatformCALayer::FilterType minificationFilter; 145 146 WebCore::PlatformCALayer::FilterType magnificationFilter; 147 WebCore::BlendMode blendMode; 146 148 bool hidden; 147 149 bool geometryFlipped; -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r167266 r167553 94 94 , minificationFilter(PlatformCALayer::FilterType::Linear) 95 95 , magnificationFilter(PlatformCALayer::FilterType::Linear) 96 , blendMode(BlendModeNormal) 96 97 , hidden(false) 97 98 , geometryFlipped(false) … … 126 127 , minificationFilter(other.minificationFilter) 127 128 , magnificationFilter(other.magnificationFilter) 129 , blendMode(other.blendMode) 128 130 , hidden(other.hidden) 129 131 , geometryFlipped(other.geometryFlipped) … … 217 219 encoder.encodeEnum(magnificationFilter); 218 220 221 if (changedProperties & BlendModeChanged) 222 encoder.encodeEnum(blendMode); 223 219 224 if (changedProperties & SpeedChanged) 220 225 encoder << speed; … … 369 374 if (result.changedProperties & MagnificationFilterChanged) { 370 375 if (!decoder.decodeEnum(result.magnificationFilter)) 376 return false; 377 } 378 379 if (result.changedProperties & BlendModeChanged) { 380 if (!decoder.decodeEnum(result.blendMode)) 371 381 return false; 372 382 } … … 568 578 RemoteLayerTreeTextStream& operator<<(const PlatformCAAnimationRemote::Properties&); 569 579 RemoteLayerTreeTextStream& operator<<(const RemoteLayerBackingStore&); 580 RemoteLayerTreeTextStream& operator<<(BlendMode); 570 581 RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::AnimationType); 571 582 RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::FillModeType); … … 715 726 return ts; 716 727 } 717 728 729 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(BlendMode blendMode) 730 { 731 RemoteLayerTreeTextStream& ts = *this; 732 switch (blendMode) { 733 case BlendModeNormal: ts << "normal"; break; 734 case BlendModeMultiply: ts << "multiply"; break; 735 case BlendModeScreen: ts << "screen"; break; 736 case BlendModeOverlay: ts << "overlay"; break; 737 case BlendModeDarken: ts << "darken"; break; 738 case BlendModeLighten: ts << "lighten"; break; 739 case BlendModeColorDodge: ts << "color-dodge"; break; 740 case BlendModeColorBurn: ts << "color-burn"; break; 741 case BlendModeHardLight: ts << "hard-light"; break; 742 case BlendModeSoftLight: ts << "soft-light"; break; 743 case BlendModeDifference: ts << "difference"; break; 744 case BlendModeExclusion: ts << "exclusion"; break; 745 case BlendModeHue: ts << "hue"; break; 746 case BlendModeSaturation: ts << "saturation"; break; 747 case BlendModeColor: ts << "color"; break; 748 case BlendModeLuminosity: ts << "luminosity"; break; 749 } 750 return ts; 751 } 752 718 753 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(PlatformCAAnimation::AnimationType type) 719 754 { … … 1018 1053 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MagnificationFilterChanged) 1019 1054 dumpProperty(ts, "magnificationFilter", layerProperties.magnificationFilter); 1055 1056 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BlendModeChanged) 1057 dumpProperty(ts, "blendMode", layerProperties.blendMode); 1020 1058 1021 1059 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::SpeedChanged) -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
r167273 r167553 529 529 } 530 530 531 #if ENABLE(CSS_COMPOSITING) 532 void PlatformCALayerRemote::setBlendMode(BlendMode blendMode) 533 { 534 m_properties.blendMode = blendMode; 535 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BlendModeChanged); 536 } 537 #endif 538 531 539 bool PlatformCALayerRemote::filtersCanBeComposited(const FilterOperations& filters) 532 540 { -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
r167273 r167553 125 125 #endif 126 126 127 #if ENABLE(CSS_COMPOSITING) 128 virtual void setBlendMode(WebCore::BlendMode) override; 129 #endif 130 127 131 virtual void setName(const String&) override; 128 132
Note:
See TracChangeset
for help on using the changeset viewer.