| Index: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
|
| index 56503d84012376488405d0cb8e4819c1408d3c84..6567f91ce576bf1296b93e697d92172627b6f1a4 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
|
| @@ -347,9 +347,10 @@ void GraphicsLayer::updateChildList() {
|
| clearContentsLayerIfUnregistered();
|
|
|
| if (m_contentsLayer) {
|
| - // FIXME: add the contents layer in the correct order with negative z-order children.
|
| - // This does not cause visible rendering issues because currently contents layers are only used
|
| - // for replaced elements that don't have children.
|
| + // FIXME: Add the contents layer in the correct order with negative z-order
|
| + // children. This does not currently cause visible rendering issues because
|
| + // contents layers are only used for replaced elements that don't have
|
| + // children.
|
| childHost->addChild(m_contentsLayer);
|
| }
|
|
|
| @@ -361,10 +362,11 @@ void GraphicsLayer::updateChildList() {
|
| }
|
|
|
| void GraphicsLayer::updateLayerIsDrawable() {
|
| - // For the rest of the accelerated compositor code, there is no reason to make a
|
| - // distinction between drawsContent and contentsVisible. So, for m_layer->layer(), these two
|
| - // flags are combined here. m_contentsLayer shouldn't receive the drawsContent flag
|
| - // so it is only given contentsVisible.
|
| + // For the rest of the accelerated compositor code, there is no reason to make
|
| + // a distinction between drawsContent and contentsVisible. So, for
|
| + // m_layer->layer(), these two flags are combined here. |m_contentsLayer|
|
| + // shouldn't receive the drawsContent flag, so it is only given
|
| + // contentsVisible.
|
|
|
| m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
|
| if (WebLayer* contentsLayer = contentsLayerIfRegistered())
|
| @@ -450,12 +452,13 @@ void GraphicsLayer::setupContentsLayer(WebLayer* contentsLayer) {
|
| m_contentsLayer->setTransformOrigin(FloatPoint3D());
|
| m_contentsLayer->setUseParentBackfaceVisibility(true);
|
|
|
| - // It is necessary to call setDrawsContent as soon as we receive the new contentsLayer, for
|
| - // the correctness of early exit conditions in setDrawsContent() and setContentsVisible().
|
| + // It is necessary to call setDrawsContent as soon as we receive the new
|
| + // contentsLayer, for the correctness of early exit conditions in
|
| + // setDrawsContent() and setContentsVisible().
|
| m_contentsLayer->setDrawsContent(m_contentsVisible);
|
|
|
| - // Insert the content layer first. Video elements require this, because they have
|
| - // shadow content that must display in front of the video.
|
| + // Insert the content layer first. Video elements require this, because they
|
| + // have shadow content that must display in front of the video.
|
| m_layer->layer()->insertChild(m_contentsLayer, 0);
|
| WebLayer* borderWebLayer = m_contentsClippingMaskLayer
|
| ? m_contentsClippingMaskLayer->platformLayer()
|
| @@ -527,7 +530,8 @@ void GraphicsLayer::trackRasterInvalidation(const DisplayItemClient& client,
|
| }
|
|
|
| if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) {
|
| - // TODO(crbug.com/496260): Some antialiasing effects overflows the paint invalidation rect.
|
| + // TODO(crbug.com/496260): Some antialiasing effects overflow the paint
|
| + // invalidation rect.
|
| IntRect r = rect;
|
| r.inflate(1);
|
| tracking.rasterInvalidationRegionSinceLastPaint.unite(r);
|
| @@ -817,9 +821,10 @@ void GraphicsLayer::setPosition(const FloatPoint& point) {
|
| }
|
|
|
| void GraphicsLayer::setSize(const FloatSize& size) {
|
| - // We are receiving negative sizes here that cause assertions to fail in the compositor. Clamp them to 0 to
|
| - // avoid those assertions.
|
| - // FIXME: This should be an ASSERT instead, as negative sizes should not exist in WebCore.
|
| + // We are receiving negative sizes here that cause assertions to fail in the
|
| + // compositor. Clamp them to 0 to avoid those assertions.
|
| + // FIXME: This should be an ASSERT instead, as negative sizes should not exist
|
| + // in WebCore.
|
| FloatSize clampedSize = size;
|
| if (clampedSize.width() < 0 || clampedSize.height() < 0)
|
| clampedSize = FloatSize();
|
| @@ -874,8 +879,9 @@ void GraphicsLayer::setMasksToBounds(bool masksToBounds) {
|
| }
|
|
|
| void GraphicsLayer::setDrawsContent(bool drawsContent) {
|
| - // Note carefully this early-exit is only correct because we also properly call
|
| - // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer in setupContentsLayer().
|
| + // NOTE: This early-exit is only correct because we also properly call
|
| + // WebLayer::setDrawsContent() whenever |m_contentsLayer| is set to a new
|
| + // layer in setupContentsLayer().
|
| if (drawsContent == m_drawsContent)
|
| return;
|
|
|
| @@ -887,8 +893,9 @@ void GraphicsLayer::setDrawsContent(bool drawsContent) {
|
| }
|
|
|
| void GraphicsLayer::setContentsVisible(bool contentsVisible) {
|
| - // Note carefully this early-exit is only correct because we also properly call
|
| - // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer in setupContentsLayer().
|
| + // NOTE: This early-exit is only correct because we also properly call
|
| + // WebLayer::setDrawsContent() whenever |m_contentsLayer| is set to a new
|
| + // layer in setupContentsLayer().
|
| if (contentsVisible == m_contentsVisible)
|
| return;
|
|
|
| @@ -983,7 +990,8 @@ void GraphicsLayer::setNeedsDisplay() {
|
| if (!drawsContent())
|
| return;
|
|
|
| - // TODO(chrishtr): stop invalidating the rects once FrameView::paintRecursively does so.
|
| + // TODO(chrishtr): Stop invalidating the rects once
|
| + // FrameView::paintRecursively() does so.
|
| m_layer->layer()->invalidate();
|
| for (size_t i = 0; i < m_linkHighlights.size(); ++i)
|
| m_linkHighlights[i]->invalidate();
|
| @@ -1113,8 +1121,10 @@ void GraphicsLayer::didScroll() {
|
| -m_scrollableArea->scrollOrigin() +
|
| toDoubleSize(m_layer->layer()->scrollPositionDouble());
|
|
|
| - // FrameView::setScrollPosition doesn't work for compositor commits (interacts poorly with programmatic scroll animations)
|
| - // so we need to use the ScrollableArea version. The FrameView method should go away soon anyway.
|
| + // FrameView::setScrollPosition() doesn't work for compositor commits
|
| + // (interacts poorly with programmatic scroll animations) so we need to use
|
| + // the ScrollableArea version. The FrameView method should go away soon
|
| + // anyway.
|
| m_scrollableArea->ScrollableArea::setScrollPosition(newPosition,
|
| CompositorScroll);
|
| }
|
| @@ -1248,8 +1258,9 @@ void GraphicsLayer::checkPaintUnderInvalidations(const SkPicture& newPicture) {
|
| oldBitmap.unlockPixels();
|
| newBitmap.unlockPixels();
|
|
|
| - // Visualize under-invalidations by overlaying the new bitmap (containing red pixels indicating under-invalidations,
|
| - // and transparent pixels otherwise) onto the painting.
|
| + // Visualize under-invalidations by overlaying the new bitmap (containing red
|
| + // pixels indicating under-invalidations, and transparent pixels otherwise)
|
| + // onto the painting.
|
| SkPictureRecorder recorder;
|
| recorder.beginRecording(rect);
|
| recorder.getRecordingCanvas()->drawBitmap(newBitmap, rect.x(), rect.y());
|
|
|