Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Side by Side Diff: Source/core/paint/BoxClipper.cpp

Issue 757183003: Revert of Enable fast/images with slimming paint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/BoxClipper.h" 6 #include "core/paint/BoxClipper.h"
7 7
8 #include "core/paint/ClipRecorder.h" 8 #include "core/paint/ClipRecorder.h"
9 #include "core/paint/ViewDisplayList.h" 9 #include "core/paint/ViewDisplayList.h"
10 #include "core/rendering/PaintInfo.h" 10 #include "core/rendering/PaintInfo.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 if (hasBorderRadius) 45 if (hasBorderRadius)
46 conservativeClipRect.intersect(clipRoundedRect.radiusCenterRect()); 46 conservativeClipRect.intersect(clipRoundedRect.radiusCenterRect());
47 conservativeClipRect.moveBy(-m_accumulatedOffset); 47 conservativeClipRect.moveBy(-m_accumulatedOffset);
48 if (m_box.hasLayer()) 48 if (m_box.hasLayer())
49 conservativeClipRect.move(m_box.scrolledContentOffset()); 49 conservativeClipRect.move(m_box.scrolledContentOffset());
50 if (conservativeClipRect.contains(contentsVisualOverflow)) 50 if (conservativeClipRect.contains(contentsVisualOverflow))
51 return; 51 return;
52 } 52 }
53 53
54 DisplayItem::Type clipType = DisplayItem::ClipBoxForeground; 54 DisplayItem::Type clipType = DisplayItem::ClipBoxForeground;
55 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) 55 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
56 clipType = ClipRecorder::paintPhaseToClipType(m_paintInfo.phase); 56 switch (m_paintInfo.phase) {
57 case PaintPhaseChildBlockBackgrounds:
58 clipType = DisplayItem::ClipBoxChildBlockBackgrounds;
59 break;
60 case PaintPhaseFloat:
61 clipType = DisplayItem::ClipBoxFloat;
62 break;
63 case PaintPhaseForeground:
64 clipType = DisplayItem::ClipBoxChildBlockBackgrounds;
65 break;
66 case PaintPhaseChildOutlines:
67 clipType = DisplayItem::ClipBoxChildOutlines;
68 break;
69 case PaintPhaseSelection:
70 clipType = DisplayItem::ClipBoxSelection;
71 break;
72 case PaintPhaseCollapsedTableBorders:
73 clipType = DisplayItem::ClipBoxCollapsedTableBorders;
74 break;
75 case PaintPhaseTextClip:
76 clipType = DisplayItem::ClipBoxTextClip;
77 break;
78 case PaintPhaseClippingMask:
79 clipType = DisplayItem::ClipBoxClippingMask;
80 break;
81 case PaintPhaseChildBlockBackground:
82 case PaintPhaseOutline:
83 case PaintPhaseBlockBackground:
84 case PaintPhaseSelfOutline:
85 case PaintPhaseMask:
86 ASSERT_NOT_REACHED();
87 }
88 }
57 89
58 OwnPtr<ClipDisplayItem> clipDisplayItem = adoptPtr(new ClipDisplayItem(&m_bo x, clipType, pixelSnappedIntRect(clipRect))); 90 OwnPtr<ClipDisplayItem> clipDisplayItem = adoptPtr(new ClipDisplayItem(&m_bo x, clipType, pixelSnappedIntRect(clipRect)));
59 if (hasBorderRadius) 91 if (hasBorderRadius)
60 clipDisplayItem->roundedRectClips().append(clipRoundedRect); 92 clipDisplayItem->roundedRectClips().append(clipRoundedRect);
61 93
62 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) 94 if (RuntimeEnabledFeatures::slimmingPaintEnabled())
63 m_box.view()->viewDisplayList().add(clipDisplayItem.release()); 95 m_box.view()->viewDisplayList().add(clipDisplayItem.release());
64 else 96 else
65 clipDisplayItem->replay(paintInfo.context); 97 clipDisplayItem->replay(paintInfo.context);
66 98
(...skipping 10 matching lines...) Expand all
77 OwnPtr<EndClipDisplayItem> endClipDisplayItem = adoptPtr(new EndClipDisplayI tem(&m_box)); 109 OwnPtr<EndClipDisplayItem> endClipDisplayItem = adoptPtr(new EndClipDisplayI tem(&m_box));
78 110
79 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 111 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
80 m_box.view()->viewDisplayList().add(endClipDisplayItem.release()); 112 m_box.view()->viewDisplayList().add(endClipDisplayItem.release());
81 } else { 113 } else {
82 endClipDisplayItem->replay(m_paintInfo.context); 114 endClipDisplayItem->replay(m_paintInfo.context);
83 } 115 }
84 } 116 }
85 117
86 } // namespace blink 118 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/paint/BoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698