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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2266273002: Use LayoutUnit where previously LayoutUnits were implicitly converted to int (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "core/layout/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/paint/ClipPathClipper.h" 9 #include "core/paint/ClipPathClipper.h"
10 #include "core/paint/FilterPainter.h" 10 #include "core/paint/FilterPainter.h"
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 if (isFixedPosObjectInPagedMedia && view->isHorizontalWritingMode()) { 433 if (isFixedPosObjectInPagedMedia && view->isHorizontalWritingMode()) {
434 // "For paged media, boxes with fixed positions are repeated on every pa ge." 434 // "For paged media, boxes with fixed positions are repeated on every pa ge."
435 // - https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-pos itioning 435 // - https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-pos itioning
436 unsigned pages = ceilf(view->documentRect().height() / view->pageLogical Height()); 436 unsigned pages = ceilf(view->documentRect().height() / view->pageLogical Height());
437 LayoutPoint paginationOffset; 437 LayoutPoint paginationOffset;
438 for (unsigned i = 0; i < pages; i++) { 438 for (unsigned i = 0; i < pages; i++) {
439 PaintLayerFragment fragment; 439 PaintLayerFragment fragment;
440 fragment.backgroundRect = paintingInfo.paintDirtyRect; 440 fragment.backgroundRect = paintingInfo.paintDirtyRect;
441 fragment.paginationOffset = paginationOffset; 441 fragment.paginationOffset = paginationOffset;
442 fragments.append(fragment); 442 fragments.append(fragment);
443 // TODO(crbug.com/638981): Is the conversion to int intentional? 443 paginationOffset += LayoutPoint(LayoutUnit(), view->pageLogicalHeigh t());
444 paginationOffset += LayoutPoint(0, view->pageLogicalHeight().toInt() );
445 } 444 }
446 } else if (paginationLayer) { 445 } else if (paginationLayer) {
447 // FIXME: This is a mess. Look closely at this code and the code in Laye r and fix any 446 // FIXME: This is a mess. Look closely at this code and the code in Laye r and fix any
448 // issues in it & refactor to make it obvious from code structure what i t does and that it's 447 // issues in it & refactor to make it obvious from code structure what i t does and that it's
449 // correct. 448 // correct.
450 ClipRectsCacheSlot cacheSlot = (paintFlags & PaintLayerUncachedClipRects ) ? UncachedClipRects : PaintingClipRects; 449 ClipRectsCacheSlot cacheSlot = (paintFlags & PaintLayerUncachedClipRects ) ? UncachedClipRects : PaintingClipRects;
451 ShouldRespectOverflowClipType respectOverflowClip = shouldRespectOverflo wClip(paintFlags, m_paintLayer.layoutObject()); 450 ShouldRespectOverflowClipType respectOverflowClip = shouldRespectOverflo wClip(paintFlags, m_paintLayer.layoutObject());
452 // Calculate the transformed bounding box in the current coordinate spac e, to figure out 451 // Calculate the transformed bounding box in the current coordinate spac e, to figure out
453 // which fragmentainers (e.g. columns) we need to visit. 452 // which fragmentainers (e.g. columns) we need to visit.
454 LayoutRect transformedExtent = PaintLayer::transparencyClipBox(&m_paintL ayer, paginationLayer, PaintLayer::PaintingTransparencyClipBox, PaintLayer::Root OfTransparencyClipBox, paintingInfo.subPixelAccumulation, paintingInfo.getGlobal PaintFlags()); 453 LayoutRect transformedExtent = PaintLayer::transparencyClipBox(&m_paintL ayer, paginationLayer, PaintLayer::PaintingTransparencyClipBox, PaintLayer::Root OfTransparencyClipBox, paintingInfo.subPixelAccumulation, paintingInfo.getGlobal PaintFlags());
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 755 if (!m_paintLayer.containsDirtyOverlayScrollbars())
757 return; 756 return;
758 757
759 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); 758 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize());
760 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 759 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
761 760
762 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 761 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
763 } 762 }
764 763
765 } // namespace blink 764 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698