Changeset 147443 in webkit


Ignore:
Timestamp:
Apr 2, 2013 10:16:14 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK][AC] Support preserves3D css property for clutter ac backend.
https://bugs.webkit.org/show_bug.cgi?id=113318

Patch by ChangSeok Oh <ChangSeok Oh> on 2013-04-02
Reviewed by Gustavo Noronha Silva.

This patch brings preserve-3D css property support to WebKitGtk+ with clutter ac backed.
Most of the code is based on Mac port's implementation. The core concept is that
if a layer has preserve-3d property false, we mark itself and its immediate children
to make them flatten. And then we remove 3D factor in a modelView matrix
when applying it to each actor.

No new tests as this is covered with existing AC tests.

  • platform/graphics/clutter/GraphicsLayerActor.cpp:

(_GraphicsLayerActorPrivate):
(graphics_layer_actor_init):
(graphicsLayerActorApplyTransform):
(graphicsLayerActorNew):
(graphicsLayerActorRemoveFromSuperLayer):
(graphicsLayerActorSetDrawsContent):
(graphicsLayerActorSetFlatten):

  • platform/graphics/clutter/GraphicsLayerActor.h:
  • platform/graphics/clutter/GraphicsLayerClutter.cpp:

(WebCore::GraphicsLayerClutter::~GraphicsLayerClutter):
(WebCore::GraphicsLayerClutter::platformLayer):
(WebCore::GraphicsLayerClutter::moveOrCopyAnimations):
(WebCore):
(WebCore::GraphicsLayerClutter::setPreserves3D):
(WebCore::GraphicsLayerClutter::flushCompositingState):
(WebCore::GraphicsLayerClutter::recursiveCommitChanges):
(WebCore::GraphicsLayerClutter::commitLayerChangesAfterSublayers):
(WebCore::GraphicsLayerClutter::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerClutter::updateGeometry):
(WebCore::GraphicsLayerClutter::updateSublayerList):
(WebCore::GraphicsLayerClutter::updateStructuralLayer):
(WebCore::GraphicsLayerClutter::ensureStructuralLayer):
(WebCore::GraphicsLayerClutter::structuralLayerPurpose):
(WebCore::GraphicsLayerClutter::layerForSuperlayer):

  • platform/graphics/clutter/GraphicsLayerClutter.h:

(CommitState):
(WebCore::GraphicsLayerClutter::CommitState::CommitState):
(GraphicsLayerClutter):
(WebCore::GraphicsLayerClutter::primaryLayer):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147441 r147443  
     12013-04-02  ChangSeok Oh  <changseok.oh@collabora.com>
     2
     3        [GTK][AC] Support preserves3D css property for clutter ac backend.
     4        https://bugs.webkit.org/show_bug.cgi?id=113318
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        This patch brings preserve-3D css property support to WebKitGtk+ with clutter ac backed.
     9        Most of the code is based on Mac port's implementation. The core concept is that
     10        if a layer has preserve-3d property false, we mark itself and its immediate children
     11        to make them flatten. And then we remove 3D factor in a modelView matrix
     12        when applying it to each actor.
     13
     14        No new tests as this is covered with existing AC tests.
     15
     16        * platform/graphics/clutter/GraphicsLayerActor.cpp:
     17        (_GraphicsLayerActorPrivate):
     18        (graphics_layer_actor_init):
     19        (graphicsLayerActorApplyTransform):
     20        (graphicsLayerActorNew):
     21        (graphicsLayerActorRemoveFromSuperLayer):
     22        (graphicsLayerActorSetDrawsContent):
     23        (graphicsLayerActorSetFlatten):
     24        * platform/graphics/clutter/GraphicsLayerActor.h:
     25        * platform/graphics/clutter/GraphicsLayerClutter.cpp:
     26        (WebCore::GraphicsLayerClutter::~GraphicsLayerClutter):
     27        (WebCore::GraphicsLayerClutter::platformLayer):
     28        (WebCore::GraphicsLayerClutter::moveOrCopyAnimations):
     29        (WebCore):
     30        (WebCore::GraphicsLayerClutter::setPreserves3D):
     31        (WebCore::GraphicsLayerClutter::flushCompositingState):
     32        (WebCore::GraphicsLayerClutter::recursiveCommitChanges):
     33        (WebCore::GraphicsLayerClutter::commitLayerChangesAfterSublayers):
     34        (WebCore::GraphicsLayerClutter::commitLayerChangesBeforeSublayers):
     35        (WebCore::GraphicsLayerClutter::updateGeometry):
     36        (WebCore::GraphicsLayerClutter::updateSublayerList):
     37        (WebCore::GraphicsLayerClutter::updateStructuralLayer):
     38        (WebCore::GraphicsLayerClutter::ensureStructuralLayer):
     39        (WebCore::GraphicsLayerClutter::structuralLayerPurpose):
     40        (WebCore::GraphicsLayerClutter::layerForSuperlayer):
     41        * platform/graphics/clutter/GraphicsLayerClutter.h:
     42        (CommitState):
     43        (WebCore::GraphicsLayerClutter::CommitState::CommitState):
     44        (GraphicsLayerClutter):
     45        (WebCore::GraphicsLayerClutter::primaryLayer):
     46
    1472013-04-02  Adam Klein  <adamk@chromium.org>
    248
  • trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.cpp

    r147145 r147443  
    2929#include "PlatformContextCairo.h"
    3030#include "RefPtrCairo.h"
     31#include "TransformationMatrix.h"
    3132#include <wtf/text/CString.h>
    3233
     
    4546    PlatformClutterLayerClient* layerClient;
    4647
    47     gboolean drawsContent;
     48    bool flatten;
     49    bool drawsContent;
    4850
    4951    float scrollX;
     
    102104
    103105    clutter_actor_set_reactive(CLUTTER_ACTOR(self), FALSE);
     106
     107    self->priv->flatten = true;
    104108
    105109    // Default used by GraphicsLayer.
     
    203207        cogl_matrix_translate(matrix, translateX, translateY, 0);
    204208
    205     CLUTTER_ACTOR_CLASS(graphics_layer_actor_parent_class)->apply_transform(actor, matrix);
     209    CoglMatrix modelViewTransform = TransformationMatrix();
     210    CLUTTER_ACTOR_CLASS(graphics_layer_actor_parent_class)->apply_transform(actor, &modelViewTransform);
     211
     212    if (priv->flatten)
     213        modelViewTransform = TransformationMatrix(&modelViewTransform).to2dTransform();
     214    cogl_matrix_multiply(matrix, matrix, &modelViewTransform);
    206215}
    207216
     
    300309{
    301310    GraphicsLayerActor* layer = GRAPHICS_LAYER_ACTOR(g_object_new(GRAPHICS_LAYER_TYPE_ACTOR, 0));
    302     layer->priv->layerType = type;
     311    GraphicsLayerActorPrivate* priv = layer->priv;
     312
     313    priv->layerType = type;
     314    if (priv->layerType == GraphicsLayerClutter::LayerTypeTransformLayer)
     315        priv->flatten = false;
    303316
    304317    return layer;
     
    437450}
    438451
     452void graphicsLayerActorRemoveFromSuperLayer(GraphicsLayerActor* layer)
     453{
     454    ClutterActor* actor = CLUTTER_ACTOR(layer);
     455    ClutterActor* parentActor = clutter_actor_get_parent(actor);
     456    if (!parentActor)
     457        return;
     458
     459    clutter_actor_remove_child(parentActor, actor);
     460}
     461
    439462GraphicsLayerClutter::LayerType graphicsLayerActorGetLayerType(GraphicsLayerActor* layer)
    440463{
     
    475498}
    476499
    477 void graphicsLayerActorSetDrawsContent(GraphicsLayerActor* layer, gboolean drawsContent)
     500void graphicsLayerActorSetDrawsContent(GraphicsLayerActor* layer, bool drawsContent)
    478501{
    479502    GraphicsLayerActorPrivate* priv = layer->priv;
     
    492515}
    493516
     517void graphicsLayerActorSetFlatten(GraphicsLayerActor* layer, bool flatten)
     518{
     519    GraphicsLayerActorPrivate* priv = layer->priv;
     520    if (flatten == priv->flatten)
     521        return;
     522
     523    priv->flatten = flatten;
     524}
     525
    494526WebCore::PlatformClutterAnimation* graphicsLayerActorGetAnimationForKey(GraphicsLayerActor* layer, const String key)
    495527{
  • trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.h

    r147145 r147443  
    9090float graphicsLayerActorGetTranslateY(GraphicsLayerActor*);
    9191gint graphicsLayerActorGetnChildren(GraphicsLayerActor*);
     92void graphicsLayerActorRemoveFromSuperLayer(GraphicsLayerActor*);
    9293WebCore::GraphicsLayerClutter::LayerType graphicsLayerActorGetLayerType(GraphicsLayerActor*);
    9394void graphicsLayerActorSetLayerType(GraphicsLayerActor*, WebCore::GraphicsLayerClutter::LayerType);
     95void graphicsLayerActorReplaceSublayer(GraphicsLayerActor*, ClutterActor*, ClutterActor*);
    9496void graphicsLayerActorSetSublayers(GraphicsLayerActor*, WebCore::GraphicsLayerActorList&);
    9597gboolean graphicsLayerActorGetDrawsContent(GraphicsLayerActor*);
    96 void graphicsLayerActorSetDrawsContent(GraphicsLayerActor*, gboolean drawsContent);
     98void graphicsLayerActorSetDrawsContent(GraphicsLayerActor*, bool drawsContent);
     99void graphicsLayerActorSetFlatten(GraphicsLayerActor*, bool flatten);
    97100
    98101WebCore::PlatformClutterAnimation* graphicsLayerActorGetAnimationForKey(GraphicsLayerActor*, const String);
  • trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp

    r147145 r147443  
    4141#include "ScaleTransformOperation.h"
    4242#include "TransformState.h"
     43#include "TransformationMatrix.h"
    4344#include "TranslateTransformOperation.h"
    4445#include <limits.h>
     
    298299        g_idle_add(idleDestroy, m_layer.leakRef());
    299300    }
     301
     302    if (m_structuralLayer) {
     303        graphicsLayerActorSetClient(m_structuralLayer.get(), 0);
     304        g_idle_add(idleDestroy, m_structuralLayer.leakRef());
     305    }
    300306}
    301307
     
    309315ClutterActor* GraphicsLayerClutter::platformLayer() const
    310316{
    311     return CLUTTER_ACTOR(m_layer.get());
     317    return CLUTTER_ACTOR(primaryLayer());
    312318}
    313319
     
    387393    GraphicsLayer::setTransform(t);
    388394    noteLayerPropertyChanged(TransformChanged);
     395}
     396
     397void GraphicsLayerClutter::moveOrCopyAnimations(MoveOrCopy operation, GraphicsLayerActor* fromLayer, GraphicsLayerActor* toLayer)
     398{
     399    notImplemented();
     400}
     401
     402void GraphicsLayerClutter::setPreserves3D(bool preserves3D)
     403{
     404    if (preserves3D == m_preserves3D)
     405        return;
     406
     407    GraphicsLayer::setPreserves3D(preserves3D);
     408    noteLayerPropertyChanged(Preserves3DChanged);
    389409}
    390410
     
    555575{
    556576    TransformState state(TransformState::UnapplyInverseTransformDirection, FloatQuad(clipRect));
    557     recursiveCommitChanges(state);
    558 }
    559 
    560 void GraphicsLayerClutter::recursiveCommitChanges(const TransformState& state, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale)
    561 {
    562     // FIXME: Save the state before sending down to kids and restore it after
    563     TransformState localState = state;
    564 
     577    recursiveCommitChanges(CommitState(), state);
     578}
     579
     580void GraphicsLayerClutter::recursiveCommitChanges(const CommitState& commitState, const TransformState& state, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale)
     581{
    565582    if (appliesPageScale()) {
    566583        pageScaleFactor = this->pageScaleFactor();
     
    580597    for (size_t i = 0; i < numChildren; ++i) {
    581598        GraphicsLayerClutter* currentChild = static_cast<GraphicsLayerClutter*>(childLayers[i]);
    582         currentChild->recursiveCommitChanges(localState, pageScaleFactor, baseRelativePosition, affectedByPageScale);
     599        currentChild->recursiveCommitChanges(commitState, state, pageScaleFactor, baseRelativePosition, affectedByPageScale);
    583600    }
    584601
     
    599616        return;
    600617
     618    if (m_uncommittedChanges & ChildrenChanged)
     619        updateSublayerList();
     620
    601621    m_uncommittedChanges = NoChange;
    602622}
     
    619639        return;
    620640
     641    // Need to handle Preserves3DChanged first, because it affects which layers subsequent properties are applied to
     642    if (m_uncommittedChanges & Preserves3DChanged)
     643        updateStructuralLayer();
     644
     645    if (m_uncommittedChanges & GeometryChanged)
     646        updateGeometry(pageScaleFactor, positionRelativeToBase);
     647
     648    if (m_uncommittedChanges & DrawsContentChanged)
     649        updateLayerDrawsContent(pageScaleFactor, positionRelativeToBase);
     650
    621651    if (m_uncommittedChanges & NameChanged)
    622652        updateLayerNames();
    623653
    624     if (m_uncommittedChanges & ChildrenChanged)
    625         updateSublayerList();
    626 
    627     if (m_uncommittedChanges & GeometryChanged)
    628         updateGeometry(pageScaleFactor, positionRelativeToBase);
    629 
    630654    if (m_uncommittedChanges & TransformChanged)
    631655        updateTransform();
    632656
    633     if (m_uncommittedChanges & DrawsContentChanged)
    634         updateLayerDrawsContent(pageScaleFactor, positionRelativeToBase);
     657    if (m_uncommittedChanges & OpacityChanged)
     658        updateOpacityOnLayer();
     659
     660    if (m_uncommittedChanges & AnimationChanged)
     661        updateAnimations();
    635662
    636663    if (m_uncommittedChanges & DirtyRectsChanged)
    637664        repaintLayerDirtyRects();
    638665
    639     if (m_uncommittedChanges & OpacityChanged)
    640         updateOpacityOnLayer();
    641 
    642     if (m_uncommittedChanges & AnimationChanged)
    643         updateAnimations();
     666    if (m_uncommittedChanges & ChildrenChanged) {
     667        updateSublayerList();
     668        // Sublayers may set this flag again, so clear it to avoid always updating sublayers in commitLayerChangesAfterSublayers().
     669        m_uncommittedChanges &= ~ChildrenChanged;
     670    }
    644671}
    645672
     
    647674{
    648675    // FIXME: Need to support page scaling.
     676    if (m_structuralLayer) {
     677        clutter_actor_set_position(CLUTTER_ACTOR(m_structuralLayer.get()), m_position.x(), m_position.y());
     678        clutter_actor_set_size(CLUTTER_ACTOR(m_structuralLayer.get()), m_size.width(), m_size.height());
     679        graphicsLayerActorSetAnchorPoint(m_structuralLayer.get(), m_anchorPoint.x(), m_anchorPoint.y(), m_anchorPoint.z());
     680    }
     681
    649682    clutter_actor_set_position(CLUTTER_ACTOR(m_layer.get()), m_position.x(), m_position.y());
    650683    clutter_actor_set_size(CLUTTER_ACTOR(m_layer.get()), m_size.width(), m_size.height());
     
    656689void GraphicsLayerClutter::updateSublayerList()
    657690{
    658     GraphicsLayerActorList newSublayers;
     691    GraphicsLayerActorList structuralLayerChildren;
     692    GraphicsLayerActorList primaryLayerChildren;
     693
     694    GraphicsLayerActorList& childListForSublayers = m_structuralLayer ? structuralLayerChildren : primaryLayerChildren;
     695
     696    if (m_structuralLayer)
     697        structuralLayerChildren.append(m_layer);
     698
    659699    const Vector<GraphicsLayer*>& childLayers = children();
    660 
    661700    size_t numChildren = childLayers.size();
    662701    for (size_t i = 0; i < numChildren; ++i) {
     
    664703        GraphicsLayerActor* childLayer = currentChild->layerForSuperlayer();
    665704        ASSERT(GRAPHICS_LAYER_IS_ACTOR(childLayer));
    666 
    667         newSublayers.append(childLayer);
    668     }
    669 
    670     graphicsLayerActorSetSublayers(m_layer.get(), newSublayers);
     705        childListForSublayers.append(childLayer);
     706
     707        // The child layer only preserves 3D if either itself or its parent has preserves3D set.
     708        graphicsLayerActorSetFlatten(childLayer, !(preserves3D() || currentChild->preserves3D()));
     709    }
     710
     711    if (m_structuralLayer)
     712        graphicsLayerActorSetSublayers(m_structuralLayer.get(), structuralLayerChildren);
     713
     714    graphicsLayerActorSetSublayers(m_layer.get(), primaryLayerChildren);
    671715}
    672716
     
    680724    CoglMatrix matrix = m_transform;
    681725    clutter_actor_set_transform(CLUTTER_ACTOR(primaryLayer()), &matrix);
     726}
     727
     728void GraphicsLayerClutter::updateStructuralLayer()
     729{
     730    ensureStructuralLayer(structuralLayerPurpose());
     731}
     732
     733void GraphicsLayerClutter::ensureStructuralLayer(StructuralLayerPurpose purpose)
     734{
     735    const LayerChangeFlags structuralLayerChangeFlags = NameChanged
     736        | GeometryChanged
     737        | TransformChanged
     738        | ChildrenTransformChanged
     739        | ChildrenChanged
     740        | BackfaceVisibilityChanged
     741        | OpacityChanged;
     742
     743    if (purpose == NoStructuralLayer) {
     744        if (m_structuralLayer) {
     745            // Replace the transformLayer in the parent with this layer.
     746            graphicsLayerActorRemoveFromSuperLayer(m_layer.get());
     747
     748            // If m_layer doesn't have a parent, it means it's the root layer and
     749            // is likely hosted by something that is not expecting to be changed
     750            ClutterActor* parentActor = clutter_actor_get_parent(CLUTTER_ACTOR(m_structuralLayer.get()));
     751            ASSERT(parentActor);
     752            graphicsLayerActorReplaceSublayer(GRAPHICS_LAYER_ACTOR(parentActor), CLUTTER_ACTOR(m_structuralLayer.get()), CLUTTER_ACTOR(m_layer.get()));
     753
     754            moveOrCopyAnimations(Move, m_structuralLayer.get(), m_layer.get());
     755
     756            // Release the structural layer.
     757            m_structuralLayer = 0;
     758
     759            m_uncommittedChanges |= structuralLayerChangeFlags;
     760        }
     761        return;
     762    }
     763
     764    bool structuralLayerChanged = false;
     765    if (purpose == StructuralLayerForPreserves3D) {
     766        if (m_structuralLayer && (graphicsLayerActorGetLayerType(m_structuralLayer.get()) != GraphicsLayerClutter::LayerTypeTransformLayer))
     767            m_structuralLayer = 0;
     768
     769        if (!m_structuralLayer) {
     770            m_structuralLayer = graphicsLayerActorNewWithClient(GraphicsLayerClutter::LayerTypeTransformLayer, this);
     771            structuralLayerChanged = true;
     772        }
     773    } else {
     774        if (m_structuralLayer && (graphicsLayerActorGetLayerType(m_structuralLayer.get()) != GraphicsLayerClutter::LayerTypeLayer))
     775            m_structuralLayer = 0;
     776
     777        if (!m_structuralLayer) {
     778            m_structuralLayer = graphicsLayerActorNewWithClient(GraphicsLayerClutter::LayerTypeLayer, this);
     779            structuralLayerChanged = true;
     780        }
     781    }
     782
     783    if (!structuralLayerChanged)
     784        return;
     785
     786    m_uncommittedChanges |= structuralLayerChangeFlags;
     787
     788    // We've changed the layer that our parent added to its sublayer list, so tell it to update
     789    // sublayers again in its commitLayerChangesAfterSublayers().
     790    static_cast<GraphicsLayerClutter*>(parent())->noteSublayersChanged();
     791
     792    // Set properties of m_layer to their default values, since these are expressed on on the structural layer.
     793    FloatPoint point(0, 0);
     794    FloatPoint3D anchorPoint(0.5f, 0.5f, 0);
     795    clutter_actor_set_position(CLUTTER_ACTOR(m_layer.get()), point.x(), point.y());
     796    graphicsLayerActorSetAnchorPoint(m_layer.get(), anchorPoint.x(), anchorPoint.y(), anchorPoint.z());
     797
     798    CoglMatrix matrix = TransformationMatrix();
     799    clutter_actor_set_transform(CLUTTER_ACTOR(m_layer.get()), &matrix);
     800
     801    clutter_actor_set_opacity(CLUTTER_ACTOR(m_layer.get()), 255);
     802
     803    moveOrCopyAnimations(Move, m_layer.get(), m_structuralLayer.get());
     804}
     805
     806GraphicsLayerClutter::StructuralLayerPurpose GraphicsLayerClutter::structuralLayerPurpose() const
     807{
     808    if (preserves3D())
     809        return StructuralLayerForPreserves3D;
     810
     811    return NoStructuralLayer;
    682812}
    683813
     
    11001230GraphicsLayerActor* GraphicsLayerClutter::layerForSuperlayer() const
    11011231{
    1102     return m_layer.get();
     1232    return m_structuralLayer ? m_structuralLayer.get() : m_layer.get();
    11031233}
    11041234
  • trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h

    r146608 r147443  
    8080    virtual void setNeedsDisplayInRect(const FloatRect&);
    8181
     82    virtual void setPreserves3D(bool);
     83
    8284    virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String& animationName, double timeOffset);
    8385    virtual void removeAnimation(const String& animationName);
     
    8688    virtual void flushCompositingStateForThisLayerOnly();
    8789
    88     void recursiveCommitChanges(const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
     90    struct CommitState {
     91        bool ancestorHasTransformAnimation;
     92        CommitState()
     93            : ancestorHasTransformAnimation(false)
     94        { }
     95    };
     96    void recursiveCommitChanges(const CommitState&, const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
    8997
    9098private:
     
    104112    virtual void platformClutterLayerPaintContents(GraphicsContext&, const IntRect& clip);
    105113
    106     GraphicsLayerActor* primaryLayer() const { return m_layer.get(); }
     114    GraphicsLayerActor* primaryLayer() const { return m_structuralLayer.get() ? m_structuralLayer.get() : m_layer.get(); }
    107115    GraphicsLayerActor* layerForSuperlayer() const;
    108116    GraphicsLayerActor* animatedLayer(AnimatedPropertyID) const;
     
    126134    bool setTransformAnimationEndpoints(const KeyframeValueList&, const Animation*, PlatformClutterAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const IntSize& boxSize);
    127135    bool setTransformAnimationKeyframes(const KeyframeValueList&, const Animation*, PlatformClutterAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const IntSize& boxSize);
     136
     137    enum MoveOrCopy { Move, Copy };
     138    void moveOrCopyAnimations(MoveOrCopy, GraphicsLayerActor* fromLayer, GraphicsLayerActor* toLayer);
    128139
    129140    bool appendToUncommittedAnimations(const KeyframeValueList&, const TransformOperations*, const Animation*, const String& animationName, const IntSize& boxSize, int animationIndex, double timeOffset, bool isMatrixAnimation);
     
    148159        ContentsMediaLayerChanged = 1 << 16,
    149160        ContentsCanvasLayerChanged = 1 << 17,
    150         ContentsRectChanged = 1 << 18,
    151         MaskLayerChanged = 1 << 19,
    152         ReplicatedLayerChanged = 1 << 20,
    153         ContentsNeedsDisplay = 1 << 21,
    154         AcceleratesDrawingChanged = 1 << 22,
    155         ContentsScaleChanged = 1 << 23
     161        ContentsColorLayerChanged = 1 << 18,
     162        ContentsRectChanged = 1 << 19,
     163        MaskLayerChanged = 1 << 20,
     164        ReplicatedLayerChanged = 1 << 21,
     165        ContentsNeedsDisplay = 1 << 22,
     166        AcceleratesDrawingChanged = 1 << 23,
     167        ContentsScaleChanged = 1 << 24,
     168        ContentsVisibilityChanged = 1 << 25,
     169        VisibleRectChanged = 1 << 26,
     170        FiltersChanged = 1 << 27,
     171        DebugIndicatorsChanged = 1 << 28
    156172    };
    157173
     
    161177
    162178    void updateBackfaceVisibility();
     179    void updateStructuralLayer();
    163180    void updateLayerNames();
    164181    void updateSublayerList();
     
    169186    void updateAnimations();
    170187
     188    enum StructuralLayerPurpose {
     189        NoStructuralLayer = 0,
     190        StructuralLayerForPreserves3D,
     191        StructuralLayerForReplicaFlattening
     192    };
     193    void ensureStructuralLayer(StructuralLayerPurpose);
     194    StructuralLayerPurpose structuralLayerPurpose() const;
     195
    171196    void repaintLayerDirtyRects();
    172197
    173198    GRefPtr<GraphicsLayerActor> m_layer;
     199    GRefPtr<GraphicsLayerActor> m_structuralLayer; // A layer used for structural reasons, like preserves-3d or replica-flattening. Is the parent of m_layer.
    174200
    175201    Vector<FloatRect> m_dirtyRects;
Note: See TracChangeset for help on using the changeset viewer.