diff --git a/engine/core/core.gni b/engine/core/core.gni index 4fa64262c2b..7fdd85c8d19 100644 --- a/engine/core/core.gni +++ b/engine/core/core.gni @@ -1142,8 +1142,6 @@ sky_core_files = [ "rendering/RenderLayerFilterInfo.h", "rendering/RenderLayerModelObject.cpp", "rendering/RenderLayerModelObject.h", - "rendering/RenderLayerRepainter.cpp", - "rendering/RenderLayerRepainter.h", "rendering/RenderLayerScrollableArea.cpp", "rendering/RenderLayerScrollableArea.h", "rendering/RenderLayerStackingNode.cpp", diff --git a/engine/core/rendering/RenderLayer.cpp b/engine/core/rendering/RenderLayer.cpp index b3d38ef4c4a..6e02552bcc7 100644 --- a/engine/core/rendering/RenderLayer.cpp +++ b/engine/core/rendering/RenderLayer.cpp @@ -101,7 +101,6 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer, LayerType type) , m_last(0) , m_staticInlinePosition(0) , m_staticBlockPosition(0) - , m_paintInvalidator(*renderer) , m_clipper(*renderer) { updateStackingNode(); diff --git a/engine/core/rendering/RenderLayer.h b/engine/core/rendering/RenderLayer.h index e18ba79ffa9..1d44b0e2840 100644 --- a/engine/core/rendering/RenderLayer.h +++ b/engine/core/rendering/RenderLayer.h @@ -49,7 +49,6 @@ #include "sky/engine/core/rendering/RenderBox.h" #include "sky/engine/core/rendering/RenderLayerClipper.h" #include "sky/engine/core/rendering/RenderLayerFilterInfo.h" -#include "sky/engine/core/rendering/RenderLayerRepainter.h" #include "sky/engine/core/rendering/RenderLayerScrollableArea.h" #include "sky/engine/core/rendering/RenderLayerStackingNode.h" #include "sky/engine/core/rendering/RenderLayerStackingNodeIterator.h" @@ -277,7 +276,6 @@ public: // FIXME: This should probably return a ScrollableArea but a lot of internal methods are mistakenly exposed. RenderLayerScrollableArea* scrollableArea() const { return m_scrollableArea.get(); } - RenderLayerRepainter& paintInvalidator() { return m_paintInvalidator; } RenderLayerClipper& clipper() { return m_clipper; } const RenderLayerClipper& clipper() const { return m_clipper; } @@ -554,7 +552,6 @@ private: OwnPtr m_scrollableArea; - RenderLayerRepainter m_paintInvalidator; RenderLayerClipper m_clipper; // FIXME: Lazily allocate? OwnPtr m_stackingNode; diff --git a/engine/core/rendering/RenderLayerRepainter.cpp b/engine/core/rendering/RenderLayerRepainter.cpp deleted file mode 100644 index 4a29bcf5707..00000000000 --- a/engine/core/rendering/RenderLayerRepainter.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * Other contributors: - * Robert O'Callahan - * David Baron - * Christian Biesinger - * Randall Jesup - * Roland Mainz - * Josh Soref - * Boris Zbarsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#include "sky/engine/config.h" -#include "sky/engine/core/rendering/RenderLayerRepainter.h" - -#include "sky/engine/core/rendering/FilterEffectRenderer.h" -#include "sky/engine/core/rendering/RenderLayer.h" -#include "sky/engine/core/rendering/RenderView.h" - -namespace blink { - -RenderLayerRepainter::RenderLayerRepainter(RenderLayerModelObject& renderer) - : m_renderer(renderer) -{ -} - -void RenderLayerRepainter::computePaintInvalidationRectsIncludingNonCompositingDescendants() -{ - // FIXME: boundsRectForPaintInvalidation() has to walk up the parent chain - // for every layer to compute the rects. We should make this more efficient. - // FIXME: it's wrong to call this when layout is not up-to-date, which we do. - m_renderer.setPreviousPaintInvalidationRect(m_renderer.boundsRectForPaintInvalidation(m_renderer.containerForPaintInvalidation())); - // FIXME: We are only updating the paint invalidation bounds but not - // the positionFromPaintInvalidationContainer. This means that we may - // forcing a full invaliation of the new position. Is this really correct? - - for (RenderLayer* layer = m_renderer.layer()->firstChild(); layer; layer = layer->nextSibling()) { - layer->paintInvalidator().computePaintInvalidationRectsIncludingNonCompositingDescendants(); - } -} - -void RenderLayerRepainter::setFilterBackendNeedsPaintInvalidationInRect(const LayoutRect& rect) -{ - if (rect.isEmpty()) - return; - LayoutRect rectForPaintInvalidation = rect; - - ASSERT(m_renderer.layer()->filterInfo()); - - RenderLayer* parentLayer = enclosingFilterPaintInvalidationLayer(); - ASSERT(parentLayer); - FloatQuad paintInvalidationQuad(rectForPaintInvalidation); - LayoutRect parentLayerRect = m_renderer.localToContainerQuad(paintInvalidationQuad, parentLayer->renderer()).enclosingBoundingBox(); - - if (parentLayerRect.isEmpty()) - return; - - if (parentLayer->paintsWithFilters()) { - parentLayer->paintInvalidator().setFilterBackendNeedsPaintInvalidationInRect(parentLayerRect); - return; - } - - if (parentLayer->isRootLayer()) { - RenderView* view = toRenderView(parentLayer->renderer()); - view->invalidatePaintForRectangle(parentLayerRect); - return; - } - - ASSERT_NOT_REACHED(); -} - -RenderLayer* RenderLayerRepainter::enclosingFilterPaintInvalidationLayer() const -{ - for (const RenderLayer* curr = m_renderer.layer(); curr; curr = curr->parent()) { - if ((curr != m_renderer.layer() && curr->requiresFullLayerImageForFilters()) || curr->isRootLayer()) - return const_cast(curr); - } - return 0; -} - -} // namespace blink diff --git a/engine/core/rendering/RenderLayerRepainter.h b/engine/core/rendering/RenderLayerRepainter.h deleted file mode 100644 index c9060aaec9e..00000000000 --- a/engine/core/rendering/RenderLayerRepainter.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * Other contributors: - * Robert O'Callahan - * David Baron - * Christian Biesinger - * Randall Jesup - * Roland Mainz - * Josh Soref - * Boris Zbarsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERLAYERREPAINTER_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERLAYERREPAINTER_H_ - -#include "sky/engine/platform/geometry/LayoutRect.h" -#include "sky/engine/wtf/Noncopyable.h" - -namespace blink { - -class RenderLayer; -class RenderLayerModelObject; - -class RenderLayerRepainter { - WTF_MAKE_NONCOPYABLE(RenderLayerRepainter); -public: - RenderLayerRepainter(RenderLayerModelObject&); - - void computePaintInvalidationRectsIncludingNonCompositingDescendants(); - - void setFilterBackendNeedsPaintInvalidationInRect(const LayoutRect&); - -private: - RenderLayer* enclosingFilterPaintInvalidationLayer() const; - - RenderLayerModelObject& m_renderer; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYERREPAINTER_H_