Changeset 148742 in webkit


Ignore:
Timestamp:
Apr 19, 2013 6:51:10 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK][AC] Support masksToBounds for clutter AC backend.
https://bugs.webkit.org/show_bug.cgi?id=114113

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

We can support the masksToBounds property by using clutter_actor_set_clip simply.

Covered by existing AC tests.

  • platform/graphics/clutter/GraphicsLayerActor.cpp:

(graphicsLayerActorSetMasksToBounds):

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

(WebCore::GraphicsLayerClutter::setMasksToBounds):
(WebCore):
(WebCore::GraphicsLayerClutter::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerClutter::setupContentsLayer):
(WebCore::GraphicsLayerClutter::updateMasksToBounds):

  • platform/graphics/clutter/GraphicsLayerClutter.h:

(GraphicsLayerClutter):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148731 r148742  
     12013-04-19  ChangSeok Oh  <changseok.oh@collabora.com>
     2
     3        [GTK][AC] Support masksToBounds for clutter AC backend.
     4        https://bugs.webkit.org/show_bug.cgi?id=114113
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        We can support the masksToBounds property by using clutter_actor_set_clip simply.
     9
     10        Covered by existing AC tests.
     11
     12        * platform/graphics/clutter/GraphicsLayerActor.cpp:
     13        (graphicsLayerActorSetMasksToBounds):
     14        * platform/graphics/clutter/GraphicsLayerActor.h:
     15        * platform/graphics/clutter/GraphicsLayerClutter.cpp:
     16        (WebCore::GraphicsLayerClutter::setMasksToBounds):
     17        (WebCore):
     18        (WebCore::GraphicsLayerClutter::commitLayerChangesBeforeSublayers):
     19        (WebCore::GraphicsLayerClutter::setupContentsLayer):
     20        (WebCore::GraphicsLayerClutter::updateMasksToBounds):
     21        * platform/graphics/clutter/GraphicsLayerClutter.h:
     22        (GraphicsLayerClutter):
     23
    1242013-04-19  Dan Beam  <dbeam@chromium.org>
    225
  • trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.cpp

    r148202 r148742  
    525525}
    526526
     527void graphicsLayerActorSetMasksToBounds(GraphicsLayerActor* layer, bool masksToBounds)
     528{
     529    ClutterActor* actor = CLUTTER_ACTOR(layer);
     530    if (masksToBounds)
     531        clutter_actor_set_clip(actor, 0, 0, clutter_actor_get_width(actor), clutter_actor_get_height(actor));
     532    else
     533        clutter_actor_remove_clip(actor);
     534}
     535
    527536WebCore::PlatformClutterAnimation* graphicsLayerActorGetAnimationForKey(GraphicsLayerActor* layer, const String key)
    528537{
  • trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.h

    r147443 r148742  
    9898void graphicsLayerActorSetDrawsContent(GraphicsLayerActor*, bool drawsContent);
    9999void graphicsLayerActorSetFlatten(GraphicsLayerActor*, bool flatten);
     100void graphicsLayerActorSetMasksToBounds(GraphicsLayerActor*, bool masksToBounds);
    100101
    101102WebCore::PlatformClutterAnimation* graphicsLayerActorGetAnimationForKey(GraphicsLayerActor*, const String);
  • trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp

    r148232 r148742  
    445445}
    446446
     447void GraphicsLayerClutter::setMasksToBounds(bool masksToBounds)
     448{
     449    if (masksToBounds == m_masksToBounds)
     450        return;
     451
     452    GraphicsLayer::setMasksToBounds(masksToBounds);
     453    noteLayerPropertyChanged(MasksToBoundsChanged);
     454}
     455
    447456void GraphicsLayerClutter::setDrawsContent(bool drawsContent)
    448457{
     
    737746        updateTransform();
    738747
     748    if (m_uncommittedChanges & MasksToBoundsChanged)
     749        updateMasksToBounds();
     750
    739751    if (m_uncommittedChanges & OpacityChanged)
    740752        updateOpacityOnLayer();
     
    761773void GraphicsLayerClutter::setupContentsLayer(GraphicsLayerActor* contentsLayer)
    762774{
     775    graphicsLayerActorSetMasksToBounds(contentsLayer, true);
    763776    graphicsLayerActorSetAnchorPoint(contentsLayer, 0.0, 0.0, 0.0);
    764777}
     
    859872    CoglMatrix matrix = m_transform;
    860873    clutter_actor_set_transform(CLUTTER_ACTOR(primaryLayer()), &matrix);
     874}
     875
     876void GraphicsLayerClutter::updateMasksToBounds()
     877{
     878    graphicsLayerActorSetMasksToBounds(m_layer.get(), m_masksToBounds);
    861879}
    862880
  • trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.h

    r148232 r148742  
    6464    virtual void addChildAbove(GraphicsLayer*, GraphicsLayer* sibling);
    6565    virtual void addChildBelow(GraphicsLayer*, GraphicsLayer* sibling);
     66
    6667    virtual void removeFromParent();
     68
    6769    virtual bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
    6870    virtual bool setChildren(const Vector<GraphicsLayer*>&);
     
    8789
    8890    virtual void setPreserves3D(bool);
     91    virtual void setMasksToBounds(bool);
    8992
    9093    virtual bool addAnimation(const KeyframeValueList&, const IntSize& boxSize, const Animation*, const String& animationName, double timeOffset);
     
    191194    void updateGeometry(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase);
    192195    void updateTransform();
     196    void updateMasksToBounds();
    193197    void updateLayerDrawsContent(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase);
    194198    void updateContentsImage();
Note: See TracChangeset for help on using the changeset viewer.