Changeset 120847 in webkit


Ignore:
Timestamp:
Jun 20, 2012 12:17:43 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[chromium] webkit-backface-visibility doesn't work with video
https://bugs.webkit.org/show_bug.cgi?id=88908

When determining a contents layer's backface culling, use the parent
layer's transform and backface-visibility properties. Track which
layers need this special treatment with useParentBackfaceVisibility
and setUseParentBackfaceVisibility functions in WebCore::LayerChromium,
WebKit::WebLayer, and WebCore::CCLayerImpl.

Patch by Christopher Cameron <ccameron@chromium.org> on 2012-06-20
Reviewed by Adrienne Walker.

Source/Platform:

  • chromium/public/WebLayer.h:

(WebLayer):

Add an accessor to specify that a layer should use its parent's
backface culling behavior.

Source/WebCore:

Tests: compositing/backface-visibility/backface-visibility-image.html

compositing/backface-visibility/backface-visibility-webgl.html

  • platform/graphics/chromium/GraphicsLayerChromium.cpp:

(WebCore::GraphicsLayerChromium::setupContentsLayer):

When a contents layer is added, tag it as inheriting its backface
culling from its parent.

  • platform/graphics/chromium/LayerChromium.cpp:

(WebCore::LayerChromium::LayerChromium):

Initialize new m_useParentBackfaceVisibility member variable.

(WebCore::LayerChromium::pushPropertiesTo):

Propagate m_useParentBackfaceVisibility to CCLayerImpl.

  • platform/graphics/chromium/LayerChromium.h:

(WebCore::LayerChromium::setUseParentBackfaceVisibility):
(WebCore::LayerChromium::useParentBackfaceVisibility):
(LayerChromium):

Add m_useParentBackfaceVisibility member variable and modify
and query accessors.

  • platform/graphics/chromium/cc/CCLayerImpl.cpp:

(WebCore::CCLayerImpl::CCLayerImpl):

Initialize new m_useParentBackfaceVisibility member variable.

  • platform/graphics/chromium/cc/CCLayerImpl.h:

(WebCore::CCLayerImpl::setUseParentBackfaceVisibility):
(WebCore::CCLayerImpl::useParentBackfaceVisibility):
(CCLayerImpl):

Add m_useParentBackfaceVisibility member variable and modify
and query accessors.

  • platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:

(WebCore::layerShouldBeSkipped):

When examining a layer, if the layer has
useParentBackfaceVisibility set then use the layer's parent
layer to determine backface culling.

Source/WebKit/chromium:

  • src/WebLayer.cpp:

(WebKit::WebLayer::setUseParentBackfaceVisibility):

Add an accessor to specify that a layer should use its parent's
backface culling behavior.

LayoutTests:

  • compositing/backface-visibility/backface-visibility-image-expected.png: Added.
  • compositing/backface-visibility/backface-visibility-image-expected.txt: Added.
  • compositing/backface-visibility/backface-visibility-image.html: Added.
  • compositing/backface-visibility/backface-visibility-webgl-expected.png: Added.
  • compositing/backface-visibility/backface-visibility-webgl-expected.txt: Added.
  • compositing/backface-visibility/backface-visibility-webgl.html: Added.
