Changeset 141238 in webkit
- Timestamp:
- Jan 30, 2013 2:20:46 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141235 r141238 1 2013-01-30 Huang Dongsung <luxtella@company100.net> 2 3 [TexMap] Remove GraphicsLayer in TextureMapperLayer. 4 https://bugs.webkit.org/show_bug.cgi?id=107073 5 6 Reviewed by Noam Rosenthal. 7 8 Remove the dependency of TextureMapperLayer on GraphicsLayer. It is needed to 9 remove GraphicsLayerTextureMapper in LayerTreeRenderer. 10 11 This is in preparation for refactoring TextureMapper to work in an actor 12 model (http://webkit.org/b/103854). 13 14 Covered by existing tests. 15 16 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: 17 (WebCore::toTextureMapperLayer): 18 (WebCore): 19 (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper): 20 (WebCore::GraphicsLayerTextureMapper::notifyChange): 21 (WebCore::GraphicsLayerTextureMapper::setNeedsDisplay): 22 (WebCore::GraphicsLayerTextureMapper::setContentsNeedsDisplay): 23 Set BackgroundColorChange to m_changeMask instead of ContentChange. 24 (WebCore::GraphicsLayerTextureMapper::setNeedsDisplayInRect): 25 (WebCore::GraphicsLayerTextureMapper::setChildren): 26 (WebCore::GraphicsLayerTextureMapper::addChild): 27 (WebCore::GraphicsLayerTextureMapper::addChildAtIndex): 28 (WebCore::GraphicsLayerTextureMapper::addChildAbove): 29 (WebCore::GraphicsLayerTextureMapper::addChildBelow): 30 (WebCore::GraphicsLayerTextureMapper::replaceChild): 31 (WebCore::GraphicsLayerTextureMapper::setMaskLayer): 32 (WebCore::GraphicsLayerTextureMapper::setReplicatedByLayer): 33 (WebCore::GraphicsLayerTextureMapper::setPosition): 34 (WebCore::GraphicsLayerTextureMapper::setAnchorPoint): 35 (WebCore::GraphicsLayerTextureMapper::setSize): 36 (WebCore::GraphicsLayerTextureMapper::setTransform): 37 (WebCore::GraphicsLayerTextureMapper::setChildrenTransform): 38 (WebCore::GraphicsLayerTextureMapper::setPreserves3D): 39 (WebCore::GraphicsLayerTextureMapper::setMasksToBounds): 40 (WebCore::GraphicsLayerTextureMapper::setDrawsContent): 41 (WebCore::GraphicsLayerTextureMapper::setContentsVisible): 42 (WebCore::GraphicsLayerTextureMapper::setContentsOpaque): 43 (WebCore::GraphicsLayerTextureMapper::setBackfaceVisibility): 44 (WebCore::GraphicsLayerTextureMapper::setOpacity): 45 (WebCore::GraphicsLayerTextureMapper::setContentsRect): 46 (WebCore::GraphicsLayerTextureMapper::setContentsToSolidColor): 47 (WebCore::GraphicsLayerTextureMapper::setContentsToImage): 48 (WebCore::GraphicsLayerTextureMapper::setContentsToMedia): 49 (WebCore::GraphicsLayerTextureMapper::setShowDebugBorder): 50 (WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter): 51 (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly): 52 (WebCore::GraphicsLayerTextureMapper::prepareBackingStoreIfNeeded): 53 (WebCore::GraphicsLayerTextureMapper::updateDebugBorderAndRepaintCount): 54 (WebCore::GraphicsLayerTextureMapper::setDebugBorder): 55 (WebCore::toTextureMapperLayerVector): 56 (WebCore::GraphicsLayerTextureMapper::commitLayerChanges): 57 Flush pending changes into TextureMapperLayer. 58 (WebCore::GraphicsLayerTextureMapper::addAnimation): 59 (WebCore::GraphicsLayerTextureMapper::setAnimations): 60 (WebCore::GraphicsLayerTextureMapper::setFilters): 61 (WebCore::GraphicsLayerTextureMapper::setBackingStore): 62 (WebCore::GraphicsLayerTextureMapper::setFixedToViewport): 63 (WebCore::GraphicsLayerTextureMapper::setRepaintCount): 64 * platform/graphics/texmap/GraphicsLayerTextureMapper.h: 65 (GraphicsLayerTextureMapper): 66 (WebCore): 67 * platform/graphics/texmap/TextureMapperLayer.cpp: 68 (WebCore::TextureMapperLayer::setChildren): 69 (WebCore::TextureMapperLayer::setMaskLayer): 70 (WebCore): 71 (WebCore::TextureMapperLayer::setReplicaLayer): 72 (WebCore::TextureMapperLayer::setPosition): 73 (WebCore::TextureMapperLayer::setSize): 74 (WebCore::TextureMapperLayer::setAnchorPoint): 75 (WebCore::TextureMapperLayer::setPreserves3D): 76 (WebCore::TextureMapperLayer::setTransform): 77 (WebCore::TextureMapperLayer::setChildrenTransform): 78 (WebCore::TextureMapperLayer::setContentsRect): 79 (WebCore::TextureMapperLayer::setMasksToBounds): 80 (WebCore::TextureMapperLayer::setDrawsContent): 81 (WebCore::TextureMapperLayer::setContentsVisible): 82 (WebCore::TextureMapperLayer::setContentsOpaque): 83 (WebCore::TextureMapperLayer::setBackfaceVisibility): 84 (WebCore::TextureMapperLayer::setOpacity): 85 (WebCore::TextureMapperLayer::setSolidColor): 86 (WebCore::TextureMapperLayer::setFilters): 87 (WebCore::TextureMapperLayer::setDebugVisuals): 88 (WebCore::TextureMapperLayer::setRepaintCount): 89 (WebCore::TextureMapperLayer::setContentsLayer): 90 (WebCore::TextureMapperLayer::setAnimations): 91 (WebCore::TextureMapperLayer::setFixedToViewport): 92 (WebCore::TextureMapperLayer::setBackingStore): 93 * platform/graphics/texmap/TextureMapperLayer.h: 94 (WebCore): 95 (TextureMapperLayer): 96 (WebCore::TextureMapperLayer::TextureMapperLayer): 97 1 98 2013-01-30 Elliott Sprehn <esprehn@chromium.org> 2 99 -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r141232 r141238 29 29 namespace WebCore { 30 30 31 TextureMapperLayer* toTextureMapperLayer(GraphicsLayer* layer) 32 { 33 return layer ? toGraphicsLayerTextureMapper(layer)->layer() : 0; 34 } 35 31 36 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client) 32 37 { … … 46 51 , m_layer(adoptPtr(new TextureMapperLayer())) 47 52 , m_compositedNativeImagePtr(0) 48 , m_changeMask( 0)53 , m_changeMask(NoChanges) 49 54 , m_needsDisplay(false) 50 55 , m_hasOwnBackingStore(true) … … 56 61 } 57 62 58 void GraphicsLayerTextureMapper::notifyChange( TextureMapperLayer::ChangeMask changeMask)63 void GraphicsLayerTextureMapper::notifyChange(ChangeMask changeMask) 59 64 { 60 65 m_changeMask |= changeMask; … … 87 92 88 93 m_needsDisplay = true; 89 notifyChange( TextureMapperLayer::DisplayChange);94 notifyChange(DisplayChange); 90 95 addRepaintRect(FloatRect(FloatPoint(), m_size)); 91 96 } … … 95 100 void GraphicsLayerTextureMapper::setContentsNeedsDisplay() 96 101 { 97 notifyChange( TextureMapperLayer::DisplayChange);102 notifyChange(DisplayChange); 98 103 addRepaintRect(contentsRect()); 99 104 } … … 109 114 return; 110 115 m_needsDisplayRect.unite(rect); 111 notifyChange( TextureMapperLayer::DisplayChange);116 notifyChange(DisplayChange); 112 117 addRepaintRect(rect); 113 118 } … … 118 123 { 119 124 if (GraphicsLayer::setChildren(children)) { 120 notifyChange( TextureMapperLayer::ChildrenChange);125 notifyChange(ChildrenChange); 121 126 return true; 122 127 } … … 128 133 void GraphicsLayerTextureMapper::addChild(GraphicsLayer* layer) 129 134 { 130 notifyChange( TextureMapperLayer::ChildrenChange);135 notifyChange(ChildrenChange); 131 136 GraphicsLayer::addChild(layer); 132 137 } … … 137 142 { 138 143 GraphicsLayer::addChildAtIndex(layer, index); 139 notifyChange( TextureMapperLayer::ChildrenChange);144 notifyChange(ChildrenChange); 140 145 } 141 146 … … 144 149 void GraphicsLayerTextureMapper::addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling) 145 150 { 146 147 notifyChange(TextureMapperLayer::ChildrenChange);151 GraphicsLayer::addChildAbove(layer, sibling); 152 notifyChange(ChildrenChange); 148 153 } 149 154 … … 153 158 { 154 159 GraphicsLayer::addChildBelow(layer, sibling); 155 notifyChange( TextureMapperLayer::ChildrenChange);160 notifyChange(ChildrenChange); 156 161 } 157 162 … … 161 166 { 162 167 if (GraphicsLayer::replaceChild(oldChild, newChild)) { 163 notifyChange( TextureMapperLayer::ChildrenChange);168 notifyChange(ChildrenChange); 164 169 return true; 165 170 } … … 174 179 return; 175 180 GraphicsLayer::setMaskLayer(value); 176 notifyChange( TextureMapperLayer::MaskLayerChange);181 notifyChange(MaskLayerChange); 177 182 178 183 if (!value) … … 190 195 return; 191 196 GraphicsLayer::setReplicatedByLayer(value); 192 notifyChange( TextureMapperLayer::ReplicaLayerChange);197 notifyChange(ReplicaLayerChange); 193 198 } 194 199 … … 200 205 return; 201 206 GraphicsLayer::setPosition(value); 202 notifyChange( TextureMapperLayer::PositionChange);207 notifyChange(PositionChange); 203 208 } 204 209 … … 210 215 return; 211 216 GraphicsLayer::setAnchorPoint(value); 212 notifyChange( TextureMapperLayer::AnchorPointChange);217 notifyChange(AnchorPointChange); 213 218 } 214 219 … … 223 228 if (maskLayer()) 224 229 maskLayer()->setSize(value); 225 notifyChange( TextureMapperLayer::SizeChange);230 notifyChange(SizeChange); 226 231 } 227 232 … … 234 239 235 240 GraphicsLayer::setTransform(value); 236 notifyChange(T extureMapperLayer::TransformChange);241 notifyChange(TransformChange); 237 242 } 238 243 … … 244 249 return; 245 250 GraphicsLayer::setChildrenTransform(value); 246 notifyChange( TextureMapperLayer::ChildrenTransformChange);251 notifyChange(ChildrenTransformChange); 247 252 } 248 253 … … 254 259 return; 255 260 GraphicsLayer::setPreserves3D(value); 256 notifyChange( TextureMapperLayer::Preserves3DChange);261 notifyChange(Preserves3DChange); 257 262 } 258 263 … … 264 269 return; 265 270 GraphicsLayer::setMasksToBounds(value); 266 notifyChange( TextureMapperLayer::MasksToBoundsChange);271 notifyChange(MasksToBoundsChange); 267 272 } 268 273 … … 273 278 if (value == drawsContent()) 274 279 return; 275 notifyChange( TextureMapperLayer::DrawsContentChange);280 notifyChange(DrawsContentChange); 276 281 GraphicsLayer::setDrawsContent(value); 277 282 … … 286 291 if (value == contentsAreVisible()) 287 292 return; 288 notifyChange( TextureMapperLayer::ContentsVisibleChange);293 notifyChange(ContentsVisibleChange); 289 294 GraphicsLayer::setContentsVisible(value); 290 295 if (maskLayer()) … … 298 303 if (value == contentsOpaque()) 299 304 return; 300 notifyChange( TextureMapperLayer::ContentsOpaqueChange);305 notifyChange(ContentsOpaqueChange); 301 306 GraphicsLayer::setContentsOpaque(value); 302 307 } … … 309 314 return; 310 315 GraphicsLayer::setBackfaceVisibility(value); 311 notifyChange( TextureMapperLayer::BackfaceVisibilityChange);316 notifyChange(BackfaceVisibilityChange); 312 317 } 313 318 … … 319 324 return; 320 325 GraphicsLayer::setOpacity(value); 321 notifyChange( TextureMapperLayer::OpacityChange);326 notifyChange(OpacityChange); 322 327 } 323 328 … … 329 334 return; 330 335 GraphicsLayer::setContentsRect(value); 331 notifyChange( TextureMapperLayer::ContentsRectChange);336 notifyChange(ContentsRectChange); 332 337 } 333 338 … … 338 343 339 344 m_solidColor = color; 340 notifyChange( TextureMapperLayer::ContentChange);345 notifyChange(BackgroundColorChange); 341 346 } 342 347 … … 367 372 368 373 setContentsToMedia(m_compositedImage.get()); 369 notifyChange( TextureMapperLayer::ContentChange);374 notifyChange(ContentChange); 370 375 GraphicsLayer::setContentsToImage(image); 371 376 } … … 377 382 378 383 GraphicsLayer::setContentsToMedia(media); 379 notifyChange( TextureMapperLayer::ContentChange);384 notifyChange(ContentChange); 380 385 m_contentsLayer = media; 381 386 } … … 387 392 388 393 GraphicsLayer::setShowDebugBorder(show); 389 notifyChange( TextureMapperLayer::DebugVisualsChange);394 notifyChange(DebugVisualsChange); 390 395 } 391 396 … … 396 401 397 402 GraphicsLayer::setShowRepaintCounter(show); 398 notifyChange( TextureMapperLayer::DebugVisualsChange);403 notifyChange(DebugVisualsChange); 399 404 } 400 405 … … 404 409 { 405 410 prepareBackingStoreIfNeeded(); 406 m_layer->flushCompositingStateForThisLayerOnly(this); 411 commitLayerChanges(); 412 m_layer->syncAnimations(); 407 413 updateBackingStoreIfNeeded(); 408 didFlushCompositingState();409 414 } 410 415 … … 415 420 if (!shouldHaveBackingStore()) { 416 421 m_backingStore.clear(); 417 m_changeMask |= TextureMapperLayer::BackingStoreChange;422 m_changeMask |= BackingStoreChange; 418 423 } else { 419 424 if (!m_backingStore) { 420 425 m_backingStore = TextureMapperTiledBackingStore::create(); 421 m_changeMask |= TextureMapperLayer::BackingStoreChange;426 m_changeMask |= BackingStoreChange; 422 427 } 423 428 } … … 436 441 if (isShowingRepaintCounter() && needsToRepaint) { 437 442 incrementRepaintCount(); 438 m_changeMask |= TextureMapperLayer::RepaintCountChange;443 m_changeMask |= RepaintCountChange; 439 444 } 440 445 } … … 444 449 m_debugBorderColor = color; 445 450 m_debugBorderWidth = width; 446 m_changeMask |= TextureMapperLayer::DebugVisualsChange; 451 m_changeMask |= DebugVisualsChange; 452 } 453 454 static void toTextureMapperLayerVector(const Vector<GraphicsLayer*>& layers, Vector<TextureMapperLayer*>& texmapLayers) 455 { 456 texmapLayers.reserveCapacity(layers.size()); 457 for (size_t i = 0; i < layers.size(); ++i) 458 texmapLayers.append(toTextureMapperLayer(layers[i])); 459 } 460 461 void GraphicsLayerTextureMapper::commitLayerChanges() 462 { 463 if (m_changeMask == NoChanges) 464 return; 465 466 if (m_changeMask & ChildrenChange) { 467 Vector<TextureMapperLayer*> textureMapperLayerChildren; 468 toTextureMapperLayerVector(children(), textureMapperLayerChildren); 469 m_layer->setChildren(textureMapperLayerChildren); 470 } 471 472 if (m_changeMask & MaskLayerChange) 473 m_layer->setMaskLayer(toTextureMapperLayer(maskLayer())); 474 475 if (m_changeMask & ReplicaLayerChange) 476 m_layer->setReplicaLayer(toTextureMapperLayer(replicaLayer())); 477 478 if (m_changeMask & PositionChange) 479 m_layer->setPosition(position()); 480 481 if (m_changeMask & AnchorPointChange) 482 m_layer->setAnchorPoint(anchorPoint()); 483 484 if (m_changeMask & SizeChange) 485 m_layer->setSize(size()); 486 487 if (m_changeMask & TransformChange) 488 m_layer->setTransform(transform()); 489 490 if (m_changeMask & ChildrenTransformChange) 491 m_layer->setChildrenTransform(childrenTransform()); 492 493 if (m_changeMask & Preserves3DChange) 494 m_layer->setPreserves3D(preserves3D()); 495 496 if (m_changeMask & ContentsRectChange) 497 m_layer->setContentsRect(contentsRect()); 498 499 if (m_changeMask & MasksToBoundsChange) 500 m_layer->setMasksToBounds(masksToBounds()); 501 502 if (m_changeMask & DrawsContentChange) 503 m_layer->setDrawsContent(drawsContent()); 504 505 if (m_changeMask & ContentsVisibleChange) 506 m_layer->setContentsVisible(contentsAreVisible()); 507 508 if (m_changeMask & ContentsOpaqueChange) 509 m_layer->setContentsOpaque(contentsOpaque()); 510 511 if (m_changeMask & BackfaceVisibilityChange) 512 m_layer->setBackfaceVisibility(backfaceVisibility()); 513 514 if (m_changeMask & OpacityChange) 515 m_layer->setOpacity(opacity()); 516 517 if (m_changeMask & BackgroundColorChange) 518 m_layer->setSolidColor(solidColor()); 519 520 #if ENABLE(CSS_FILTERS) 521 if (m_changeMask & FilterChange) 522 m_layer->setFilters(filters()); 523 #endif 524 525 if (m_changeMask & BackingStoreChange) 526 m_layer->setBackingStore(m_backingStore); 527 528 if (m_changeMask & DebugVisualsChange) 529 m_layer->setDebugVisuals(isShowingDebugBorder(), debugBorderColor(), debugBorderWidth(), isShowingRepaintCounter()); 530 531 if (m_changeMask & RepaintCountChange) 532 m_layer->setRepaintCount(repaintCount()); 533 534 if (m_changeMask & ContentChange) 535 m_layer->setContentsLayer(platformLayer()); 536 537 if (m_changeMask & AnimationChange) 538 m_layer->setAnimations(m_animations); 539 540 if (m_changeMask & FixedToViewporChange) 541 m_layer->setFixedToViewport(fixedToViewport()); 542 543 m_changeMask = NoChanges; 447 544 } 448 545 … … 464 561 } 465 562 466 void GraphicsLayerTextureMapper::didFlushCompositingState()467 {468 m_changeMask = 0;469 }470 471 563 void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded() 472 564 { … … 520 612 521 613 m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, WTF::currentTime() - timeOffset, listsMatch)); 522 notifyChange( TextureMapperLayer::AnimationChange);614 notifyChange(AnimationChange); 523 615 m_animationStartedTimer.startOneShot(0); 524 616 return true; … … 528 620 { 529 621 m_animations = animations; 530 notifyChange( TextureMapperLayer::AnimationChange);622 notifyChange(AnimationChange); 531 623 } 532 624 … … 550 642 bool GraphicsLayerTextureMapper::setFilters(const FilterOperations& filters) 551 643 { 552 notifyChange( TextureMapperLayer::FilterChange);644 notifyChange(FilterChange); 553 645 return GraphicsLayer::setFilters(filters); 554 646 } … … 562 654 563 655 m_backingStore = backingStore; 564 notifyChange(TextureMapperLayer::BackingStoreChange); 656 notifyChange(BackingStoreChange); 657 } 658 659 void GraphicsLayerTextureMapper::setFixedToViewport(bool fixed) 660 { 661 if (m_fixedToViewport == fixed) 662 return; 663 664 m_fixedToViewport = fixed; 665 notifyChange(FixedToViewporChange); 565 666 } 566 667 … … 568 669 { 569 670 m_repaintCount = repaintCount; 570 notifyChange( TextureMapperLayer::RepaintCountChange);571 } 572 573 } 671 notifyChange(RepaintCountChange); 672 } 673 674 } -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
r141232 r141238 30 30 31 31 class GraphicsLayerTextureMapper : public GraphicsLayer { 32 friend class TextureMapperLayer;33 34 32 public: 35 33 explicit GraphicsLayerTextureMapper(GraphicsLayerClient*); … … 74 72 virtual PlatformLayer* platformLayer() const { return m_contentsLayer; } 75 73 76 void notifyChange(TextureMapperLayer::ChangeMask);77 74 inline int changeMask() const { return m_changeMask; } 78 75 … … 92 89 void setBackingStore(PassRefPtr<TextureMapperBackingStore>); 93 90 94 void setFixedToViewport(bool fixed) { m_fixedToViewport = fixed; }91 void setFixedToViewport(bool); 95 92 bool fixedToViewport() const { return m_fixedToViewport; } 96 93 … … 101 98 private: 102 99 virtual void willBeDestroyed(); 103 void didFlushCompositingState(); 100 101 void commitLayerChanges(); 104 102 void updateDebugBorderAndRepaintCount(); 105 103 void updateBackingStoreIfNeeded(); … … 107 105 bool shouldHaveBackingStore() const; 108 106 void animationStartedTimerFired(Timer<GraphicsLayerTextureMapper>*); 107 108 // This set of flags help us defer which properties of the layer have been 109 // modified by the compositor, so we can know what to look for in the next flush. 110 enum ChangeMask { 111 NoChanges = 0, 112 113 ChildrenChange = (1L << 1), 114 MaskLayerChange = (1L << 2), 115 ReplicaLayerChange = (1L << 3), 116 117 ContentChange = (1L << 4), 118 ContentsRectChange = (1L << 5), 119 ContentsVisibleChange = (1L << 6), 120 ContentsOpaqueChange = (1L << 7), 121 122 PositionChange = (1L << 8), 123 AnchorPointChange = (1L << 9), 124 SizeChange = (1L << 10), 125 TransformChange = (1L << 11), 126 ChildrenTransformChange = (1L << 12), 127 Preserves3DChange = (1L << 13), 128 129 MasksToBoundsChange = (1L << 14), 130 DrawsContentChange = (1L << 15), 131 OpacityChange = (1L << 16), 132 BackfaceVisibilityChange = (1L << 17), 133 134 BackingStoreChange = (1L << 18), 135 DisplayChange = (1L << 19), 136 ContentsDisplayChange = (1L << 20), 137 BackgroundColorChange = (1L << 21), 138 139 AnimationChange = (1L << 22), 140 FilterChange = (1L << 23), 141 142 DebugVisualsChange = (1L << 24), 143 RepaintCountChange = (1L << 25), 144 145 FixedToViewporChange = (1L << 26) 146 }; 147 void notifyChange(ChangeMask); 109 148 110 149 OwnPtr<TextureMapperLayer> m_layer; … … 133 172 } 134 173 174 TextureMapperLayer* toTextureMapperLayer(GraphicsLayer*); 175 135 176 } 136 177 #endif // GraphicsLayerTextureMapper_h -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r141232 r141238 22 22 23 23 #if USE(ACCELERATED_COMPOSITING) 24 25 #include "GraphicsLayerTextureMapper.h"26 24 27 25 namespace WebCore { … … 41 39 }; 42 40 43 TextureMapperLayer* toTextureMapperLayer(GraphicsLayer* layer)44 {45 return layer ? toGraphicsLayerTextureMapper(layer)->layer() : 0;46 }47 48 41 const TextureMapperLayer* TextureMapperLayer::rootLayer() const 49 42 { … … 393 386 } 394 387 395 void TextureMapperLayer::flushCompositingStateForThisLayerOnly(GraphicsLayerTextureMapper* graphicsLayer) 396 { 397 ASSERT(graphicsLayer); 398 int changeMask = graphicsLayer->changeMask(); 399 400 if (changeMask == NoChanges && graphicsLayer->m_animations.isEmpty()) 401 return; 402 403 if (changeMask & ChildrenChange) 404 setChildren(graphicsLayer->children()); 405 406 if (changeMask & MaskLayerChange) { 407 if (TextureMapperLayer* layer = toTextureMapperLayer(graphicsLayer->maskLayer())) 408 layer->m_effectTarget = this; 409 } 410 411 if (changeMask & ReplicaLayerChange) { 412 if (TextureMapperLayer* layer = toTextureMapperLayer(graphicsLayer->replicaLayer())) 413 layer->m_effectTarget = this; 414 } 415 416 if (changeMask & AnimationChange) 417 m_animations = graphicsLayer->m_animations; 418 419 if (changeMask & TransformChange) 420 m_shouldUpdateCurrentTransformFromGraphicsLayer = true; 421 422 if (changeMask & OpacityChange) 423 m_shouldUpdateCurrentOpacityFromGraphicsLayer = true; 424 425 #if ENABLE(CSS_FILTERS) 426 if (changeMask & FilterChange) 427 m_shouldUpdateCurrentFiltersFromGraphicsLayer = true; 428 #endif 429 430 if (changeMask & BackingStoreChange) 431 m_backingStore = graphicsLayer->m_backingStore; 432 433 if (changeMask & RepaintCountChange) 434 m_state.repaintCount = graphicsLayer->repaintCount(); 435 436 m_state.maskLayer = toTextureMapperLayer(graphicsLayer->maskLayer()); 437 m_state.replicaLayer = toTextureMapperLayer(graphicsLayer->replicaLayer()); 438 m_state.pos = graphicsLayer->position(); 439 m_state.anchorPoint = graphicsLayer->anchorPoint(); 440 m_state.size = graphicsLayer->size(); 441 m_state.transform = graphicsLayer->transform(); 442 m_state.contentsRect = graphicsLayer->contentsRect(); 443 m_state.preserves3D = graphicsLayer->preserves3D(); 444 m_state.masksToBounds = graphicsLayer->masksToBounds(); 445 m_state.drawsContent = graphicsLayer->drawsContent(); 446 m_state.contentsVisible = graphicsLayer->contentsAreVisible(); 447 m_state.contentsOpaque = graphicsLayer->contentsOpaque(); 448 m_state.backfaceVisibility = graphicsLayer->backfaceVisibility(); 449 m_state.childrenTransform = graphicsLayer->childrenTransform(); 450 m_state.opacity = graphicsLayer->opacity(); 451 m_state.solidColor = graphicsLayer->solidColor(); 452 #if ENABLE(CSS_FILTERS) 453 if (changeMask & FilterChange) 454 m_state.filters = graphicsLayer->filters(); 455 #endif 456 m_fixedToViewport = graphicsLayer->fixedToViewport(); 457 458 m_state.showDebugBorders = graphicsLayer->isShowingDebugBorder(); 459 m_state.debugBorderColor = toGraphicsLayerTextureMapper(graphicsLayer)->debugBorderColor(); 460 m_state.debugBorderWidth = toGraphicsLayerTextureMapper(graphicsLayer)->debugBorderWidth(); 461 m_state.showRepaintCounter = graphicsLayer->isShowingRepaintCounter(); 462 463 m_contentsLayer = graphicsLayer->platformLayer(); 464 465 m_currentTransform.setPosition(adjustedPosition()); 466 m_currentTransform.setAnchorPoint(m_state.anchorPoint); 467 m_currentTransform.setSize(m_state.size); 468 m_currentTransform.setFlattening(!m_state.preserves3D); 469 m_currentTransform.setChildrenTransform(m_state.childrenTransform); 470 471 syncAnimations(); 472 } 473 474 void TextureMapperLayer::setChildren(const Vector<GraphicsLayer*>& newChildren) 388 void TextureMapperLayer::setChildren(const Vector<TextureMapperLayer*>& newChildren) 475 389 { 476 390 removeAllChildren(); 477 for (size_t i = 0; i < newChildren.size(); ++i) { 478 TextureMapperLayer* child = toTextureMapperLayer(newChildren[i]); 479 ASSERT(child); 480 addChild(child); 481 } 391 for (size_t i = 0; i < newChildren.size(); ++i) 392 addChild(newChildren[i]); 482 393 } 483 394 … … 517 428 } 518 429 430 void TextureMapperLayer::setMaskLayer(TextureMapperLayer* maskLayer) 431 { 432 if (maskLayer) 433 maskLayer->m_effectTarget = this; 434 m_state.maskLayer = maskLayer; 435 } 436 437 void TextureMapperLayer::setReplicaLayer(TextureMapperLayer* replicaLayer) 438 { 439 if (replicaLayer) 440 replicaLayer->m_effectTarget = this; 441 m_state.replicaLayer = replicaLayer; 442 } 443 444 void TextureMapperLayer::setPosition(const FloatPoint& position) 445 { 446 m_state.pos = position; 447 m_currentTransform.setPosition(adjustedPosition()); 448 } 449 450 void TextureMapperLayer::setSize(const FloatSize& size) 451 { 452 m_state.size = size; 453 m_currentTransform.setSize(size); 454 } 455 456 void TextureMapperLayer::setAnchorPoint(const FloatPoint3D& anchorPoint) 457 { 458 m_state.anchorPoint = anchorPoint; 459 m_currentTransform.setAnchorPoint(anchorPoint); 460 } 461 462 void TextureMapperLayer::setPreserves3D(bool preserves3D) 463 { 464 m_state.preserves3D = preserves3D; 465 m_currentTransform.setFlattening(!preserves3D); 466 } 467 468 void TextureMapperLayer::setTransform(const TransformationMatrix& transform) 469 { 470 m_state.transform = transform; 471 m_currentTransform.setLocalTransform(transform); 472 } 473 474 void TextureMapperLayer::setChildrenTransform(const TransformationMatrix& childrenTransform) 475 { 476 m_state.childrenTransform = childrenTransform; 477 m_currentTransform.setChildrenTransform(childrenTransform); 478 } 479 480 void TextureMapperLayer::setContentsRect(const IntRect& contentsRect) 481 { 482 m_state.contentsRect = contentsRect; 483 } 484 485 void TextureMapperLayer::setMasksToBounds(bool masksToBounds) 486 { 487 m_state.masksToBounds = masksToBounds; 488 } 489 490 void TextureMapperLayer::setDrawsContent(bool drawsContent) 491 { 492 m_state.drawsContent = drawsContent; 493 } 494 495 void TextureMapperLayer::setContentsVisible(bool contentsVisible) 496 { 497 m_state.contentsVisible = contentsVisible; 498 } 499 500 void TextureMapperLayer::setContentsOpaque(bool contentsOpaque) 501 { 502 m_state.contentsOpaque = contentsOpaque; 503 } 504 505 void TextureMapperLayer::setBackfaceVisibility(bool backfaceVisibility) 506 { 507 m_state.backfaceVisibility = backfaceVisibility; 508 } 509 510 void TextureMapperLayer::setOpacity(float opacity) 511 { 512 m_state.opacity = opacity; 513 } 514 515 void TextureMapperLayer::setSolidColor(const Color& color) 516 { 517 m_state.solidColor = color; 518 } 519 520 #if ENABLE(CSS_FILTERS) 521 void TextureMapperLayer::setFilters(const FilterOperations& filters) 522 { 523 m_state.filters = filters; 524 } 525 #endif 526 527 void TextureMapperLayer::setDebugVisuals(bool showDebugBorders, const Color& debugBorderColor, float debugBorderWidth, bool showRepaintCounter) 528 { 529 m_state.showDebugBorders = showDebugBorders; 530 m_state.debugBorderColor = debugBorderColor; 531 m_state.debugBorderWidth = debugBorderWidth; 532 m_state.showRepaintCounter = showRepaintCounter; 533 } 534 535 void TextureMapperLayer::setRepaintCount(int repaintCount) 536 { 537 m_state.repaintCount = repaintCount; 538 } 539 540 void TextureMapperLayer::setContentsLayer(TextureMapperPlatformLayer* platformLayer) 541 { 542 m_contentsLayer = platformLayer; 543 } 544 545 void TextureMapperLayer::setAnimations(const GraphicsLayerAnimations& animations) 546 { 547 m_animations = animations; 548 } 549 550 void TextureMapperLayer::setFixedToViewport(bool fixedToViewport) 551 { 552 m_fixedToViewport = fixedToViewport; 553 } 554 555 void TextureMapperLayer::setBackingStore(PassRefPtr<TextureMapperBackingStore> backingStore) 556 { 557 m_backingStore = backingStore; 558 } 519 559 520 560 bool TextureMapperLayer::descendantsOrSelfHaveRunningAnimations() const -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
r141232 r141238 25 25 #include "FilterOperations.h" 26 26 #include "FloatRect.h" 27 #include "GraphicsLayer.h"28 27 #include "GraphicsLayerAnimation.h" 29 28 #include "GraphicsLayerTransform.h" … … 35 34 class TextureMapperPaintOptions; 36 35 class TextureMapperPlatformLayer; 37 class GraphicsLayerTextureMapper;38 36 39 37 class TextureMapperLayer : public GraphicsLayerAnimation::Client { … … 41 39 WTF_MAKE_FAST_ALLOCATED; 42 40 public: 43 // This set of flags help us defer which properties of the layer have been44 // modified by the compositor, so we can know what to look for in the next flush.45 enum ChangeMask {46 NoChanges = 0,47 48 ChildrenChange = (1L << 1),49 MaskLayerChange = (1L << 2),50 PositionChange = (1L << 3),51 52 AnchorPointChange = (1L << 4),53 SizeChange = (1L << 5),54 TransformChange = (1L << 6),55 ContentChange = (1L << 7),56 57 ContentsOrientationChange = (1L << 9),58 OpacityChange = (1L << 10),59 ContentsRectChange = (1L << 11),60 61 Preserves3DChange = (1L << 12),62 MasksToBoundsChange = (1L << 13),63 DrawsContentChange = (1L << 14),64 ContentsVisibleChange = (1L << 15),65 ContentsOpaqueChange = (1L << 16),66 67 BackfaceVisibilityChange = (1L << 17),68 ChildrenTransformChange = (1L << 18),69 DisplayChange = (1L << 19),70 BackgroundColorChange = (1L << 20),71 72 ReplicaLayerChange = (1L << 21),73 AnimationChange = (1L << 22),74 FilterChange = (1L << 23),75 76 DebugVisualsChange = (1L << 24),77 RepaintCountChange = (1L << 25),78 79 BackingStoreChange = (1L << 26)80 };81 82 41 TextureMapperLayer() 83 42 : m_parent(0) … … 92 51 #endif 93 52 , m_textureMapper(0) 53 , m_fixedToViewport(false) 94 54 { } 95 55 … … 97 57 98 58 TextureMapper* textureMapper() const; 99 void flushCompositingStateForThisLayerOnly(GraphicsLayerTextureMapper*);100 59 void setTextureMapper(TextureMapper* texmap) { m_textureMapper = texmap; } 60 61 void setChildren(const Vector<TextureMapperLayer*>&); 62 void setMaskLayer(TextureMapperLayer*); 63 void setReplicaLayer(TextureMapperLayer*); 64 void setPosition(const FloatPoint&); 65 void setSize(const FloatSize&); 66 void setAnchorPoint(const FloatPoint3D&); 67 void setPreserves3D(bool); 68 void setTransform(const TransformationMatrix&); 69 void setChildrenTransform(const TransformationMatrix&); 70 void setContentsRect(const IntRect&); 71 void setMasksToBounds(bool); 72 void setDrawsContent(bool); 73 void setContentsVisible(bool); 74 void setContentsOpaque(bool); 75 void setBackfaceVisibility(bool); 76 void setOpacity(float); 77 void setSolidColor(const Color&); 78 #if ENABLE(CSS_FILTERS) 79 void setFilters(const FilterOperations&); 80 #endif 81 void setDebugVisuals(bool showDebugBorders, const Color& debugBorderColor, float debugBorderWidth, bool showRepaintCounter); 82 void setRepaintCount(int); 83 void setContentsLayer(TextureMapperPlatformLayer*); 84 void setAnimations(const GraphicsLayerAnimations&); 85 void setFixedToViewport(bool); 86 void setBackingStore(PassRefPtr<TextureMapperBackingStore>); 87 88 void syncAnimations(); 101 89 bool descendantsOrSelfHaveRunningAnimations() const; 102 90 … … 120 108 bool isAncestorFixedToViewport() const; 121 109 122 void setChildren(const Vector<GraphicsLayer*>&);123 110 void addChild(TextureMapperLayer*); 124 111 void removeFromParent(); … … 137 124 #endif 138 125 139 void syncAnimations();140 126 bool isVisible() const; 141 127 enum ContentsLayerCount { … … 225 211 }; 226 212 227 228 TextureMapperLayer* toTextureMapperLayer(GraphicsLayer*);229 230 213 } 231 214 #endif -
trunk/Source/WebKit/efl/ChangeLog
r141110 r141238 1 2013-01-30 Huang Dongsung <luxtella@company100.net> 2 3 [TexMap] Remove GraphicsLayer in TextureMapperLayer. 4 https://bugs.webkit.org/show_bug.cgi?id=107073 5 6 Reviewed by Noam Rosenthal. 7 8 Include GraphicsLayerTextureMapper.h to use toTextureMapperLayer(). 9 10 * WebCoreSupport/AcceleratedCompositingContextEfl.cpp: 11 1 12 2013-01-29 Grzegorz Czajkowski <g.czajkowski@samsung.com> 2 13 -
trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp
r140261 r141238 26 26 #include "FrameView.h" 27 27 #include "GraphicsContext3D.h" 28 #include "GraphicsLayerTextureMapper.h" 28 29 #include "HostWindow.h" 29 30 #include "PageClientEfl.h" -
trunk/Source/WebKit/gtk/ChangeLog
r141126 r141238 1 2013-01-30 Huang Dongsung <luxtella@company100.net> 2 3 [TexMap] Remove GraphicsLayer in TextureMapperLayer. 4 https://bugs.webkit.org/show_bug.cgi?id=107073 5 6 Reviewed by Noam Rosenthal. 7 8 Include GraphicsLayerTextureMapper.h to use toTextureMapperLayer(). 9 10 * WebCoreSupport/AcceleratedCompositingContextGL.cpp: 11 1 12 2013-01-29 Mario Sanchez Prada <mario.prada@samsung.com> 2 13 -
trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextGL.cpp
r133517 r141238 27 27 #include "Frame.h" 28 28 #include "FrameView.h" 29 #include "GraphicsLayerTextureMapper.h" 29 30 #include "PlatformContextCairo.h" 30 31 #include "Settings.h" -
trunk/Source/WebKit/qt/ChangeLog
r141233 r141238 1 2013-01-30 Huang Dongsung <luxtella@company100.net> 2 3 [TexMap] Remove GraphicsLayer in TextureMapperLayer. 4 https://bugs.webkit.org/show_bug.cgi?id=107073 5 6 Reviewed by Noam Rosenthal. 7 8 Include GraphicsLayerTextureMapper.h to use toTextureMapperLayer(). 9 10 * WebCoreSupport/TextureMapperLayerClientQt.cpp: 11 1 12 2013-01-30 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 13 -
trunk/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp
r139526 r141238 26 26 27 27 #include "FrameView.h" 28 #include "GraphicsLayerTextureMapper.h" 28 29 #include "QWebFrameAdapter.h" 29 30 #include "QWebPageAdapter.h"
Note: See TracChangeset
for help on using the changeset viewer.