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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp

Issue 2770203002: Replace DCHECK with DCHECK_op and split some DCHECKs wherever necessary (Closed)
Patch Set: Add few more Created 3 years, 8 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 | « third_party/WebKit/Source/core/layout/shapes/ShapeInterval.h ('k') | no next file » | 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) Research In Motion Limited 2010-2012. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010-2012. 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 const LayoutSVGInlineText* SVGTextLayoutEngine::currentLogicalCharacterMetrics( 307 const LayoutSVGInlineText* SVGTextLayoutEngine::currentLogicalCharacterMetrics(
308 SVGTextMetrics& logicalMetrics) { 308 SVGTextMetrics& logicalMetrics) {
309 // If we've consumed all text nodes, there can be no more metrics. 309 // If we've consumed all text nodes, there can be no more metrics.
310 if (m_currentLogicalTextNodeIndex == m_descendantTextNodes.size()) 310 if (m_currentLogicalTextNodeIndex == m_descendantTextNodes.size())
311 return nullptr; 311 return nullptr;
312 312
313 const LayoutSVGInlineText* logicalTextNode = 313 const LayoutSVGInlineText* logicalTextNode =
314 m_descendantTextNodes[m_currentLogicalTextNodeIndex]; 314 m_descendantTextNodes[m_currentLogicalTextNodeIndex];
315 const Vector<SVGTextMetrics>* metricsList = &logicalTextNode->metricsList(); 315 const Vector<SVGTextMetrics>* metricsList = &logicalTextNode->metricsList();
316 unsigned metricsListSize = metricsList->size(); 316 unsigned metricsListSize = metricsList->size();
317 DCHECK(m_logicalMetricsListOffset <= metricsListSize); 317 DCHECK_LE(m_logicalMetricsListOffset, metricsListSize);
318 318
319 // Find the next non-collapsed text metrics cell. 319 // Find the next non-collapsed text metrics cell.
320 while (true) { 320 while (true) {
321 // If we run out of metrics, move to the next set of non-empty layout 321 // If we run out of metrics, move to the next set of non-empty layout
322 // attributes. 322 // attributes.
323 if (m_logicalMetricsListOffset == metricsListSize) { 323 if (m_logicalMetricsListOffset == metricsListSize) {
324 logicalTextNode = nextLogicalTextNode(); 324 logicalTextNode = nextLogicalTextNode();
325 if (!logicalTextNode) 325 if (!logicalTextNode)
326 return nullptr; 326 return nullptr;
327 metricsList = &logicalTextNode->metricsList(); 327 metricsList = &logicalTextNode->metricsList();
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 536 }
537 537
538 if (!didStartTextFragment) 538 if (!didStartTextFragment)
539 return; 539 return;
540 540
541 // Close last open fragment, if needed. 541 // Close last open fragment, if needed.
542 recordTextFragment(textBox); 542 recordTextFragment(textBox);
543 } 543 }
544 544
545 } // namespace blink 545 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/shapes/ShapeInterval.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698