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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 3 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/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/layout/LayoutBlock.h" 9 #include "core/layout/LayoutBlock.h"
10 #include "core/layout/LayoutView.h" 10 #include "core/layout/LayoutView.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 if (isFixedPosObjectInPagedMedia && view->isHorizontalWritingMode()) { 494 if (isFixedPosObjectInPagedMedia && view->isHorizontalWritingMode()) {
495 // "For paged media, boxes with fixed positions are repeated on every pa ge." 495 // "For paged media, boxes with fixed positions are repeated on every pa ge."
496 // - https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-pos itioning 496 // - https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-pos itioning
497 unsigned pages = ceilf(view->documentRect().height() / view->pageLogical Height()); 497 unsigned pages = ceilf(view->documentRect().height() / view->pageLogical Height());
498 LayoutPoint paginationOffset; 498 LayoutPoint paginationOffset;
499 for (unsigned i = 0; i < pages; i++) { 499 for (unsigned i = 0; i < pages; i++) {
500 PaintLayerFragment fragment; 500 PaintLayerFragment fragment;
501 fragment.backgroundRect = paintingInfo.paintDirtyRect; 501 fragment.backgroundRect = paintingInfo.paintDirtyRect;
502 fragment.paginationOffset = paginationOffset; 502 fragment.paginationOffset = paginationOffset;
503 fragments.append(fragment); 503 fragments.append(fragment);
504 paginationOffset += LayoutPoint(0, view->pageLogicalHeight()); 504 // TODO(crbug.com/638981): Is the conversion to int intentional?
505 paginationOffset += LayoutPoint(0, view->pageLogicalHeight().toInt() );
505 } 506 }
506 } else if (paginationLayer) { 507 } else if (paginationLayer) {
507 // FIXME: This is a mess. Look closely at this code and the code in Laye r and fix any 508 // FIXME: This is a mess. Look closely at this code and the code in Laye r and fix any
508 // issues in it & refactor to make it obvious from code structure what i t does and that it's 509 // issues in it & refactor to make it obvious from code structure what i t does and that it's
509 // correct. 510 // correct.
510 ClipRectsCacheSlot cacheSlot = (paintFlags & PaintLayerUncachedClipRects ) ? UncachedClipRects : PaintingClipRects; 511 ClipRectsCacheSlot cacheSlot = (paintFlags & PaintLayerUncachedClipRects ) ? UncachedClipRects : PaintingClipRects;
511 ShouldRespectOverflowClipType respectOverflowClip = shouldRespectOverflo wClip(paintFlags, m_paintLayer.layoutObject()); 512 ShouldRespectOverflowClipType respectOverflowClip = shouldRespectOverflo wClip(paintFlags, m_paintLayer.layoutObject());
512 // Calculate the transformed bounding box in the current coordinate spac e, to figure out 513 // Calculate the transformed bounding box in the current coordinate spac e, to figure out
513 // which fragmentainers (e.g. columns) we need to visit. 514 // which fragmentainers (e.g. columns) we need to visit.
514 LayoutRect transformedExtent = PaintLayer::transparencyClipBox(&m_paintL ayer, paginationLayer, PaintLayer::PaintingTransparencyClipBox, PaintLayer::Root OfTransparencyClipBox, paintingInfo.subPixelAccumulation, paintingInfo.getGlobal PaintFlags()); 515 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
816 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 817 if (!m_paintLayer.containsDirtyOverlayScrollbars())
817 return; 818 return;
818 819
819 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); 820 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize());
820 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 821 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
821 822
822 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 823 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
823 } 824 }
824 825
825 } // namespace blink 826 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698