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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 18 matching lines...) Expand all
29 #include "core/layout/api/LineLayoutRubyBase.h" 29 #include "core/layout/api/LineLayoutRubyBase.h"
30 #include "core/layout/api/LineLayoutRubyRun.h" 30 #include "core/layout/api/LineLayoutRubyRun.h"
31 #include "core/layout/api/LineLayoutRubyText.h" 31 #include "core/layout/api/LineLayoutRubyText.h"
32 #include "core/layout/line/GlyphOverflow.h" 32 #include "core/layout/line/GlyphOverflow.h"
33 #include "core/layout/line/InlineTextBox.h" 33 #include "core/layout/line/InlineTextBox.h"
34 #include "core/layout/line/RootInlineBox.h" 34 #include "core/layout/line/RootInlineBox.h"
35 #include "core/paint/BoxPainter.h" 35 #include "core/paint/BoxPainter.h"
36 #include "core/paint/InlineFlowBoxPainter.h" 36 #include "core/paint/InlineFlowBoxPainter.h"
37 #include "core/style/ShadowList.h" 37 #include "core/style/ShadowList.h"
38 #include "platform/fonts/Font.h" 38 #include "platform/fonts/Font.h"
39 #include "wtf/PtrUtil.h"
40 #include <algorithm> 39 #include <algorithm>
41 #include <math.h> 40 #include <math.h>
42 41
43 namespace blink { 42 namespace blink {
44 43
45 struct SameSizeAsInlineFlowBox : public InlineBox { 44 struct SameSizeAsInlineFlowBox : public InlineBox {
46 void* pointers[5]; 45 void* pointers[5];
47 uint32_t bitfields : 23; 46 uint32_t bitfields : 23;
48 }; 47 };
49 48
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow, li neTop, lineBottom); 945 setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow, li neTop, lineBottom);
947 } 946 }
948 947
949 void InlineFlowBox::setLayoutOverflow(const LayoutRect& rect, const LayoutRect& frameBox) 948 void InlineFlowBox::setLayoutOverflow(const LayoutRect& rect, const LayoutRect& frameBox)
950 { 949 {
951 ASSERT(!knownToHaveNoOverflow()); 950 ASSERT(!knownToHaveNoOverflow());
952 if (frameBox.contains(rect) || rect.isEmpty()) 951 if (frameBox.contains(rect) || rect.isEmpty())
953 return; 952 return;
954 953
955 if (!m_overflow) 954 if (!m_overflow)
956 m_overflow = wrapUnique(new SimpleOverflowModel(frameBox, frameBox)); 955 m_overflow = adoptPtr(new SimpleOverflowModel(frameBox, frameBox));
957 956
958 m_overflow->setLayoutOverflow(rect); 957 m_overflow->setLayoutOverflow(rect);
959 } 958 }
960 959
961 void InlineFlowBox::setVisualOverflow(const LayoutRect& rect, const LayoutRect& frameBox) 960 void InlineFlowBox::setVisualOverflow(const LayoutRect& rect, const LayoutRect& frameBox)
962 { 961 {
963 ASSERT(!knownToHaveNoOverflow()); 962 ASSERT(!knownToHaveNoOverflow());
964 if (frameBox.contains(rect) || rect.isEmpty()) 963 if (frameBox.contains(rect) || rect.isEmpty())
965 return; 964 return;
966 965
967 if (!m_overflow) 966 if (!m_overflow)
968 m_overflow = wrapUnique(new SimpleOverflowModel(frameBox, frameBox)); 967 m_overflow = adoptPtr(new SimpleOverflowModel(frameBox, frameBox));
969 968
970 m_overflow->setVisualOverflow(rect); 969 m_overflow->setVisualOverflow(rect);
971 } 970 }
972 971
973 void InlineFlowBox::setOverflowFromLogicalRects(const LayoutRect& logicalLayoutO verflow, const LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom) 972 void InlineFlowBox::setOverflowFromLogicalRects(const LayoutRect& logicalLayoutO verflow, const LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom)
974 { 973 {
975 ASSERT(!knownToHaveNoOverflow()); 974 ASSERT(!knownToHaveNoOverflow());
976 LayoutRect frameBox = frameRectIncludingLineHeight(lineTop, lineBottom); 975 LayoutRect frameBox = frameRectIncludingLineHeight(lineTop, lineBottom);
977 976
978 LayoutRect layoutOverflow(isHorizontal() ? logicalLayoutOverflow : logicalLa youtOverflow.transposedRect()); 977 LayoutRect layoutOverflow(isHorizontal() ? logicalLayoutOverflow : logicalLa youtOverflow.transposedRect());
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 ASSERT(child->prevOnLine() == prev); 1315 ASSERT(child->prevOnLine() == prev);
1317 prev = child; 1316 prev = child;
1318 } 1317 }
1319 ASSERT(prev == m_lastChild); 1318 ASSERT(prev == m_lastChild);
1320 #endif 1319 #endif
1321 } 1320 }
1322 1321
1323 #endif 1322 #endif
1324 1323
1325 } // namespace blink 1324 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineFlowBox.h ('k') | third_party/WebKit/Source/core/layout/line/RootInlineBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698