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

Side by Side Diff: Source/core/rendering/RenderMultiColumnSet.cpp

Issue 757933003: Get rid of a lot of special code for RenderFlowThread invalidation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ahemify and pxify tests. Created 6 years 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/rendering/RenderMultiColumnSet.h ('k') | Source/core/rendering/RenderObject.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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 overflowRect.shiftMaxYEdgeTo(portionRect.maxY() + colGap - colGap / 2); 424 overflowRect.shiftMaxYEdgeTo(portionRect.maxY() + colGap - colGap / 2);
425 } 425 }
426 return overflowRect; 426 return overflowRect;
427 } 427 }
428 428
429 void RenderMultiColumnSet::paintObject(const PaintInfo& paintInfo, const LayoutP oint& paintOffset) 429 void RenderMultiColumnSet::paintObject(const PaintInfo& paintInfo, const LayoutP oint& paintOffset)
430 { 430 {
431 MultiColumnSetPainter(*this).paintObject(paintInfo, paintOffset); 431 MultiColumnSetPainter(*this).paintObject(paintInfo, paintOffset);
432 } 432 }
433 433
434 void RenderMultiColumnSet::paintInvalidationForFlowThreadContent(const LayoutRec t& paintInvalidationRect)
435 {
436 // Figure out the start and end columns and only check within that range so that we don't walk the
437 // entire column set. Put the paint invalidation rect into flow thread coord inates by flipping it first.
438 LayoutRect flowThreadPaintInvalidationRect(paintInvalidationRect);
439 flowThread()->flipForWritingMode(flowThreadPaintInvalidationRect);
440
441 // Now we can compare this rect with the flow thread portions owned by each column. First let's
442 // just see if the paint invalidation rect intersects our flow thread portio n at all.
443 LayoutRect clippedRect(flowThreadPaintInvalidationRect);
444 clippedRect.intersect(RenderRegion::flowThreadPortionOverflowRect());
445 if (clippedRect.isEmpty())
446 return;
447
448 // Now we know we intersect at least one column. Let's figure out the logica l top and logical
449 // bottom of the area in which we're issuing paint invalidations.
450 LayoutUnit paintInvalidationLogicalTop = isHorizontalWritingMode() ? flowThr eadPaintInvalidationRect.y() : flowThreadPaintInvalidationRect.x();
451 LayoutUnit paintInvalidationLogicalBottom = (isHorizontalWritingMode() ? flo wThreadPaintInvalidationRect.maxY() : flowThreadPaintInvalidationRect.maxX()) - 1;
452
453 unsigned startColumn = columnIndexAtOffset(paintInvalidationLogicalTop);
454 unsigned endColumn = columnIndexAtOffset(paintInvalidationLogicalBottom);
455
456 LayoutUnit colGap = columnGap();
457 unsigned colCount = actualColumnCount();
458 for (unsigned i = startColumn; i <= endColumn; i++) {
459 LayoutRect colRect = columnRectAt(i);
460
461 // Get the portion of the flow thread that corresponds to this column.
462 LayoutRect flowThreadPortion = flowThreadPortionRectAt(i);
463
464 // Now get the overflow rect that corresponds to the column.
465 LayoutRect flowThreadOverflowPortion = flowThreadPortionOverflowRect(flo wThreadPortion, i, colCount, colGap);
466
467 // Do a paint invalidation for this specific column.
468 paintInvalidationOfFlowThreadContentRectangle(paintInvalidationRect, flo wThreadPortion, flowThreadOverflowPortion, colRect.location());
469 }
470 }
471
472 void RenderMultiColumnSet::collectLayerFragments(LayerFragments& fragments, cons t LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect) 434 void RenderMultiColumnSet::collectLayerFragments(LayerFragments& fragments, cons t LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect)
473 { 435 {
474 // |layerBoundingBox| is in the flow thread coordinate space, relative to th e top/left edge of 436 // |layerBoundingBox| is in the flow thread coordinate space, relative to th e top/left edge of
475 // the flow thread, but note that it has been converted with respect to writ ing mode (so that 437 // the flow thread, but note that it has been converted with respect to writ ing mode (so that
476 // it's visual/physical in that sense). 438 // it's visual/physical in that sense).
477 // 439 //
478 // |dirtyRect| is visual, relative to the multicol container. 440 // |dirtyRect| is visual, relative to the multicol container.
479 // 441 //
480 // Then there's the output from this method - the stuff we put into the list of fragments. The 442 // Then there's the output from this method - the stuff we put into the list of fragments. The
481 // fragment.paginationOffset point is the actual visual translation required to get from a 443 // fragment.paginationOffset point is the actual visual translation required to get from a
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 590
629 void RenderMultiColumnSet::detachRegion() 591 void RenderMultiColumnSet::detachRegion()
630 { 592 {
631 if (m_flowThread) { 593 if (m_flowThread) {
632 m_flowThread->removeRegionFromThread(this); 594 m_flowThread->removeRegionFromThread(this);
633 m_flowThread = 0; 595 m_flowThread = 0;
634 } 596 }
635 } 597 }
636 598
637 } 599 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderMultiColumnSet.h ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698