OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "sky/engine/core/rendering/PaintInfo.h" | 42 #include "sky/engine/core/rendering/PaintInfo.h" |
43 #include "sky/engine/core/rendering/RenderFlexibleBox.h" | 43 #include "sky/engine/core/rendering/RenderFlexibleBox.h" |
44 #include "sky/engine/core/rendering/RenderInline.h" | 44 #include "sky/engine/core/rendering/RenderInline.h" |
45 #include "sky/engine/core/rendering/RenderLayer.h" | 45 #include "sky/engine/core/rendering/RenderLayer.h" |
46 #include "sky/engine/core/rendering/RenderObjectInlines.h" | 46 #include "sky/engine/core/rendering/RenderObjectInlines.h" |
47 #include "sky/engine/core/rendering/RenderParagraph.h" | 47 #include "sky/engine/core/rendering/RenderParagraph.h" |
48 #include "sky/engine/core/rendering/RenderView.h" | 48 #include "sky/engine/core/rendering/RenderView.h" |
49 #include "sky/engine/core/rendering/style/RenderStyle.h" | 49 #include "sky/engine/core/rendering/style/RenderStyle.h" |
50 #include "sky/engine/platform/geometry/FloatQuad.h" | 50 #include "sky/engine/platform/geometry/FloatQuad.h" |
51 #include "sky/engine/platform/geometry/TransformState.h" | 51 #include "sky/engine/platform/geometry/TransformState.h" |
52 #include "sky/engine/platform/graphics/GraphicsContextCullSaver.h" | |
53 #include "sky/engine/platform/graphics/GraphicsContextStateSaver.h" | 52 #include "sky/engine/platform/graphics/GraphicsContextStateSaver.h" |
54 #include "sky/engine/wtf/StdLibExtras.h" | 53 #include "sky/engine/wtf/StdLibExtras.h" |
55 #include "sky/engine/wtf/TemporaryChange.h" | 54 #include "sky/engine/wtf/TemporaryChange.h" |
56 | 55 |
57 using namespace WTF; | 56 using namespace WTF; |
58 using namespace Unicode; | 57 using namespace Unicode; |
59 | 58 |
60 namespace blink { | 59 namespace blink { |
61 | 60 |
62 struct SameSizeAsRenderBlock : public RenderBox { | 61 struct SameSizeAsRenderBlock : public RenderBox { |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 } | 589 } |
591 | 590 |
592 // There are some cases where not all clipped visual overflow is accounted f
or. | 591 // There are some cases where not all clipped visual overflow is accounted f
or. |
593 // FIXME: reduce the number of such cases. | 592 // FIXME: reduce the number of such cases. |
594 ContentsClipBehavior contentsClipBehavior = ForceContentsClip; | 593 ContentsClipBehavior contentsClipBehavior = ForceContentsClip; |
595 if (hasOverflowClip() && !hasControlClip() && !(shouldPaintSelectionGaps() &
& phase == PaintPhaseForeground) && !hasCaret()) | 594 if (hasOverflowClip() && !hasControlClip() && !(shouldPaintSelectionGaps() &
& phase == PaintPhaseForeground) && !hasCaret()) |
596 contentsClipBehavior = SkipContentsClipIfPossible; | 595 contentsClipBehavior = SkipContentsClipIfPossible; |
597 | 596 |
598 bool pushedClip = pushContentsClip(paintInfo, adjustedPaintOffset, contentsC
lipBehavior); | 597 bool pushedClip = pushContentsClip(paintInfo, adjustedPaintOffset, contentsC
lipBehavior); |
599 { | 598 { |
600 GraphicsContextCullSaver cullSaver(*paintInfo.context); | |
601 // Cull if we have more than one child and we didn't already clip. | |
602 bool shouldCull = document().settings()->containerCullingEnabled() && !p
ushedClip && !isDocumentElement() | |
603 && firstChild() && lastChild() && firstChild() != lastChild(); | |
604 if (shouldCull) | |
605 cullSaver.cull(overflowBox); | |
606 | |
607 paintObject(paintInfo, adjustedPaintOffset); | 599 paintObject(paintInfo, adjustedPaintOffset); |
608 } | 600 } |
609 if (pushedClip) | 601 if (pushedClip) |
610 popContentsClip(paintInfo, phase, adjustedPaintOffset); | 602 popContentsClip(paintInfo, phase, adjustedPaintOffset); |
611 | 603 |
612 // Our scrollbar widgets paint exactly when we tell them to, so that they wo
rk properly with | 604 // Our scrollbar widgets paint exactly when we tell them to, so that they wo
rk properly with |
613 // z-index. We paint after we painted the background/border, so that the sc
rollbars will | 605 // z-index. We paint after we painted the background/border, so that the sc
rollbars will |
614 // sit above the background/border. | 606 // sit above the background/border. |
615 if (hasOverflowClip() && (phase == PaintPhaseBlockBackground || phase == Pai
ntPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(this)) | 607 if (hasOverflowClip() && (phase == PaintPhaseBlockBackground || phase == Pai
ntPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(this)) |
616 layer()->scrollableArea()->paintOverflowControls(paintInfo.context, roun
dedIntPoint(adjustedPaintOffset), paintInfo.rect, false /* paintingOverlayContro
ls */); | 608 layer()->scrollableArea()->paintOverflowControls(paintInfo.context, roun
dedIntPoint(adjustedPaintOffset), paintInfo.rect, false /* paintingOverlayContro
ls */); |
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2044 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 2036 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
2045 { | 2037 { |
2046 showRenderObject(); | 2038 showRenderObject(); |
2047 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 2039 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
2048 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 2040 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
2049 } | 2041 } |
2050 | 2042 |
2051 #endif | 2043 #endif |
2052 | 2044 |
2053 } // namespace blink | 2045 } // namespace blink |
OLD | NEW |