OLD | NEW |
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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 // Now get the overflow rect that corresponds to the column. | 422 // Now get the overflow rect that corresponds to the column. |
423 LayoutRect flowThreadOverflowPortion = flowThreadPortionOverflowRect(flo
wThreadPortion, i, colCount, colGap); | 423 LayoutRect flowThreadOverflowPortion = flowThreadPortionOverflowRect(flo
wThreadPortion, i, colCount, colGap); |
424 | 424 |
425 // Do a repaint for this specific column. | 425 // Do a repaint for this specific column. |
426 repaintFlowThreadContentRectangle(repaintRect, flowThreadPortion, flowTh
readOverflowPortion, colRect.location()); | 426 repaintFlowThreadContentRectangle(repaintRect, flowThreadPortion, flowTh
readOverflowPortion, colRect.location()); |
427 } | 427 } |
428 } | 428 } |
429 | 429 |
430 void RenderMultiColumnSet::collectLayerFragments(LayerFragments& fragments, cons
t LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect) | 430 void RenderMultiColumnSet::collectLayerFragments(LayerFragments& fragments, cons
t LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect) |
431 { | 431 { |
432 // Put the layer bounds into flow thread-local coordinates by flipping it fi
rst. | 432 // The two rectangles passed to this method are physical, except that we pre
tend that there's |
| 433 // only one long column (that's how a flow thread works). |
| 434 // |
| 435 // Then there's the output from this method - the stuff we put into the list
of fragments. The |
| 436 // fragment.paginationOffset point is the actual physical translation requir
ed to get from a |
| 437 // location in the flow thread to a location in a given column. The fragment
.paginationClip |
| 438 // rectangle, on the other hand, is in the same coordinate system as the two
rectangles passed |
| 439 // to this method (flow thread coordinates). |
| 440 // |
| 441 // All other rectangles in this method are sized physically, and the inline
direction coordinate |
| 442 // is physical too, but the block direction coordinate is "logical top". Thi
s is the same as |
| 443 // e.g. RenderBox::frameRect(). These rectangles also pretend that there's o
nly one long column, |
| 444 // i.e. they are for the flow thread. |
| 445 |
| 446 // Put the layer bounds into flow thread-local coordinates by flipping it fi
rst. Since we're in |
| 447 // a renderer, most rectangles are represented this way. |
433 LayoutRect layerBoundsInFlowThread(layerBoundingBox); | 448 LayoutRect layerBoundsInFlowThread(layerBoundingBox); |
434 flowThread()->flipForWritingMode(layerBoundsInFlowThread); | 449 flowThread()->flipForWritingMode(layerBoundsInFlowThread); |
435 | 450 |
436 // Do the same for the dirty rect. | |
437 LayoutRect dirtyRectInFlowThread(dirtyRect); | |
438 flowThread()->flipForWritingMode(dirtyRectInFlowThread); | |
439 | |
440 // Now we can compare with the flow thread portions owned by each column. Fi
rst let's | 451 // Now we can compare with the flow thread portions owned by each column. Fi
rst let's |
441 // see if the rect intersects our flow thread portion at all. | 452 // see if the rect intersects our flow thread portion at all. |
442 LayoutRect clippedRect(layerBoundsInFlowThread); | 453 LayoutRect clippedRect(layerBoundsInFlowThread); |
443 clippedRect.intersect(RenderRegion::flowThreadPortionOverflowRect()); | 454 clippedRect.intersect(RenderRegion::flowThreadPortionOverflowRect()); |
444 if (clippedRect.isEmpty()) | 455 if (clippedRect.isEmpty()) |
445 return; | 456 return; |
446 | 457 |
447 // Now we know we intersect at least one column. Let's figure out the logica
l top and logical | 458 // Now we know we intersect at least one column. Let's figure out the logica
l top and logical |
448 // bottom of the area we're checking. | 459 // bottom of the area we're checking. |
449 LayoutUnit layerLogicalTop = isHorizontalWritingMode() ? layerBoundsInFlowTh
read.y() : layerBoundsInFlowThread.x(); | 460 LayoutUnit layerLogicalTop = isHorizontalWritingMode() ? layerBoundsInFlowTh
read.y() : layerBoundsInFlowThread.x(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 LayoutUnit blockOffset = isHorizontalWritingMode() ? -flowThreadPortion.
y() : -flowThreadPortion.x(); | 492 LayoutUnit blockOffset = isHorizontalWritingMode() ? -flowThreadPortion.
y() : -flowThreadPortion.x(); |
482 if (isFlippedBlocksWritingMode(style()->writingMode())) | 493 if (isFlippedBlocksWritingMode(style()->writingMode())) |
483 blockOffset = -blockOffset; | 494 blockOffset = -blockOffset; |
484 translationOffset.setY(blockOffset); | 495 translationOffset.setY(blockOffset); |
485 if (!isHorizontalWritingMode()) | 496 if (!isHorizontalWritingMode()) |
486 translationOffset = translationOffset.transposedPoint(); | 497 translationOffset = translationOffset.transposedPoint(); |
487 // FIXME: The translation needs to include the multicolumn set's content
offset within the | 498 // FIXME: The translation needs to include the multicolumn set's content
offset within the |
488 // multicolumn block as well. This won't be an issue until we start crea
ting multiple multicolumn sets. | 499 // multicolumn block as well. This won't be an issue until we start crea
ting multiple multicolumn sets. |
489 | 500 |
490 // Shift the dirty rect to be in flow thread coordinates with this trans
lation applied. | 501 // Shift the dirty rect to be in flow thread coordinates with this trans
lation applied. |
491 LayoutRect translatedDirtyRect(dirtyRectInFlowThread); | 502 LayoutRect translatedDirtyRect(dirtyRect); |
492 translatedDirtyRect.moveBy(-translationOffset); | 503 translatedDirtyRect.moveBy(-translationOffset); |
493 | 504 |
494 // See if we intersect the dirty rect. | 505 // See if we intersect the dirty rect. |
495 clippedRect = layerBoundsInFlowThread; | 506 clippedRect = layerBoundingBox; |
496 clippedRect.intersect(translatedDirtyRect); | 507 clippedRect.intersect(translatedDirtyRect); |
497 if (clippedRect.isEmpty()) | 508 if (clippedRect.isEmpty()) |
498 continue; | 509 continue; |
499 | 510 |
500 // Something does need to paint in this column. Make a fragment now and
supply the physical translation | 511 // Something does need to paint in this column. Make a fragment now and
supply the physical translation |
501 // offset and the clip rect for the column with that offset applied. | 512 // offset and the clip rect for the column with that offset applied. |
502 LayerFragment fragment; | 513 LayerFragment fragment; |
503 fragment.paginationOffset = translationOffset; | 514 fragment.paginationOffset = translationOffset; |
504 | 515 |
505 LayoutRect flippedFlowThreadOverflowPortion(flowThreadOverflowPortion); | 516 LayoutRect flippedFlowThreadOverflowPortion(flowThreadOverflowPortion); |
506 flipForWritingMode(flippedFlowThreadOverflowPortion); | 517 // Flip it into more a physical (RenderLayer-style) rectangle. |
| 518 flowThread()->flipForWritingMode(flippedFlowThreadOverflowPortion); |
507 fragment.paginationClip = flippedFlowThreadOverflowPortion; | 519 fragment.paginationClip = flippedFlowThreadOverflowPortion; |
508 fragments.append(fragment); | 520 fragments.append(fragment); |
509 } | 521 } |
510 } | 522 } |
511 | 523 |
512 const char* RenderMultiColumnSet::renderName() const | 524 const char* RenderMultiColumnSet::renderName() const |
513 { | 525 { |
514 return "RenderMultiColumnSet"; | 526 return "RenderMultiColumnSet"; |
515 } | 527 } |
516 | 528 |
517 } | 529 } |
OLD | NEW |