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

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

Issue 1203343002: WIP for display item list backed by ListContainer Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/core/paint/LayerFixedPositionRecorder.cpp ('k') | Source/core/paint/SVGClipPainter.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/RoundedInnerRectClipper.h" 6 #include "core/paint/RoundedInnerRectClipper.h"
7 7
8 #include "core/layout/LayoutBox.h" 8 #include "core/layout/LayoutBox.h"
9 #include "core/paint/PaintInfo.h" 9 #include "core/paint/PaintInfo.h"
10 #include "platform/graphics/paint/ClipDisplayItem.h" 10 #include "platform/graphics/paint/ClipDisplayItem.h"
(...skipping 30 matching lines...) Expand all
41 topCornerRadii.setTopRight(clipRect.radii().topRight()); 41 topCornerRadii.setTopRight(clipRect.radii().topRight());
42 roundedRectClips->append(FloatRoundedRect(topCorner, topCornerRadii) ); 42 roundedRectClips->append(FloatRoundedRect(topCorner, topCornerRadii) );
43 43
44 FloatRect bottomCorner(clipRect.rect().x(), rect.y().toFloat(), rect .maxX() - clipRect.rect().x(), clipRect.rect().maxY() - rect.y().toFloat()); 44 FloatRect bottomCorner(clipRect.rect().x(), rect.y().toFloat(), rect .maxX() - clipRect.rect().x(), clipRect.rect().maxY() - rect.y().toFloat());
45 FloatRoundedRect::Radii bottomCornerRadii; 45 FloatRoundedRect::Radii bottomCornerRadii;
46 bottomCornerRadii.setBottomLeft(clipRect.radii().bottomLeft()); 46 bottomCornerRadii.setBottomLeft(clipRect.radii().bottomLeft());
47 roundedRectClips->append(FloatRoundedRect(bottomCorner, bottomCorner Radii)); 47 roundedRectClips->append(FloatRoundedRect(bottomCorner, bottomCorner Radii));
48 } 48 }
49 } 49 }
50 50
51 OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(layoutObje ct, m_clipType, LayoutRect::infiniteIntRect(), roundedRectClips.release()); 51 ALLOW_UNUSED_LOCAL(m_layoutObject);
52 if (m_useDisplayItemList) { 52 //OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(layoutOb ject, m_clipType, LayoutRect::infiniteIntRect(), roundedRectClips.release());
53 ASSERT(m_paintInfo.context->displayItemList()); 53 //if (m_useDisplayItemList) {
54 if (m_paintInfo.context->displayItemList()->displayItemConstructionIsDis abled()) 54 // ASSERT(m_paintInfo.context->displayItemList());
55 return; 55 // if (m_paintInfo.context->displayItemList()->displayItemConstructionIsD isabled())
56 m_paintInfo.context->displayItemList()->add(clipDisplayItem.release()); 56 // return;
57 } else { 57 // m_paintInfo.context->displayItemList()->add(clipDisplayItem.release()) ;
58 clipDisplayItem->replay(*paintInfo.context); 58 //} else {
59 } 59 // clipDisplayItem->replay(*paintInfo.context);
60 //}
60 } 61 }
61 62
62 RoundedInnerRectClipper::~RoundedInnerRectClipper() 63 RoundedInnerRectClipper::~RoundedInnerRectClipper()
63 { 64 {
64 DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType); 65 //DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType) ;
65 if (m_useDisplayItemList) { 66 //if (m_useDisplayItemList) {
66 ASSERT(m_paintInfo.context->displayItemList()); 67 // ASSERT(m_paintInfo.context->displayItemList());
67 if (!m_paintInfo.context->displayItemList()->displayItemConstructionIsDi sabled()) { 68 // if (!m_paintInfo.context->displayItemList()->displayItemConstructionIs Disabled()) {
68 if (m_paintInfo.context->displayItemList()->lastDisplayItemIsNoopBeg in()) 69 // if (m_paintInfo.context->displayItemList()->lastDisplayItemIsNoopB egin())
69 m_paintInfo.context->displayItemList()->removeLastDisplayItem(); 70 // m_paintInfo.context->displayItemList()->removeLastDisplayItem( );
70 else 71 // else
71 m_paintInfo.context->displayItemList()->add(EndClipDisplayItem:: create(m_layoutObject, endType)); 72 // m_paintInfo.context->displayItemList()->add(EndClipDisplayItem ::create(m_layoutObject, endType));
72 } 73 // }
73 } else { 74 //} else {
74 EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType); 75 // EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType);
75 endClipDisplayItem.replay(*m_paintInfo.context); 76 // endClipDisplayItem.replay(*m_paintInfo.context);
76 } 77 //}
77 } 78 }
78 79
79 } // namespace blink 80 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/LayerFixedPositionRecorder.cpp ('k') | Source/core/paint/SVGClipPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698