| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 } | 902 } |
| 903 } | 903 } |
| 904 | 904 |
| 905 void RenderLayer::restoreClip(GraphicsContext* context, const LayoutRect& paintD
irtyRect, const ClipRect& clipRect) | 905 void RenderLayer::restoreClip(GraphicsContext* context, const LayoutRect& paintD
irtyRect, const ClipRect& clipRect) |
| 906 { | 906 { |
| 907 if (clipRect.rect() == paintDirtyRect && !clipRect.hasRadius()) | 907 if (clipRect.rect() == paintDirtyRect && !clipRect.hasRadius()) |
| 908 return; | 908 return; |
| 909 context->restore(); | 909 context->restore(); |
| 910 } | 910 } |
| 911 | 911 |
| 912 static inline bool shouldSuppressPaintingLayer(RenderLayer* layer) | |
| 913 { | |
| 914 // Avoid painting descendants of the root layer when stylesheets haven't loa
ded. This eliminates FOUC. | |
| 915 // It's ok not to draw, because later on, when all the stylesheets do load,
updateStyleSelector on the Document | |
| 916 // will do a full paintInvalidationForWholeRenderer(). | |
| 917 if (layer->renderer()->document().didLayoutWithPendingStylesheets() && !laye
r->isRootLayer() && !layer->renderer()->isDocumentElement()) | |
| 918 return true; | |
| 919 | |
| 920 return false; | |
| 921 } | |
| 922 | |
| 923 void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo&
paintingInfo, PaintLayerFlags paintFlags) | 912 void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo&
paintingInfo, PaintLayerFlags paintFlags) |
| 924 { | 913 { |
| 925 // Non self-painting leaf layers don't need to be painted as their renderer(
) should properly paint itself. | 914 // Non self-painting leaf layers don't need to be painted as their renderer(
) should properly paint itself. |
| 926 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) | 915 if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) |
| 927 return; | 916 return; |
| 928 | 917 |
| 929 if (shouldSuppressPaintingLayer(this)) | |
| 930 return; | |
| 931 | |
| 932 // If this layer is totally invisible then there is nothing to paint. | 918 // If this layer is totally invisible then there is nothing to paint. |
| 933 if (!renderer()->opacity()) | 919 if (!renderer()->opacity()) |
| 934 return; | 920 return; |
| 935 | 921 |
| 936 if (paintsWithTransform()) { | 922 if (paintsWithTransform()) { |
| 937 TransformationMatrix layerTransform = renderableTransform(); | 923 TransformationMatrix layerTransform = renderableTransform(); |
| 938 // If the transform can't be inverted, then don't paint anything. | 924 // If the transform can't be inverted, then don't paint anything. |
| 939 if (!layerTransform.isInvertible()) | 925 if (!layerTransform.isInvertible()) |
| 940 return; | 926 return; |
| 941 | 927 |
| (...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2016 } | 2002 } |
| 2017 } | 2003 } |
| 2018 | 2004 |
| 2019 void showLayerTree(const blink::RenderObject* renderer) | 2005 void showLayerTree(const blink::RenderObject* renderer) |
| 2020 { | 2006 { |
| 2021 if (!renderer) | 2007 if (!renderer) |
| 2022 return; | 2008 return; |
| 2023 showLayerTree(renderer->enclosingLayer()); | 2009 showLayerTree(renderer->enclosingLayer()); |
| 2024 } | 2010 } |
| 2025 #endif | 2011 #endif |
| OLD | NEW |