Location:
trunk
Files:
6 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r120845 r120847  
     12012-06-20  Christopher Cameron  <ccameron@chromium.org>
     2
     3        [chromium] webkit-backface-visibility doesn't work with video
     4        https://bugs.webkit.org/show_bug.cgi?id=88908
     5
     6        When determining a contents layer's backface culling, use the parent
     7        layer's transform and backface-visibility properties. Track which
     8        layers need this special treatment with useParentBackfaceVisibility
     9        and setUseParentBackfaceVisibility functions in WebCore::LayerChromium,
     10        WebKit::WebLayer, and WebCore::CCLayerImpl.
     11
     12        Reviewed by Adrienne Walker.
     13
     14        * compositing/backface-visibility/backface-visibility-image-expected.png: Added.
     15        * compositing/backface-visibility/backface-visibility-image-expected.txt: Added.
     16        * compositing/backface-visibility/backface-visibility-image.html: Added.
     17        * compositing/backface-visibility/backface-visibility-webgl-expected.png: Added.
     18        * compositing/backface-visibility/backface-visibility-webgl-expected.txt: Added.
     19        * compositing/backface-visibility/backface-visibility-webgl.html: Added.
     20
    1212012-06-20  Nate Chapin  <japhet@chromium.org>
    222
  • trunk/Source/Platform/ChangeLog

    r120789 r120847  
     12012-06-20  Christopher Cameron  <ccameron@chromium.org>
     2
     3        [chromium] webkit-backface-visibility doesn't work with video
     4        https://bugs.webkit.org/show_bug.cgi?id=88908
     5
     6        When determining a contents layer's backface culling, use the parent
     7        layer's transform and backface-visibility properties. Track which
     8        layers need this special treatment with useParentBackfaceVisibility
     9        and setUseParentBackfaceVisibility functions in WebCore::LayerChromium,
     10        WebKit::WebLayer, and WebCore::CCLayerImpl.
     11
     12        Reviewed by Adrienne Walker.
     13
     14        * chromium/public/WebLayer.h:
     15            (WebLayer):
     16                Add an accessor to specify that a layer should use its parent's
     17                backface culling behavior.
     18
    1192012-06-19  Tony Payne  <tpayne@chromium.org>
    220
  • trunk/Source/Platform/chromium/public/WebLayer.h

    r119887 r120847  
    109109
    110110    WEBKIT_EXPORT void setPreserves3D(bool);
     111
     112    // Mark that this layer should use its parent's transform and double-sided
     113    // properties in determining this layer's backface visibility instead of
     114    // using its own properties. If this property is set, this layer must
     115    // have a parent, and the parent may not have this property set.
     116    // Note: This API is to work around issues with visibility the handling of
     117    // WebKit layers that have a contents layer (canvas, plugin, WebGL, video,
     118    // etc).
     119    WEBKIT_EXPORT void setUseParentBackfaceVisibility(bool);
     120
    111121    WEBKIT_EXPORT void setBackgroundColor(WebColor);
    112122
  • trunk/Source/WebCore/ChangeLog

    r120845 r120847  
     12012-06-20  Christopher Cameron  <ccameron@chromium.org>
     2
     3        [chromium] webkit-backface-visibility doesn't work with video
     4        https://bugs.webkit.org/show_bug.cgi?id=88908
     5
     6        When determining a contents layer's backface culling, use the parent
     7        layer's transform and backface-visibility properties. Track which
     8        layers need this special treatment with useParentBackfaceVisibility
     9        and setUseParentBackfaceVisibility functions in WebCore::LayerChromium,
     10        WebKit::WebLayer, and WebCore::CCLayerImpl.
     11
     12        Reviewed by Adrienne Walker.
     13
     14        Tests: compositing/backface-visibility/backface-visibility-image.html
     15               compositing/backface-visibility/backface-visibility-webgl.html
     16
     17        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
     18        (WebCore::GraphicsLayerChromium::setupContentsLayer):
     19            When a contents layer is added, tag it as inheriting its backface
     20            culling from its parent.
     21        * platform/graphics/chromium/LayerChromium.cpp:
     22            (WebCore::LayerChromium::LayerChromium):
     23                Initialize new m_useParentBackfaceVisibility member variable.
     24            (WebCore::LayerChromium::pushPropertiesTo):
     25                Propagate m_useParentBackfaceVisibility to CCLayerImpl.
     26        * platform/graphics/chromium/LayerChromium.h:
     27            (WebCore::LayerChromium::setUseParentBackfaceVisibility):
     28            (WebCore::LayerChromium::useParentBackfaceVisibility):
     29            (LayerChromium):
     30                Add m_useParentBackfaceVisibility member variable and modify
     31                and query accessors.
     32        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
     33            (WebCore::CCLayerImpl::CCLayerImpl):
     34                Initialize new m_useParentBackfaceVisibility member variable.
     35        * platform/graphics/chromium/cc/CCLayerImpl.h:
     36            (WebCore::CCLayerImpl::setUseParentBackfaceVisibility):
     37            (WebCore::CCLayerImpl::useParentBackfaceVisibility):
     38            (CCLayerImpl):
     39                Add m_useParentBackfaceVisibility member variable and modify
     40                and query accessors.
     41        * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
     42            (WebCore::layerShouldBeSkipped):
     43                When examining a layer, if the layer has
     44                useParentBackfaceVisibility set then use the layer's parent
     45                layer to determine backface culling.
     46
    1472012-06-20  Nate Chapin  <japhet@chromium.org>
    248
  • trunk/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp

    r120644 r120847  
    839839
    840840    if (!m_contentsLayer.isNull()) {
     841        m_contentsLayer.setUseParentBackfaceVisibility(false);
    841842        m_contentsLayer.removeFromParent();
    842843        m_contentsLayer.reset();
     
    847848
    848849        m_contentsLayer.setAnchorPoint(FloatPoint(0, 0));
     850        m_contentsLayer.setUseParentBackfaceVisibility(true);
    849851
    850852        // It is necessary to call setDrawsContent as soon as we receive the new contentsLayer, for
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r120837 r120847  
    8484    , m_isNonCompositedContent(false)
    8585    , m_preserves3D(false)
     86    , m_useParentBackfaceVisibility(false)
    8687    , m_alwaysReserveTextures(false)
    8788    , m_drawCheckerboardForMissingTiles(false)
     
    562563    layer->setFixedToContainerLayer(m_fixedToContainerLayer);
    563564    layer->setPreserves3D(preserves3D());
     565    layer->setUseParentBackfaceVisibility(m_useParentBackfaceVisibility);
    564566    layer->setScrollPosition(m_scrollPosition);
    565567    layer->setMaxScrollPosition(m_maxScrollPosition);
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r120837 r120847  
    192192    void setPreserves3D(bool preserve3D) { m_preserves3D = preserve3D; }
    193193    bool preserves3D() const { return m_preserves3D; }
     194
     195    void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_useParentBackfaceVisibility = useParentBackfaceVisibility; }
     196    bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibility; }
    194197
    195198    void setUsesLayerClipping(bool usesLayerClipping) { m_usesLayerClipping = usesLayerClipping; }
     
    375378    bool m_isNonCompositedContent;
    376379    bool m_preserves3D;
     380    bool m_useParentBackfaceVisibility;
    377381    bool m_alwaysReserveTextures;
    378382    bool m_drawCheckerboardForMissingTiles;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp

    r120837 r120847  
    6262    , m_opacity(1.0)
    6363    , m_preserves3D(false)
     64    , m_useParentBackfaceVisibility(false)
    6465    , m_drawCheckerboardForMissingTiles(false)
    6566    , m_usesLayerClipping(false)
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h

    r120837 r120847  
    142142    bool preserves3D() const { return m_preserves3D; }
    143143
     144    void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_useParentBackfaceVisibility = useParentBackfaceVisibility; }
     145    bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibility; }
     146
    144147    void setUsesLayerClipping(bool usesLayerClipping) { m_usesLayerClipping = usesLayerClipping; }
    145148    bool usesLayerClipping() const { return m_usesLayerClipping; }
     
    336339    FloatPoint m_position;
    337340    bool m_preserves3D;
     341    bool m_useParentBackfaceVisibility;
    338342    bool m_drawCheckerboardForMissingTiles;
    339343    WebKit::WebTransformationMatrix m_sublayerTransform;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp

    r120837 r120847  
    242242        return true;
    243243
     244    LayerType* backfaceTestLayer = layer;
     245    if (layer->useParentBackfaceVisibility()) {
     246        ASSERT(layer->parent());
     247        ASSERT(!layer->parent()->useParentBackfaceVisibility());
     248        backfaceTestLayer = layer->parent();
     249    }
     250
    244251    // The layer should not be drawn if (1) it is not double-sided and (2) the back of the layer is known to be facing the screen.
    245     if (!layer->doubleSided() && transformToScreenIsKnown(layer) && isLayerBackFaceVisible(layer))
     252    if (!backfaceTestLayer->doubleSided() && transformToScreenIsKnown(backfaceTestLayer) && isLayerBackFaceVisible(backfaceTestLayer))
    246253        return true;
    247254
  • trunk/Source/WebKit/chromium/ChangeLog

    r120837 r120847  
     12012-06-20  Christopher Cameron  <ccameron@chromium.org>
     2
     3        [chromium] webkit-backface-visibility doesn't work with video
     4        https://bugs.webkit.org/show_bug.cgi?id=88908
     5
     6        When determining a contents layer's backface culling, use the parent
     7        layer's transform and backface-visibility properties. Track which
     8        layers need this special treatment with useParentBackfaceVisibility
     9        and setUseParentBackfaceVisibility functions in WebCore::LayerChromium,
     10        WebKit::WebLayer, and WebCore::CCLayerImpl.
     11
     12        Reviewed by Adrienne Walker.
     13
     14        * src/WebLayer.cpp:
     15            (WebKit::WebLayer::setUseParentBackfaceVisibility):
     16                Add an accessor to specify that a layer should use its parent's
     17                backface culling behavior.
     18
    1192012-06-20  Ian Vollick  <vollick@chromium.org>
    220
  • trunk/Source/WebKit/chromium/src/WebLayer.cpp

    r119178 r120847  
    271271}
    272272
     273void WebLayer::setUseParentBackfaceVisibility(bool useParentBackfaceVisibility)
     274{
     275    m_private->setUseParentBackfaceVisibility(useParentBackfaceVisibility);
     276}
     277
    273278void WebLayer::setBackgroundColor(WebColor color)
    274279{
Note: See TracChangeset for help on using the changeset viewer.