Changeset 141238 in webkit


Ignore:
Timestamp:
Jan 30, 2013 2:20:46 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[TexMap] Remove GraphicsLayer in TextureMapperLayer.
https://bugs.webkit.org/show_bug.cgi?id=107073

Patch by Huang Dongsung <luxtella@company100.net> on 2013-01-30
Reviewed by Noam Rosenthal.

Source/WebCore:

Remove the dependency of TextureMapperLayer on GraphicsLayer. It is needed to
remove GraphicsLayerTextureMapper in LayerTreeRenderer.

This is in preparation for refactoring TextureMapper to work in an actor
model (http://webkit.org/b/103854).

Covered by existing tests.

  • platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:

(WebCore::toTextureMapperLayer):
(WebCore):
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::notifyChange):
(WebCore::GraphicsLayerTextureMapper::setNeedsDisplay):
(WebCore::GraphicsLayerTextureMapper::setContentsNeedsDisplay):

Set BackgroundColorChange to m_changeMask instead of ContentChange.

(WebCore::GraphicsLayerTextureMapper::setNeedsDisplayInRect):
(WebCore::GraphicsLayerTextureMapper::setChildren):
(WebCore::GraphicsLayerTextureMapper::addChild):
(WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
(WebCore::GraphicsLayerTextureMapper::addChildAbove):
(WebCore::GraphicsLayerTextureMapper::addChildBelow):
(WebCore::GraphicsLayerTextureMapper::replaceChild):
(WebCore::GraphicsLayerTextureMapper::setMaskLayer):
(WebCore::GraphicsLayerTextureMapper::setReplicatedByLayer):
(WebCore::GraphicsLayerTextureMapper::setPosition):
(WebCore::GraphicsLayerTextureMapper::setAnchorPoint):
(WebCore::GraphicsLayerTextureMapper::setSize):
(WebCore::GraphicsLayerTextureMapper::setTransform):
(WebCore::GraphicsLayerTextureMapper::setChildrenTransform):
(WebCore::GraphicsLayerTextureMapper::setPreserves3D):
(WebCore::GraphicsLayerTextureMapper::setMasksToBounds):
(WebCore::GraphicsLayerTextureMapper::setDrawsContent):
(WebCore::GraphicsLayerTextureMapper::setContentsVisible):
(WebCore::GraphicsLayerTextureMapper::setContentsOpaque):
(WebCore::GraphicsLayerTextureMapper::setBackfaceVisibility):
(WebCore::GraphicsLayerTextureMapper::setOpacity):
(WebCore::GraphicsLayerTextureMapper::setContentsRect):
(WebCore::GraphicsLayerTextureMapper::setContentsToSolidColor):
(WebCore::GraphicsLayerTextureMapper::setContentsToImage):
(WebCore::GraphicsLayerTextureMapper::setContentsToMedia):
(WebCore::GraphicsLayerTextureMapper::setShowDebugBorder):
(WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter):
(WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
(WebCore::GraphicsLayerTextureMapper::prepareBackingStoreIfNeeded):
(WebCore::GraphicsLayerTextureMapper::updateDebugBorderAndRepaintCount):
(WebCore::GraphicsLayerTextureMapper::setDebugBorder):
(WebCore::toTextureMapperLayerVector):
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):

Flush pending changes into TextureMapperLayer.

(WebCore::GraphicsLayerTextureMapper::addAnimation):
(WebCore::GraphicsLayerTextureMapper::setAnimations):
(WebCore::GraphicsLayerTextureMapper::setFilters):
(WebCore::GraphicsLayerTextureMapper::setBackingStore):
(WebCore::GraphicsLayerTextureMapper::setFixedToViewport):
(WebCore::GraphicsLayerTextureMapper::setRepaintCount):

  • platform/graphics/texmap/GraphicsLayerTextureMapper.h:

(GraphicsLayerTextureMapper):
(WebCore):

  • platform/graphics/texmap/TextureMapperLayer.cpp:

(WebCore::TextureMapperLayer::setChildren):
(WebCore::TextureMapperLayer::setMaskLayer):
(WebCore):
(WebCore::TextureMapperLayer::setReplicaLayer):
(WebCore::TextureMapperLayer::setPosition):
(WebCore::TextureMapperLayer::setSize):
(WebCore::TextureMapperLayer::setAnchorPoint):
(WebCore::TextureMapperLayer::setPreserves3D):
(WebCore::TextureMapperLayer::setTransform):
(WebCore::TextureMapperLayer::setChildrenTransform):
(WebCore::TextureMapperLayer::setContentsRect):
(WebCore::TextureMapperLayer::setMasksToBounds):
(WebCore::TextureMapperLayer::setDrawsContent):
(WebCore::TextureMapperLayer::setContentsVisible):
(WebCore::TextureMapperLayer::setContentsOpaque):
(WebCore::TextureMapperLayer::setBackfaceVisibility):
(WebCore::TextureMapperLayer::setOpacity):
(WebCore::TextureMapperLayer::setSolidColor):
(WebCore::TextureMapperLayer::setFilters):
(WebCore::TextureMapperLayer::setDebugVisuals):
(WebCore::TextureMapperLayer::setRepaintCount):
(WebCore::TextureMapperLayer::setContentsLayer):
(WebCore::TextureMapperLayer::setAnimations):
(WebCore::TextureMapperLayer::setFixedToViewport):
(WebCore::TextureMapperLayer::setBackingStore):

  • platform/graphics/texmap/TextureMapperLayer.h:

(WebCore):
(TextureMapperLayer):
(WebCore::TextureMapperLayer::TextureMapperLayer):

Source/WebKit/efl:

Include GraphicsLayerTextureMapper.h to use toTextureMapperLayer().

  • WebCoreSupport/AcceleratedCompositingContextEfl.cpp:

Source/WebKit/gtk:

Include GraphicsLayerTextureMapper.h to use toTextureMapperLayer().

  • WebCoreSupport/AcceleratedCompositingContextGL.cpp:

Source/WebKit/qt:

Include GraphicsLayerTextureMapper.h to use toTextureMapperLayer().

  • WebCoreSupport/TextureMapperLayerClientQt.cpp:
Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141235 r141238  
     12013-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
    1982013-01-30  Elliott Sprehn  <esprehn@chromium.org>
    299
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp

    r141232 r141238  
    2929namespace WebCore {
    3030
     31TextureMapperLayer* toTextureMapperLayer(GraphicsLayer* layer)
     32{
     33    return layer ? toGraphicsLayerTextureMapper(layer)->layer() : 0;
     34}
     35
    3136PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client)
    3237{
     
    4651    , m_layer(adoptPtr(new TextureMapperLayer()))
    4752    , m_compositedNativeImagePtr(0)
    48     , m_changeMask(0)
     53    , m_changeMask(NoChanges)
    4954    , m_needsDisplay(false)
    5055    , m_hasOwnBackingStore(true)
     
    5661}
    5762
    58 void GraphicsLayerTextureMapper::notifyChange(TextureMapperLayer::ChangeMask changeMask)
     63void GraphicsLayerTextureMapper::notifyChange(ChangeMask changeMask)
    5964{
    6065    m_changeMask |= changeMask;
     
    8792
    8893    m_needsDisplay = true;
    89     notifyChange(TextureMapperLayer::DisplayChange);
     94    notifyChange(DisplayChange);
    9095    addRepaintRect(FloatRect(FloatPoint(), m_size));
    9196}
     
    95100void GraphicsLayerTextureMapper::setContentsNeedsDisplay()
    96101{
    97     notifyChange(TextureMapperLayer::DisplayChange);
     102    notifyChange(DisplayChange);
    98103    addRepaintRect(contentsRect());
    99104}
     
    109114        return;
    110115    m_needsDisplayRect.unite(rect);
    111     notifyChange(TextureMapperLayer::DisplayChange);
     116    notifyChange(DisplayChange);
    112117    addRepaintRect(rect);
    113118}
     
    118123{
    119124    if (GraphicsLayer::setChildren(children)) {
    120         notifyChange(TextureMapperLayer::ChildrenChange);
     125        notifyChange(ChildrenChange);
    121126        return true;
    122127    }
     
    128133void GraphicsLayerTextureMapper::addChild(GraphicsLayer* layer)
    129134{
    130     notifyChange(TextureMapperLayer::ChildrenChange);
     135    notifyChange(ChildrenChange);
    131136    GraphicsLayer::addChild(layer);
    132137}
     
    137142{
    138143    GraphicsLayer::addChildAtIndex(layer, index);
    139     notifyChange(TextureMapperLayer::ChildrenChange);
     144    notifyChange(ChildrenChange);
    140145}
    141146
     
    144149void GraphicsLayerTextureMapper::addChildAbove(GraphicsLayer* layer, GraphicsLayer* sibling)
    145150{
    146      GraphicsLayer::addChildAbove(layer, sibling);
    147      notifyChange(TextureMapperLayer::ChildrenChange);
     151    GraphicsLayer::addChildAbove(layer, sibling);
     152    notifyChange(ChildrenChange);
    148153}
    149154
     
    153158{
    154159    GraphicsLayer::addChildBelow(layer, sibling);
    155     notifyChange(TextureMapperLayer::ChildrenChange);
     160    notifyChange(ChildrenChange);
    156161}
    157162
     
    161166{
    162167    if (GraphicsLayer::replaceChild(oldChild, newChild)) {
    163         notifyChange(TextureMapperLayer::ChildrenChange);
     168        notifyChange(ChildrenChange);
    164169        return true;
    165170    }
     
    174179        return;
    175180    GraphicsLayer::setMaskLayer(value);
    176     notifyChange(TextureMapperLayer::MaskLayerChange);
     181    notifyChange(MaskLayerChange);
    177182
    178183    if (!value)
     
    190195        return;
    191196    GraphicsLayer::setReplicatedByLayer(value);
    192     notifyChange(TextureMapperLayer::ReplicaLayerChange);
     197    notifyChange(ReplicaLayerChange);
    193198}
    194199
     
    200205        return;
    201206    GraphicsLayer::setPosition(value);
    202     notifyChange(TextureMapperLayer::PositionChange);
     207    notifyChange(PositionChange);
    203208}
    204209
     
    210215        return;
    211216    GraphicsLayer::setAnchorPoint(value);
    212     notifyChange(TextureMapperLayer::AnchorPointChange);
     217    notifyChange(AnchorPointChange);
    213218}
    214219
     
    223228    if (maskLayer())
    224229        maskLayer()->setSize(value);
    225     notifyChange(TextureMapperLayer::SizeChange);
     230    notifyChange(SizeChange);
    226231}
    227232
     
    234239
    235240    GraphicsLayer::setTransform(value);
    236     notifyChange(TextureMapperLayer::TransformChange);
     241    notifyChange(TransformChange);
    237242}
    238243
     
    244249        return;
    245250    GraphicsLayer::setChildrenTransform(value);
    246     notifyChange(TextureMapperLayer::ChildrenTransformChange);
     251    notifyChange(ChildrenTransformChange);
    247252}
    248253
     
    254259        return;
    255260    GraphicsLayer::setPreserves3D(value);
    256     notifyChange(TextureMapperLayer::Preserves3DChange);
     261    notifyChange(Preserves3DChange);
    257262}
    258263
     
    264269        return;
    265270    GraphicsLayer::setMasksToBounds(value);
    266     notifyChange(TextureMapperLayer::MasksToBoundsChange);
     271    notifyChange(MasksToBoundsChange);
    267272}
    268273
     
    273278    if (value == drawsContent())
    274279        return;
    275     notifyChange(TextureMapperLayer::DrawsContentChange);
     280    notifyChange(DrawsContentChange);
    276281    GraphicsLayer::setDrawsContent(value);
    277282
     
    286291    if (value == contentsAreVisible())
    287292        return;
    288     notifyChange(TextureMapperLayer::ContentsVisibleChange);
     293    notifyChange(ContentsVisibleChange);
    289294    GraphicsLayer::setContentsVisible(value);
    290295    if (maskLayer())
     
    298303    if (value == contentsOpaque())
    299304        return;
    300     notifyChange(TextureMapperLayer::ContentsOpaqueChange);
     305    notifyChange(ContentsOpaqueChange);
    301306    GraphicsLayer::setContentsOpaque(value);
    302307}
     
    309314        return;
    310315    GraphicsLayer::setBackfaceVisibility(value);
    311     notifyChange(TextureMapperLayer::BackfaceVisibilityChange);
     316    notifyChange(BackfaceVisibilityChange);
    312317}
    313318
     
    319324        return;
    320325    GraphicsLayer::setOpacity(value);
    321     notifyChange(TextureMapperLayer::OpacityChange);
     326    notifyChange(OpacityChange);
    322327}
    323328
     
    329334        return;
    330335    GraphicsLayer::setContentsRect(value);
    331     notifyChange(TextureMapperLayer::ContentsRectChange);
     336    notifyChange(ContentsRectChange);
    332337}
    333338
     
    338343
    339344    m_solidColor = color;
    340     notifyChange(TextureMapperLayer::ContentChange);
     345    notifyChange(BackgroundColorChange);
    341346}
    342347
     
    367372
    368373    setContentsToMedia(m_compositedImage.get());
    369     notifyChange(TextureMapperLayer::ContentChange);
     374    notifyChange(ContentChange);
    370375    GraphicsLayer::setContentsToImage(image);
    371376}
     
    377382
    378383    GraphicsLayer::setContentsToMedia(media);
    379     notifyChange(TextureMapperLayer::ContentChange);
     384    notifyChange(ContentChange);
    380385    m_contentsLayer = media;
    381386}
     
    387392
    388393    GraphicsLayer::setShowDebugBorder(show);
    389     notifyChange(TextureMapperLayer::DebugVisualsChange);
     394    notifyChange(DebugVisualsChange);
    390395}
    391396
     
    396401
    397402    GraphicsLayer::setShowRepaintCounter(show);
    398     notifyChange(TextureMapperLayer::DebugVisualsChange);
     403    notifyChange(DebugVisualsChange);
    399404}
    400405
     
    404409{
    405410    prepareBackingStoreIfNeeded();
    406     m_layer->flushCompositingStateForThisLayerOnly(this);
     411    commitLayerChanges();
     412    m_layer->syncAnimations();
    407413    updateBackingStoreIfNeeded();
    408     didFlushCompositingState();
    409414}
    410415
     
    415420    if (!shouldHaveBackingStore()) {
    416421        m_backingStore.clear();
    417         m_changeMask |= TextureMapperLayer::BackingStoreChange;
     422        m_changeMask |= BackingStoreChange;
    418423    } else {
    419424        if (!m_backingStore) {
    420425            m_backingStore = TextureMapperTiledBackingStore::create();
    421             m_changeMask |= TextureMapperLayer::BackingStoreChange;
     426            m_changeMask |= BackingStoreChange;
    422427        }
    423428    }
     
    436441    if (isShowingRepaintCounter() && needsToRepaint) {
    437442        incrementRepaintCount();
    438         m_changeMask |= TextureMapperLayer::RepaintCountChange;
     443        m_changeMask |= RepaintCountChange;
    439444    }
    440445}
     
    444449    m_debugBorderColor = color;
    445450    m_debugBorderWidth = width;
    446     m_changeMask |= TextureMapperLayer::DebugVisualsChange;
     451    m_changeMask |= DebugVisualsChange;
     452}
     453
     454static 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
     461void 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;
    447544}
    448545
     
    464561}
    465562
    466 void GraphicsLayerTextureMapper::didFlushCompositingState()
    467 {
    468     m_changeMask = 0;
    469 }
    470 
    471563void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded()
    472564{
     
    520612
    521613    m_animations.add(GraphicsLayerAnimation(keyframesName, valueList, boxSize, anim, WTF::currentTime() - timeOffset, listsMatch));
    522     notifyChange(TextureMapperLayer::AnimationChange);
     614    notifyChange(AnimationChange);
    523615    m_animationStartedTimer.startOneShot(0);
    524616    return true;
     
    528620{
    529621    m_animations = animations;
    530     notifyChange(TextureMapperLayer::AnimationChange);
     622    notifyChange(AnimationChange);
    531623}
    532624
     
    550642bool GraphicsLayerTextureMapper::setFilters(const FilterOperations& filters)
    551643{
    552     notifyChange(TextureMapperLayer::FilterChange);
     644    notifyChange(FilterChange);
    553645    return GraphicsLayer::setFilters(filters);
    554646}
     
    562654
    563655    m_backingStore = backingStore;
    564     notifyChange(TextureMapperLayer::BackingStoreChange);
     656    notifyChange(BackingStoreChange);
     657}
     658
     659void GraphicsLayerTextureMapper::setFixedToViewport(bool fixed)
     660{
     661    if (m_fixedToViewport == fixed)
     662        return;
     663
     664    m_fixedToViewport = fixed;
     665    notifyChange(FixedToViewporChange);
    565666}
    566667
     
    568669{
    569670    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  
    3030
    3131class GraphicsLayerTextureMapper : public GraphicsLayer {
    32     friend class TextureMapperLayer;
    33 
    3432public:
    3533    explicit GraphicsLayerTextureMapper(GraphicsLayerClient*);
     
    7472    virtual PlatformLayer* platformLayer() const { return m_contentsLayer; }
    7573
    76     void notifyChange(TextureMapperLayer::ChangeMask);
    7774    inline int changeMask() const { return m_changeMask; }
    7875
     
    9289    void setBackingStore(PassRefPtr<TextureMapperBackingStore>);
    9390
    94     void setFixedToViewport(bool fixed) { m_fixedToViewport = fixed; }
     91    void setFixedToViewport(bool);
    9592    bool fixedToViewport() const { return m_fixedToViewport; }
    9693
     
    10198private:
    10299    virtual void willBeDestroyed();
    103     void didFlushCompositingState();
     100
     101    void commitLayerChanges();
    104102    void updateDebugBorderAndRepaintCount();
    105103    void updateBackingStoreIfNeeded();
     
    107105    bool shouldHaveBackingStore() const;
    108106    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);
    109148
    110149    OwnPtr<TextureMapperLayer> m_layer;
     
    133172}
    134173
     174TextureMapperLayer* toTextureMapperLayer(GraphicsLayer*);
     175
    135176}
    136177#endif // GraphicsLayerTextureMapper_h
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp

    r141232 r141238  
    2222
    2323#if USE(ACCELERATED_COMPOSITING)
    24 
    25 #include "GraphicsLayerTextureMapper.h"
    2624
    2725namespace WebCore {
     
    4139};
    4240
    43 TextureMapperLayer* toTextureMapperLayer(GraphicsLayer* layer)
    44 {
    45     return layer ? toGraphicsLayerTextureMapper(layer)->layer() : 0;
    46 }
    47 
    4841const TextureMapperLayer* TextureMapperLayer::rootLayer() const
    4942{
     
    393386}
    394387
    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)
     388void TextureMapperLayer::setChildren(const Vector<TextureMapperLayer*>& newChildren)
    475389{
    476390    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]);
    482393}
    483394
     
    517428}
    518429
     430void TextureMapperLayer::setMaskLayer(TextureMapperLayer* maskLayer)
     431{
     432    if (maskLayer)
     433        maskLayer->m_effectTarget = this;
     434    m_state.maskLayer = maskLayer;
     435}
     436
     437void TextureMapperLayer::setReplicaLayer(TextureMapperLayer* replicaLayer)
     438{
     439    if (replicaLayer)
     440        replicaLayer->m_effectTarget = this;
     441    m_state.replicaLayer = replicaLayer;
     442}
     443
     444void TextureMapperLayer::setPosition(const FloatPoint& position)
     445{
     446    m_state.pos = position;
     447    m_currentTransform.setPosition(adjustedPosition());
     448}
     449
     450void TextureMapperLayer::setSize(const FloatSize& size)
     451{
     452    m_state.size = size;
     453    m_currentTransform.setSize(size);
     454}
     455
     456void TextureMapperLayer::setAnchorPoint(const FloatPoint3D& anchorPoint)
     457{
     458    m_state.anchorPoint = anchorPoint;
     459    m_currentTransform.setAnchorPoint(anchorPoint);
     460}
     461
     462void TextureMapperLayer::setPreserves3D(bool preserves3D)
     463{
     464    m_state.preserves3D = preserves3D;
     465    m_currentTransform.setFlattening(!preserves3D);
     466}
     467
     468void TextureMapperLayer::setTransform(const TransformationMatrix& transform)
     469{
     470    m_state.transform = transform;
     471    m_currentTransform.setLocalTransform(transform);
     472}
     473
     474void TextureMapperLayer::setChildrenTransform(const TransformationMatrix& childrenTransform)
     475{
     476    m_state.childrenTransform = childrenTransform;
     477    m_currentTransform.setChildrenTransform(childrenTransform);
     478}
     479
     480void TextureMapperLayer::setContentsRect(const IntRect& contentsRect)
     481{
     482    m_state.contentsRect = contentsRect;
     483}
     484
     485void TextureMapperLayer::setMasksToBounds(bool masksToBounds)
     486{
     487    m_state.masksToBounds = masksToBounds;
     488}
     489
     490void TextureMapperLayer::setDrawsContent(bool drawsContent)
     491{
     492    m_state.drawsContent = drawsContent;
     493}
     494
     495void TextureMapperLayer::setContentsVisible(bool contentsVisible)
     496{
     497    m_state.contentsVisible = contentsVisible;
     498}
     499
     500void TextureMapperLayer::setContentsOpaque(bool contentsOpaque)
     501{
     502    m_state.contentsOpaque = contentsOpaque;
     503}
     504
     505void TextureMapperLayer::setBackfaceVisibility(bool backfaceVisibility)
     506{
     507    m_state.backfaceVisibility = backfaceVisibility;
     508}
     509
     510void TextureMapperLayer::setOpacity(float opacity)
     511{
     512    m_state.opacity = opacity;
     513}
     514
     515void TextureMapperLayer::setSolidColor(const Color& color)
     516{
     517    m_state.solidColor = color;
     518}
     519
     520#if ENABLE(CSS_FILTERS)
     521void TextureMapperLayer::setFilters(const FilterOperations& filters)
     522{
     523    m_state.filters = filters;
     524}
     525#endif
     526
     527void 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
     535void TextureMapperLayer::setRepaintCount(int repaintCount)
     536{
     537    m_state.repaintCount = repaintCount;
     538}
     539
     540void TextureMapperLayer::setContentsLayer(TextureMapperPlatformLayer* platformLayer)
     541{
     542    m_contentsLayer = platformLayer;
     543}
     544
     545void TextureMapperLayer::setAnimations(const GraphicsLayerAnimations& animations)
     546{
     547    m_animations = animations;
     548}
     549
     550void TextureMapperLayer::setFixedToViewport(bool fixedToViewport)
     551{
     552    m_fixedToViewport = fixedToViewport;
     553}
     554
     555void TextureMapperLayer::setBackingStore(PassRefPtr<TextureMapperBackingStore> backingStore)
     556{
     557    m_backingStore = backingStore;
     558}
    519559
    520560bool TextureMapperLayer::descendantsOrSelfHaveRunningAnimations() const
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h

    r141232 r141238  
    2525#include "FilterOperations.h"
    2626#include "FloatRect.h"
    27 #include "GraphicsLayer.h"
    2827#include "GraphicsLayerAnimation.h"
    2928#include "GraphicsLayerTransform.h"
     
    3534class TextureMapperPaintOptions;
    3635class TextureMapperPlatformLayer;
    37 class GraphicsLayerTextureMapper;
    3836
    3937class TextureMapperLayer : public GraphicsLayerAnimation::Client {
     
    4139    WTF_MAKE_FAST_ALLOCATED;
    4240public:
    43     // This set of flags help us defer which properties of the layer have been
    44     // 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 
    8241    TextureMapperLayer()
    8342        : m_parent(0)
     
    9251#endif
    9352        , m_textureMapper(0)
     53        , m_fixedToViewport(false)
    9454    { }
    9555
     
    9757
    9858    TextureMapper* textureMapper() const;
    99     void flushCompositingStateForThisLayerOnly(GraphicsLayerTextureMapper*);
    10059    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();
    10189    bool descendantsOrSelfHaveRunningAnimations() const;
    10290
     
    120108    bool isAncestorFixedToViewport() const;
    121109
    122     void setChildren(const Vector<GraphicsLayer*>&);
    123110    void addChild(TextureMapperLayer*);
    124111    void removeFromParent();
     
    137124#endif
    138125
    139     void syncAnimations();
    140126    bool isVisible() const;
    141127    enum ContentsLayerCount {
     
    225211};
    226212
    227 
    228 TextureMapperLayer* toTextureMapperLayer(GraphicsLayer*);
    229 
    230213}
    231214#endif
  • trunk/Source/WebKit/efl/ChangeLog

    r141110 r141238  
     12013-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
    1122013-01-29  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
    213
  • trunk/Source/WebKit/efl/WebCoreSupport/AcceleratedCompositingContextEfl.cpp

    r140261 r141238  
    2626#include "FrameView.h"
    2727#include "GraphicsContext3D.h"
     28#include "GraphicsLayerTextureMapper.h"
    2829#include "HostWindow.h"
    2930#include "PageClientEfl.h"
  • trunk/Source/WebKit/gtk/ChangeLog

    r141126 r141238  
     12013-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
    1122013-01-29  Mario Sanchez Prada  <mario.prada@samsung.com>
    213
  • trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextGL.cpp

    r133517 r141238  
    2727#include "Frame.h"
    2828#include "FrameView.h"
     29#include "GraphicsLayerTextureMapper.h"
    2930#include "PlatformContextCairo.h"
    3031#include "Settings.h"
  • trunk/Source/WebKit/qt/ChangeLog

    r141233 r141238  
     12013-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
    1122013-01-30  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    213
  • trunk/Source/WebKit/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp

    r139526 r141238  
    2626
    2727#include "FrameView.h"
     28#include "GraphicsLayerTextureMapper.h"
    2829#include "QWebFrameAdapter.h"
    2930#include "QWebPageAdapter.h"
Note: See TracChangeset for help on using the changeset viewer.