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

Side by Side Diff: Source/core/rendering/svg/SVGRootInlineBox.cpp

Issue 414863002: Minimize RenderObject* casting to RenderText* (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 4 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 /* 1 /*
2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006 Apple Computer Inc. 3 * Copyright (C) 2006 Apple Computer Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * Copyright (C) 2011 Torch Mobile (Beijing) CO. Ltd. All rights reserved. 6 * Copyright (C) 2011 Torch Mobile (Beijing) CO. Ltd. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 *last = temp; 252 *last = temp;
253 ++first; 253 ++first;
254 continue; 254 continue;
255 } 255 }
256 256
257 SVGInlineTextBox* firstTextBox = toSVGInlineTextBox(*first); 257 SVGInlineTextBox* firstTextBox = toSVGInlineTextBox(*first);
258 SVGInlineTextBox* lastTextBox = toSVGInlineTextBox(*last); 258 SVGInlineTextBox* lastTextBox = toSVGInlineTextBox(*last);
259 259
260 // Reordering is only necessary for BiDi text that is _absolutely_ posit ioned. 260 // Reordering is only necessary for BiDi text that is _absolutely_ posit ioned.
261 if (firstTextBox->len() == 1 && firstTextBox->len() == lastTextBox->len( )) { 261 if (firstTextBox->len() == 1 && firstTextBox->len() == lastTextBox->len( )) {
262 RenderSVGInlineText& firstContext = toRenderSVGInlineText(firstTextB ox->textRenderer()); 262 RenderSVGInlineText& firstContext = toRenderSVGInlineText(firstTextB ox->renderer());
263 RenderSVGInlineText& lastContext = toRenderSVGInlineText(lastTextBox ->textRenderer()); 263 RenderSVGInlineText& lastContext = toRenderSVGInlineText(lastTextBox ->renderer());
264 264
265 SVGTextLayoutAttributes* firstAttributes = 0; 265 SVGTextLayoutAttributes* firstAttributes = 0;
266 SVGTextLayoutAttributes* lastAttributes = 0; 266 SVGTextLayoutAttributes* lastAttributes = 0;
267 findFirstAndLastAttributesInVector(attributes, &firstContext, &lastC ontext, firstAttributes, lastAttributes); 267 findFirstAndLastAttributesInVector(attributes, &firstContext, &lastC ontext, firstAttributes, lastAttributes);
268 swapItemsInLayoutAttributes(firstAttributes, lastAttributes, firstTe xtBox->start(), lastTextBox->start()); 268 swapItemsInLayoutAttributes(firstAttributes, lastAttributes, firstTe xtBox->start(), lastTextBox->start());
269 } 269 }
270 270
271 InlineBox* temp = *first; 271 InlineBox* temp = *first;
272 *first = *last; 272 *first = *last;
273 *last = temp; 273 *last = temp;
274 274
275 ++first; 275 ++first;
276 } 276 }
277 } 277 }
278 278
279 void SVGRootInlineBox::reorderValueLists(Vector<SVGTextLayoutAttributes*>& attri butes) 279 void SVGRootInlineBox::reorderValueLists(Vector<SVGTextLayoutAttributes*>& attri butes)
280 { 280 {
281 Vector<InlineBox*> leafBoxesInLogicalOrder; 281 Vector<InlineBox*> leafBoxesInLogicalOrder;
282 collectLeafBoxesInLogicalOrder(leafBoxesInLogicalOrder, reverseInlineBoxRang eAndValueListsIfNeeded, &attributes); 282 collectLeafBoxesInLogicalOrder(leafBoxesInLogicalOrder, reverseInlineBoxRang eAndValueListsIfNeeded, &attributes);
283 } 283 }
284 284
285 } // namespace blink 285 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGRenderTreeAsText.cpp ('k') | Source/core/rendering/svg/SVGTextChunkBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698