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

Side by Side Diff: Source/core/layout/line/InlineBox.cpp

Issue 1202413003: SP: Optimize calculating cull rects for inline text and ellipsis boxes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/line/InlineBox.h ('k') | Source/core/paint/EllipsisBoxPainter.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 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 if (!UNLIKELY(layoutObject().hasFlippedBlocksWritingMode())) 334 if (!UNLIKELY(layoutObject().hasFlippedBlocksWritingMode()))
335 return LayoutPoint(point.x(), point.y()); 335 return LayoutPoint(point.x(), point.y());
336 336
337 LayoutBlockFlow& block = root().block(); 337 LayoutBlockFlow& block = root().block();
338 if (block.style()->isHorizontalWritingMode()) 338 if (block.style()->isHorizontalWritingMode())
339 return LayoutPoint(point.x(), block.size().height() - size.height() - po int.y()); 339 return LayoutPoint(point.x(), block.size().height() - size.height() - po int.y());
340 340
341 return LayoutPoint(block.size().width() - size.width() - point.x(), point.y( )); 341 return LayoutPoint(block.size().width() - size.width() - point.x(), point.y( ));
342 } 342 }
343 343
344 LayoutRect InlineBox::logicalRectToPhysicalRect(const LayoutRect& current) 344 void InlineBox::logicalRectToPhysicalRect(LayoutRect& current)
345 { 345 {
346 LayoutRect retval = current; 346 if (isHorizontal() && !layoutObject().hasFlippedBlocksWritingMode())
347 return;
348
347 if (!isHorizontal()) { 349 if (!isHorizontal()) {
348 retval = retval.transposedRect(); 350 current = current.transposedRect();
349 } 351 }
350 retval.setLocation(logicalPositionToPhysicalPoint(retval.location(), retval. size())); 352 current.setLocation(logicalPositionToPhysicalPoint(current.location(), curre nt.size()));
351 return retval; 353 return;
wkorman 2015/06/24 00:45:53 don't need return
352 } 354 }
353 355
354 void InlineBox::flipForWritingMode(FloatRect& rect) 356 void InlineBox::flipForWritingMode(FloatRect& rect)
355 { 357 {
356 if (!UNLIKELY(layoutObject().hasFlippedBlocksWritingMode())) 358 if (!UNLIKELY(layoutObject().hasFlippedBlocksWritingMode()))
357 return; 359 return;
358 root().block().flipForWritingMode(rect); 360 root().block().flipForWritingMode(rect);
359 } 361 }
360 362
361 FloatPoint InlineBox::flipForWritingMode(const FloatPoint& point) 363 FloatPoint InlineBox::flipForWritingMode(const FloatPoint& point)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 395
394 void showLineTree(const blink::InlineBox* b) 396 void showLineTree(const blink::InlineBox* b)
395 { 397 {
396 if (b) 398 if (b)
397 b->showLineTreeForThis(); 399 b->showLineTreeForThis();
398 else 400 else
399 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n"); 401 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n");
400 } 402 }
401 403
402 #endif 404 #endif
OLDNEW
« no previous file with comments | « Source/core/layout/line/InlineBox.h ('k') | Source/core/paint/EllipsisBoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698