Changeset 164405 in webkit
- Timestamp:
- Feb 19, 2014, 6:03:37 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 9 edited
-
ChangeLog (modified) (1 diff)
-
Shared/mac/RemoteLayerTreePropertyApplier.h (modified) (1 diff)
-
Shared/mac/RemoteLayerTreePropertyApplier.mm (modified) (3 diffs)
-
Shared/mac/RemoteLayerTreeTransaction.h (modified) (5 diffs)
-
Shared/mac/RemoteLayerTreeTransaction.mm (modified) (13 diffs)
-
UIProcess/mac/RemoteLayerTreeHost.h (modified) (1 diff)
-
UIProcess/mac/RemoteLayerTreeHost.mm (modified) (2 diffs)
-
WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (modified) (9 diffs)
-
WebProcess/WebPage/mac/PlatformCALayerRemote.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r164402 r164405 1 2014-02-19 Simon Fraser <simon.fraser@apple.com> 2 3 [UI-Side Compositing] 6% of main thread time spent copying LayerProperties when adding to hash table 4 https://bugs.webkit.org/show_bug.cgi?id=129074 5 6 Reviewed by Tim Horton. 7 8 Make RemoteLayerTreeTransaction::LayerProperties smaller and not copied by 9 value everywhere. 10 11 Put some big members into unique_ptrs, and store unique_ptrs 12 in the hash of layerID to properties. 13 14 Clean up member variable order of LayerProperties to improve packing. 15 16 Also have applyPropertiesToLayer() take references to things to avoid 17 copies. 18 19 * Shared/mac/RemoteLayerTreePropertyApplier.h: 20 * Shared/mac/RemoteLayerTreePropertyApplier.mm: 21 (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): 22 * Shared/mac/RemoteLayerTreeTransaction.h: 23 (WebKit::RemoteLayerTreeTransaction::changedLayers): 24 * Shared/mac/RemoteLayerTreeTransaction.mm: 25 (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): 26 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): 27 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): 28 (WebKit::RemoteLayerTreeTransaction::encode): 29 (WebKit::RemoteLayerTreeTransaction::decode): 30 (WebKit::RemoteLayerTreeTransaction::layerPropertiesChanged): 31 (WebKit::dumpChangedLayers): 32 * UIProcess/mac/RemoteLayerTreeHost.h: 33 * UIProcess/mac/RemoteLayerTreeHost.mm: 34 (WebKit::RemoteLayerTreeHost::updateLayerTree): 35 (WebKit::RemoteLayerTreeHost::createLayer): 36 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: 37 (PlatformCALayerRemote::create): 38 (PlatformCALayerRemote::PlatformCALayerRemote): 39 (PlatformCALayerRemote::clone): 40 (PlatformCALayerRemote::recursiveBuildTransaction): 41 (PlatformCALayerRemote::ensureBackingStore): 42 (PlatformCALayerRemote::setNeedsDisplay): 43 (PlatformCALayerRemote::transform): 44 (PlatformCALayerRemote::setTransform): 45 (PlatformCALayerRemote::sublayerTransform): 46 (PlatformCALayerRemote::setSublayerTransform): 47 (PlatformCALayerRemote::setFilters): 48 (PlatformCALayerRemote::enumerateRectsBeingDrawn): 49 * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 50 1 51 2014-02-19 Benjamin Poulain <bpoulain@apple.com> 2 52 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h
r162453 r164405 35 35 public: 36 36 typedef HashMap<WebCore::GraphicsLayer::PlatformLayerID, CALayer *> RelatedLayerMap; 37 static void applyPropertiesToLayer(CALayer *, RemoteLayerTreeTransaction::LayerProperties, RelatedLayerMap);37 static void applyPropertiesToLayer(CALayer *, const RemoteLayerTreeTransaction::LayerProperties&, const RelatedLayerMap&); 38 38 }; 39 39 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm
r163959 r164405 80 80 } 81 81 82 void RemoteLayerTreePropertyApplier::applyPropertiesToLayer(CALayer *layer, RemoteLayerTreeTransaction::LayerProperties properties, RelatedLayerMaprelatedLayers)82 void RemoteLayerTreePropertyApplier::applyPropertiesToLayer(CALayer *layer, const RemoteLayerTreeTransaction::LayerProperties& properties, const RelatedLayerMap& relatedLayers) 83 83 { 84 84 if (properties.changedProperties & RemoteLayerTreeTransaction::NameChanged) … … 118 118 119 119 if (properties.changedProperties & RemoteLayerTreeTransaction::TransformChanged) 120 layer.transform = properties.transform ;120 layer.transform = properties.transform ? (CATransform3D)*properties.transform.get() : CATransform3DIdentity; 121 121 122 122 if (properties.changedProperties & RemoteLayerTreeTransaction::SublayerTransformChanged) 123 layer.sublayerTransform = properties.sublayerTransform ;123 layer.sublayerTransform = properties.sublayerTransform ? (CATransform3D)*properties.sublayerTransform.get() : CATransform3DIdentity; 124 124 125 125 if (properties.changedProperties & RemoteLayerTreeTransaction::HiddenChanged) … … 169 169 if (properties.changedProperties & RemoteLayerTreeTransaction::BackingStoreChanged) { 170 170 #if USE(IOSURFACE) 171 if (properties.backingStore .acceleratesDrawing())172 layer.contents = (id)properties.backingStore .surface().get();171 if (properties.backingStore->acceleratesDrawing()) 172 layer.contents = (id)properties.backingStore->surface().get(); 173 173 else 174 174 #else 175 ASSERT(!properties.backingStore .acceleratesDrawing());175 ASSERT(!properties.backingStore || !properties.backingStore->acceleratesDrawing()); 176 176 #endif 177 layer.contents = (id)properties.backingStore.image().get();177 layer.contents = properties.backingStore ? (id)properties.backingStore->image().get() : nil; 178 178 } 179 179 180 180 if (properties.changedProperties & RemoteLayerTreeTransaction::FiltersChanged) 181 PlatformCAFilters::setFiltersOnLayer(layer, properties.filters );181 PlatformCAFilters::setFiltersOnLayer(layer, properties.filters ? *properties.filters : FilterOperations()); 182 182 183 183 if (properties.changedProperties & RemoteLayerTreeTransaction::EdgeAntialiasingMaskChanged) -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
r163666 r164405 93 93 struct LayerProperties { 94 94 LayerProperties(); 95 LayerProperties(const LayerProperties& other); 95 96 96 97 void encode(IPC::ArgumentEncoder&) const; … … 107 108 108 109 String name; 110 std::unique_ptr<WebCore::TransformationMatrix> transform; 111 std::unique_ptr<WebCore::TransformationMatrix> sublayerTransform; 109 112 Vector<WebCore::GraphicsLayer::PlatformLayerID> children; 110 113 WebCore::FloatPoint3D position; 114 WebCore::FloatPoint3D anchorPoint; 111 115 WebCore::FloatSize size; 116 WebCore::FloatRect contentsRect; 117 std::unique_ptr<RemoteLayerBackingStore> backingStore; 118 std::unique_ptr<WebCore::FilterOperations> filters; 119 WebCore::GraphicsLayer::PlatformLayerID maskLayerID; 120 double timeOffset; 121 float speed; 122 float contentsScale; 123 float borderWidth; 124 float opacity; 112 125 WebCore::Color backgroundColor; 113 WebCore::FloatPoint3D anchorPoint;114 float borderWidth;115 126 WebCore::Color borderColor; 116 float opacity; 117 WebCore::TransformationMatrix transform; 118 WebCore::TransformationMatrix sublayerTransform; 127 unsigned edgeAntialiasingMask; 128 WebCore::GraphicsLayer::CustomAppearance customAppearance; 129 WebCore::PlatformCALayer::FilterType minificationFilter; 130 WebCore::PlatformCALayer::FilterType magnificationFilter; 119 131 bool hidden; 120 132 bool geometryFlipped; … … 122 134 bool masksToBounds; 123 135 bool opaque; 124 WebCore::GraphicsLayer::PlatformLayerID maskLayerID;125 WebCore::FloatRect contentsRect;126 float contentsScale;127 WebCore::PlatformCALayer::FilterType minificationFilter;128 WebCore::PlatformCALayer::FilterType magnificationFilter;129 float speed;130 double timeOffset;131 RemoteLayerBackingStore backingStore;132 WebCore::FilterOperations filters;133 unsigned edgeAntialiasingMask;134 WebCore::GraphicsLayer::CustomAppearance customAppearance;135 136 }; 136 137 … … 152 153 #endif 153 154 155 typedef HashMap<WebCore::GraphicsLayer::PlatformLayerID, std::unique_ptr<LayerProperties>> LayerPropertiesMap; 156 154 157 Vector<LayerCreationProperties> createdLayers() const { return m_createdLayers; } 155 HashMap<WebCore::GraphicsLayer::PlatformLayerID, LayerProperties> changedLayers() const { return m_changedLayerProperties; } 158 const LayerPropertiesMap& changedLayers() const { return m_changedLayerProperties; } 159 LayerPropertiesMap& changedLayers() { return m_changedLayerProperties; } 156 160 Vector<WebCore::GraphicsLayer::PlatformLayerID> destroyedLayers() const { return m_destroyedLayerIDs; } 157 161 … … 176 180 private: 177 181 WebCore::GraphicsLayer::PlatformLayerID m_rootLayerID; 178 HashMap<WebCore::GraphicsLayer::PlatformLayerID, LayerProperties>m_changedLayerProperties;182 LayerPropertiesMap m_changedLayerProperties; 179 183 Vector<LayerCreationProperties> m_createdLayers; 180 184 Vector<WebCore::GraphicsLayer::PlatformLayerID> m_destroyedLayerIDs; -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r163666 r164405 73 73 : changedProperties(NoChange) 74 74 , everChangedProperties(NoChange) 75 , anchorPoint(0.5, 0.5, 0) 76 , contentsRect(FloatPoint(), FloatSize(1, 1)) 77 , maskLayerID(0) 78 , timeOffset(0) 79 , speed(1) 80 , contentsScale(1) 81 , borderWidth(0) 82 , opacity(1) 75 83 , backgroundColor(Color::transparent) 76 , anchorPoint(0.5, 0.5, 0)77 , borderWidth(0)78 84 , borderColor(Color::black) 79 , opacity(1) 85 , edgeAntialiasingMask(kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge) 86 , customAppearance(GraphicsLayer::NoCustomAppearance) 87 , minificationFilter(PlatformCALayer::FilterType::Linear) 88 , magnificationFilter(PlatformCALayer::FilterType::Linear) 80 89 , hidden(false) 81 90 , geometryFlipped(false) … … 83 92 , masksToBounds(false) 84 93 , opaque(false) 85 , maskLayerID(0) 86 , contentsRect(FloatPoint(), FloatSize(1, 1)) 87 , contentsScale(1) 88 , minificationFilter(PlatformCALayer::FilterType::Linear) 89 , magnificationFilter(PlatformCALayer::FilterType::Linear) 90 , speed(1) 91 , timeOffset(0) 92 , edgeAntialiasingMask(kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge) 93 , customAppearance(GraphicsLayer::NoCustomAppearance) 94 { 94 { 95 } 96 97 RemoteLayerTreeTransaction::LayerProperties::LayerProperties(const LayerProperties& other) 98 : changedProperties(other.changedProperties) 99 , everChangedProperties(other.everChangedProperties) 100 , name(other.name) 101 , children(other.children) 102 , position(other.position) 103 , anchorPoint(other.anchorPoint) 104 , size(other.size) 105 , contentsRect(other.contentsRect) 106 , maskLayerID(other.maskLayerID) 107 , timeOffset(other.timeOffset) 108 , speed(other.speed) 109 , contentsScale(other.contentsScale) 110 , borderWidth(other.borderWidth) 111 , opacity(other.opacity) 112 , backgroundColor(other.backgroundColor) 113 , borderColor(other.borderColor) 114 , edgeAntialiasingMask(other.edgeAntialiasingMask) 115 , customAppearance(other.customAppearance) 116 , minificationFilter(other.minificationFilter) 117 , magnificationFilter(other.magnificationFilter) 118 , hidden(other.hidden) 119 , geometryFlipped(other.geometryFlipped) 120 , doubleSided(other.doubleSided) 121 , masksToBounds(other.masksToBounds) 122 , opaque(other.opaque) 123 { 124 if (other.transform) 125 transform = std::make_unique<TransformationMatrix>(*other.transform); 126 127 if (other.sublayerTransform) 128 sublayerTransform = std::make_unique<TransformationMatrix>(*other.sublayerTransform); 129 130 if (other.backingStore) 131 backingStore = std::make_unique<RemoteLayerBackingStore>(*other.backingStore); 132 133 if (other.filters) 134 filters = std::make_unique<FilterOperations>(*other.filters); 95 135 } 96 136 … … 127 167 128 168 if (changedProperties & TransformChanged) 129 encoder << transform;169 encoder << *transform; 130 170 131 171 if (changedProperties & SublayerTransformChanged) 132 encoder << sublayerTransform;172 encoder << *sublayerTransform; 133 173 134 174 if (changedProperties & HiddenChanged) … … 169 209 170 210 if (changedProperties & BackingStoreChanged) { 171 encoder << backingStore .hasFrontBuffer();172 if (backingStore .hasFrontBuffer())173 encoder << backingStore;211 encoder << backingStore->hasFrontBuffer(); 212 if (backingStore->hasFrontBuffer()) 213 encoder << *backingStore; 174 214 } 175 215 176 216 if (changedProperties & FiltersChanged) 177 encoder << filters;217 encoder << *filters; 178 218 179 219 if (changedProperties & EdgeAntialiasingMaskChanged) … … 240 280 241 281 if (result.changedProperties & TransformChanged) { 242 if (!decoder.decode(result.transform)) 243 return false; 282 TransformationMatrix transform; 283 if (!decoder.decode(transform)) 284 return false; 285 286 result.transform = std::make_unique<TransformationMatrix>(transform); 244 287 } 245 288 246 289 if (result.changedProperties & SublayerTransformChanged) { 247 if (!decoder.decode(result.sublayerTransform)) 248 return false; 290 TransformationMatrix transform; 291 if (!decoder.decode(transform)) 292 return false; 293 294 result.sublayerTransform = std::make_unique<TransformationMatrix>(transform); 249 295 } 250 296 … … 313 359 if (!decoder.decode(hasFrontBuffer)) 314 360 return false; 315 if (hasFrontBuffer && !decoder.decode(result.backingStore)) 316 return false; 361 if (hasFrontBuffer) { 362 RemoteLayerBackingStore backingStore; 363 if (!decoder.decode(backingStore)) 364 return false; 365 366 result.backingStore = std::make_unique<RemoteLayerBackingStore>(backingStore); 367 } 317 368 } 318 369 319 370 if (result.changedProperties & FiltersChanged) { 320 if (!decoder.decode(result.filters)) 321 return false; 371 std::unique_ptr<FilterOperations> filters = std::make_unique<FilterOperations>(); 372 if (!decoder.decode(*filters)) 373 return false; 374 result.filters = std::move(filters); 322 375 } 323 376 … … 347 400 encoder << m_rootLayerID; 348 401 encoder << m_createdLayers; 349 encoder << m_changedLayerProperties; 402 403 encoder << m_changedLayerProperties.size(); 404 405 for (const auto& layerProperties : m_changedLayerProperties) { 406 encoder << layerProperties.key; 407 encoder << *layerProperties.value; 408 } 409 350 410 encoder << m_destroyedLayerIDs; 351 411 encoder << m_contentsSize; … … 367 427 return false; 368 428 369 if (!decoder.decode(result.m_changedLayerProperties)) 370 return false; 429 int numChangedLayerProperties; 430 if (!decoder.decode(numChangedLayerProperties)) 431 return false; 432 433 for (int i = 0; i < numChangedLayerProperties; ++i) { 434 GraphicsLayer::PlatformLayerID layerID; 435 if (!decoder.decode(layerID)) 436 return false; 437 438 std::unique_ptr<LayerProperties> layerProperties = std::make_unique<LayerProperties>(); 439 if (!decoder.decode(*layerProperties)) 440 return false; 441 442 result.changedLayers().set(layerID, std::move(layerProperties)); 443 } 371 444 372 445 if (!decoder.decode(result.m_destroyedLayerIDs)) … … 408 481 void RemoteLayerTreeTransaction::layerPropertiesChanged(PlatformCALayerRemote* remoteLayer, RemoteLayerTreeTransaction::LayerProperties& properties) 409 482 { 410 m_changedLayerProperties.set(remoteLayer->layerID(), properties);483 m_changedLayerProperties.set(remoteLayer->layerID(), std::make_unique<RemoteLayerTreeTransaction::LayerProperties>(properties)); 411 484 } 412 485 … … 591 664 } 592 665 593 static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const HashMap<GraphicsLayer::PlatformLayerID, RemoteLayerTreeTransaction::LayerProperties>& changedLayerProperties)666 static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const RemoteLayerTreeTransaction::LayerPropertiesMap& changedLayerProperties) 594 667 { 595 668 if (changedLayerProperties.isEmpty()) … … 606 679 607 680 for (auto layerID : layerIDs) { 608 const RemoteLayerTreeTransaction::LayerProperties& layerProperties = changedLayerProperties.get(layerID);681 const RemoteLayerTreeTransaction::LayerProperties& layerProperties = *changedLayerProperties.get(layerID); 609 682 610 683 ts << "\n"; … … 641 714 642 715 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::TransformChanged) 643 dumpProperty<TransformationMatrix>(ts, "transform", layerProperties.transform );716 dumpProperty<TransformationMatrix>(ts, "transform", layerProperties.transform ? *layerProperties.transform : TransformationMatrix()); 644 717 645 718 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::SublayerTransformChanged) 646 dumpProperty<TransformationMatrix>(ts, "sublayerTransform", layerProperties.sublayerTransform );719 dumpProperty<TransformationMatrix>(ts, "sublayerTransform", layerProperties.sublayerTransform ? *layerProperties.sublayerTransform : TransformationMatrix()); 647 720 648 721 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::HiddenChanged) … … 683 756 684 757 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::BackingStoreChanged) 685 dumpProperty<IntSize>(ts, "backingStore", layerProperties.backingStore .size());758 dumpProperty<IntSize>(ts, "backingStore", layerProperties.backingStore ? layerProperties.backingStore->size() : IntSize()); 686 759 687 760 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::FiltersChanged) 688 dumpProperty<FilterOperations>(ts, "filters", layerProperties.filters );761 dumpProperty<FilterOperations>(ts, "filters", layerProperties.filters ? *layerProperties.filters : FilterOperations()); 689 762 690 763 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::EdgeAntialiasingMaskChanged) -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h
r163837 r164405 53 53 54 54 private: 55 CALayer *createLayer( RemoteLayerTreeTransaction::LayerCreationProperties);55 CALayer *createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties&); 56 56 57 57 CALayer *m_rootLayer; -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
r163959 r164405 69 69 for (auto& changedLayer : transaction.changedLayers()) { 70 70 auto layerID = changedLayer.key; 71 const auto& properties =changedLayer.value;71 const RemoteLayerTreeTransaction::LayerProperties& properties = *changedLayer.value; 72 72 73 73 CALayer *layer = getLayer(layerID); … … 108 108 } 109 109 110 CALayer *RemoteLayerTreeHost::createLayer( RemoteLayerTreeTransaction::LayerCreationPropertiesproperties)110 CALayer *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties& properties) 111 111 { 112 112 RetainPtr<CALayer>& layer = m_layers.add(properties.layerID, nullptr).iterator->value; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
r163959 r164405 68 68 } 69 69 70 PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemote::create(const PlatformCALayerRemote& other, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext* context) 71 { 72 RefPtr<PlatformCALayerRemote> layer = adoptRef(new PlatformCALayerRemote(other, owner, context)); 73 74 context->layerWasCreated(layer.get(), LayerTypeCustom); 75 76 return layer.release(); 77 } 78 70 79 PlatformCALayerRemote::PlatformCALayerRemote(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext* context) 71 80 : PlatformCALayer(layerType, owner) … … 77 86 } 78 87 88 PlatformCALayerRemote::PlatformCALayerRemote(const PlatformCALayerRemote& other, PlatformCALayerClient* owner, RemoteLayerTreeContext* context) 89 : PlatformCALayer(other.layerType(), owner) 90 , m_properties(other.m_properties) 91 , m_superlayer(nullptr) 92 , m_maskLayer(nullptr) 93 , m_acceleratesDrawing(other.acceleratesDrawing()) 94 , m_context(context) 95 { 96 } 97 79 98 PassRefPtr<PlatformCALayer> PlatformCALayerRemote::clone(PlatformCALayerClient* client) const 80 99 { 81 RefPtr<PlatformCALayerRemote> clone = PlatformCALayerRemote::create(layerType(), client, m_context); 82 83 clone->m_properties = m_properties; 100 RefPtr<PlatformCALayerRemote> clone = PlatformCALayerRemote::create(*this, client, m_context); 101 84 102 clone->m_properties.notePropertiesChanged(static_cast<RemoteLayerTreeTransaction::LayerChange>(m_properties.everChangedProperties & ~RemoteLayerTreeTransaction::BackingStoreChanged)); 85 103 … … 96 114 void PlatformCALayerRemote::recursiveBuildTransaction(RemoteLayerTreeTransaction& transaction) 97 115 { 98 if (m_properties.backingStore .display())116 if (m_properties.backingStore && m_properties.backingStore->display()) 99 117 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BackingStoreChanged); 100 118 … … 132 150 void PlatformCALayerRemote::ensureBackingStore() 133 151 { 134 m_properties.backingStore.ensureBackingStore(this, expandedIntSize(m_properties.size), m_properties.contentsScale, m_acceleratesDrawing); 152 if (!m_properties.backingStore) 153 m_properties.backingStore = std::make_unique<RemoteLayerBackingStore>(); 154 m_properties.backingStore->ensureBackingStore(this, expandedIntSize(m_properties.size), m_properties.contentsScale, m_acceleratesDrawing); 135 155 } 136 156 … … 140 160 141 161 if (!rect) { 142 m_properties.backingStore .setNeedsDisplay();162 m_properties.backingStore->setNeedsDisplay(); 143 163 return; 144 164 } 145 165 146 166 // FIXME: Need to map this through contentsRect/etc. 147 m_properties.backingStore .setNeedsDisplay(enclosingIntRect(*rect));167 m_properties.backingStore->setNeedsDisplay(enclosingIntRect(*rect)); 148 168 } 149 169 … … 318 338 TransformationMatrix PlatformCALayerRemote::transform() const 319 339 { 320 return m_properties.transform ;340 return m_properties.transform ? *m_properties.transform : TransformationMatrix(); 321 341 } 322 342 323 343 void PlatformCALayerRemote::setTransform(const TransformationMatrix& value) 324 344 { 325 m_properties.transform = value;345 m_properties.transform = std::make_unique<TransformationMatrix>(value); 326 346 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::TransformChanged); 327 347 } … … 329 349 TransformationMatrix PlatformCALayerRemote::sublayerTransform() const 330 350 { 331 return m_properties.sublayerTransform ;351 return m_properties.sublayerTransform ? *m_properties.sublayerTransform : TransformationMatrix(); 332 352 } 333 353 334 354 void PlatformCALayerRemote::setSublayerTransform(const TransformationMatrix& value) 335 355 { 336 m_properties.sublayerTransform = value;356 m_properties.sublayerTransform = std::make_unique<TransformationMatrix>(value); 337 357 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::SublayerTransformChanged); 338 358 } … … 447 467 void PlatformCALayerRemote::setFilters(const FilterOperations& filters) 448 468 { 449 m_properties.filters = filters;469 m_properties.filters = std::make_unique<FilterOperations>(filters); 450 470 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::FiltersChanged); 451 471 } … … 522 542 void PlatformCALayerRemote::enumerateRectsBeingDrawn(CGContextRef context, void (^block)(CGRect)) 523 543 { 524 m_properties.backingStore .enumerateRectsBeingDrawn(context, block);544 m_properties.backingStore->enumerateRectsBeingDrawn(context, block); 525 545 } 526 546 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
r163079 r164405 40 40 static PassRefPtr<PlatformCALayerRemote> create(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext*); 41 41 static PassRefPtr<PlatformCALayerRemote> create(PlatformLayer *, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext*); 42 static PassRefPtr<PlatformCALayerRemote> create(const PlatformCALayerRemote&, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext*); 42 43 43 44 virtual ~PlatformCALayerRemote(); … … 150 151 protected: 151 152 PlatformCALayerRemote(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext* context); 153 PlatformCALayerRemote(const PlatformCALayerRemote&, WebCore::PlatformCALayerClient*, RemoteLayerTreeContext*); 152 154 153 155 private:
Note:
See TracChangeset
for help on using the changeset viewer.