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

Side by Side Diff: Source/core/layout/line/InlineIterator.h

Issue 1318713003: Make classes and structures in core/layout fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/layout/line/InlineBox.h ('k') | Source/core/layout/line/LayoutTextInfo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All right r eserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All right r eserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 10 matching lines...) Expand all
21 */ 21 */
22 22
23 #ifndef InlineIterator_h 23 #ifndef InlineIterator_h
24 #define InlineIterator_h 24 #define InlineIterator_h
25 25
26 #include "core/layout/BidiRun.h" 26 #include "core/layout/BidiRun.h"
27 #include "core/layout/LayoutBlockFlow.h" 27 #include "core/layout/LayoutBlockFlow.h"
28 #include "core/layout/api/LineLayoutBlockFlow.h" 28 #include "core/layout/api/LineLayoutBlockFlow.h"
29 #include "core/layout/api/LineLayoutInline.h" 29 #include "core/layout/api/LineLayoutInline.h"
30 #include "core/layout/api/LineLayoutText.h" 30 #include "core/layout/api/LineLayoutText.h"
31 31 #include "wtf/Allocator.h"
32 #include "wtf/StdLibExtras.h" 32 #include "wtf/StdLibExtras.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 // This class is used to LayoutInline subtrees, stepping by character within the 36 // This class is used to LayoutInline subtrees, stepping by character within the
37 // text children. InlineIterator will use bidiNext to find the next LayoutText 37 // text children. InlineIterator will use bidiNext to find the next LayoutText
38 // optionally notifying a BidiResolver every time it steps into/out of a LayoutI nline. 38 // optionally notifying a BidiResolver every time it steps into/out of a LayoutI nline.
39 class InlineIterator { 39 class InlineIterator {
40 ALLOW_ONLY_INLINE_ALLOCATION();
40 public: 41 public:
41 enum IncrementRule { 42 enum IncrementRule {
42 FastIncrementInIsolatedLayout, 43 FastIncrementInIsolatedLayout,
43 FastIncrementInTextNode 44 FastIncrementInTextNode
44 }; 45 };
45 46
46 InlineIterator() 47 InlineIterator()
47 : m_root(nullptr) 48 : m_root(nullptr)
48 , m_obj(nullptr) 49 , m_obj(nullptr)
49 , m_nextBreakablePosition(-1) 50 , m_nextBreakablePosition(-1)
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 ASSERT(m_obj); 330 ASSERT(m_obj);
330 ASSERT(m_obj.isText()); 331 ASSERT(m_obj.isText());
331 ASSERT(m_pos <= LineLayoutText(m_obj).textLength()); 332 ASSERT(m_pos <= LineLayoutText(m_obj).textLength());
332 if (m_pos < INT_MAX) 333 if (m_pos < INT_MAX)
333 m_pos++; 334 m_pos++;
334 } 335 }
335 336
336 // FIXME: This is used by LayoutBlockFlow for simplified layout, and has nothing to do with bidi 337 // FIXME: This is used by LayoutBlockFlow for simplified layout, and has nothing to do with bidi
337 // it shouldn't use functions called bidiFirst and bidiNext. 338 // it shouldn't use functions called bidiFirst and bidiNext.
338 class InlineWalker { 339 class InlineWalker {
340 STACK_ALLOCATED();
339 public: 341 public:
340 InlineWalker(LayoutBlockFlow* root) 342 InlineWalker(LayoutBlockFlow* root)
341 : m_root(LineLayoutBlockFlow(root)) 343 : m_root(LineLayoutBlockFlow(root))
342 , m_current(nullptr) 344 , m_current(nullptr)
343 , m_atEndOfInline(false) 345 , m_atEndOfInline(false)
344 { 346 {
345 // FIXME: This class should be taught how to do the SkipEmptyInlines cod epath as well. 347 // FIXME: This class should be taught how to do the SkipEmptyInlines cod epath as well.
346 m_current = bidiFirstIncludingEmptyInlines(m_root); 348 m_current = bidiFirstIncludingEmptyInlines(m_root);
347 } 349 }
348 350
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 { 567 {
566 return new BidiRun(start, end, obj, resolver.context(), resolver.dir()); 568 return new BidiRun(start, end, obj, resolver.context(), resolver.dir());
567 } 569 }
568 570
569 enum AppendRunBehavior { 571 enum AppendRunBehavior {
570 AppendingFakeRun, 572 AppendingFakeRun,
571 AppendingRunsForObject 573 AppendingRunsForObject
572 }; 574 };
573 575
574 class IsolateTracker { 576 class IsolateTracker {
577 STACK_ALLOCATED();
575 public: 578 public:
576 explicit IsolateTracker(BidiRunList<BidiRun>& runs, unsigned nestedIsolateCo unt) 579 explicit IsolateTracker(BidiRunList<BidiRun>& runs, unsigned nestedIsolateCo unt)
577 : m_nestedIsolateCount(nestedIsolateCount) 580 : m_nestedIsolateCount(nestedIsolateCount)
578 , m_haveAddedFakeRunForRootIsolate(false) 581 , m_haveAddedFakeRunForRootIsolate(false)
579 , m_runs(runs) 582 , m_runs(runs)
580 { 583 {
581 } 584 }
582 585
583 void setMidpointStateForRootIsolate(const LineMidpointState& midpointState) 586 void setMidpointStateForRootIsolate(const LineMidpointState& midpointState)
584 { 587 {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 m_sor = m_eor; 741 m_sor = m_eor;
739 } 742 }
740 743
741 m_direction = WTF::Unicode::OtherNeutral; 744 m_direction = WTF::Unicode::OtherNeutral;
742 m_status.eor = WTF::Unicode::OtherNeutral; 745 m_status.eor = WTF::Unicode::OtherNeutral;
743 } 746 }
744 747
745 } 748 }
746 749
747 #endif // InlineIterator_h 750 #endif // InlineIterator_h
OLDNEW
« no previous file with comments | « Source/core/layout/line/InlineBox.h ('k') | Source/core/layout/line/LayoutTextInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698