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

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

Issue 1284203004: Generate scroll/clip display item hierarchy for SPv2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix assertion failure Created 5 years, 3 months 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
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/LayerClipRecorder.h" 6 #include "core/paint/LayerClipRecorder.h"
7 7
8 #include "core/layout/ClipRect.h" 8 #include "core/layout/ClipRect.h"
9 #include "core/layout/LayoutView.h" 9 #include "core/layout/LayoutView.h"
10 #include "core/paint/DeprecatedPaintLayer.h" 10 #include "core/paint/DeprecatedPaintLayer.h"
11 #include "platform/RuntimeEnabledFeatures.h" 11 #include "platform/RuntimeEnabledFeatures.h"
12 #include "platform/geometry/IntRect.h" 12 #include "platform/geometry/IntRect.h"
13 #include "platform/graphics/GraphicsContext.h" 13 #include "platform/graphics/GraphicsContext.h"
14 #include "platform/graphics/GraphicsLayer.h" 14 #include "platform/graphics/GraphicsLayer.h"
15 #include "platform/graphics/paint/ClipRecorder.h" 15 #include "platform/graphics/paint/ClipRecorder.h"
16 #include "platform/graphics/paint/DisplayItemList.h" 16 #include "platform/graphics/paint/DisplayItemList.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphicsContext, const Lay outBoxModelObject& layoutObject, DisplayItem::Type clipType, const ClipRect& cli pRect, 20 LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphicsContext, const Lay outBoxModelObject& layoutObject, DisplayItem::Type clipType, const ClipRect& cli pRect,
21 const DeprecatedPaintLayerPaintingInfo* localPaintingInfo, const LayoutPoint & fragmentOffset, PaintLayerFlags paintFlags, BorderRadiusClippingRule rule) 21 const DeprecatedPaintLayerPaintingInfo* localPaintingInfo, const LayoutPoint & fragmentOffset, PaintLayerFlags paintFlags, BorderRadiusClippingRule rule)
22 : m_graphicsContext(graphicsContext) 22 : m_graphicsContext(graphicsContext)
23 , m_layoutObject(layoutObject) 23 , m_layoutObject(layoutObject)
24 , m_clipType(clipType) 24 , m_clipType(clipType)
25 { 25 {
26 ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
27
26 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect()); 28 IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
27 Vector<FloatRoundedRect> roundedRects; 29 Vector<FloatRoundedRect> roundedRects;
28 if (localPaintingInfo && clipRect.hasRadius()) { 30 if (localPaintingInfo && clipRect.hasRadius()) {
29 collectRoundedRectClips(*layoutObject.layer(), *localPaintingInfo, graph icsContext, fragmentOffset, paintFlags, rule, roundedRects); 31 collectRoundedRectClips(*layoutObject.layer(), *localPaintingInfo, graph icsContext, fragmentOffset, paintFlags, rule, roundedRects);
30 } 32 }
31 33
32 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 34 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
33 if (m_graphicsContext.displayItemList()->displayItemConstructionIsDisabl ed()) 35 if (m_graphicsContext.displayItemList()->displayItemConstructionIsDisabl ed())
34 return; 36 return;
35 m_graphicsContext.displayItemList()->createAndAppend<ClipDisplayItem>(la youtObject, m_clipType, snappedClipRect, roundedRects); 37 m_graphicsContext.displayItemList()->createAndAppend<ClipDisplayItem>(la youtObject, m_clipType, snappedClipRect, roundedRects);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 m_graphicsContext.displayItemList()->removeLastDisplayItem(); 89 m_graphicsContext.displayItemList()->removeLastDisplayItem();
88 else 90 else
89 m_graphicsContext.displayItemList()->createAndAppend<EndClipDisp layItem>(m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType)); 91 m_graphicsContext.displayItemList()->createAndAppend<EndClipDisp layItem>(m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType));
90 } 92 }
91 } else { 93 } else {
92 m_graphicsContext.restore(); 94 m_graphicsContext.restore();
93 } 95 }
94 } 96 }
95 97
96 } // namespace blink 98 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698