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

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

Issue 2667493002: Changed EPosition to an enum class and renamed its members (Closed)
Patch Set: Rebase Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "core/paint/PaintLayer.h" 51 #include "core/paint/PaintLayer.h"
52 52
53 namespace blink { 53 namespace blink {
54 54
55 static void adjustClipRectsForChildren(const LayoutBoxModelObject& layoutObject, 55 static void adjustClipRectsForChildren(const LayoutBoxModelObject& layoutObject,
56 ClipRects& clipRects) { 56 ClipRects& clipRects) {
57 EPosition position = layoutObject.styleRef().position(); 57 EPosition position = layoutObject.styleRef().position();
58 // A fixed object is essentially the root of its containing block hierarchy, 58 // A fixed object is essentially the root of its containing block hierarchy,
59 // so when we encounter such an object, we reset our clip rects to the 59 // so when we encounter such an object, we reset our clip rects to the
60 // fixedClipRect. 60 // fixedClipRect.
61 if (position == FixedPosition) { 61 if (position == EPosition::kFixed) {
62 clipRects.setPosClipRect(clipRects.fixedClipRect()); 62 clipRects.setPosClipRect(clipRects.fixedClipRect());
63 clipRects.setOverflowClipRect(clipRects.fixedClipRect()); 63 clipRects.setOverflowClipRect(clipRects.fixedClipRect());
64 clipRects.setFixed(true); 64 clipRects.setFixed(true);
65 } else if (position == RelativePosition) { 65 } else if (position == EPosition::kRelative) {
66 clipRects.setPosClipRect(clipRects.overflowClipRect()); 66 clipRects.setPosClipRect(clipRects.overflowClipRect());
67 } else if (position == AbsolutePosition) { 67 } else if (position == EPosition::kAbsolute) {
68 clipRects.setOverflowClipRect(clipRects.posClipRect()); 68 clipRects.setOverflowClipRect(clipRects.posClipRect());
69 } 69 }
70 } 70 }
71 71
72 static void applyClipRects(const ClipRectsContext& context, 72 static void applyClipRects(const ClipRectsContext& context,
73 const LayoutBoxModelObject& layoutObject, 73 const LayoutBoxModelObject& layoutObject,
74 LayoutPoint offset, 74 LayoutPoint offset,
75 ClipRects& clipRects) { 75 ClipRects& clipRects) {
76 DCHECK(layoutObject.isBox()); 76 DCHECK(layoutObject.isBox());
77 const LayoutBox& box = *toLayoutBox(&layoutObject); 77 const LayoutBox& box = *toLayoutBox(&layoutObject);
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 // space. 416 // space.
417 applyClipRects(context, layoutObject, 417 applyClipRects(context, layoutObject,
418 LayoutPoint(layoutObject.localToAncestorPoint( 418 LayoutPoint(layoutObject.localToAncestorPoint(
419 FloatPoint(), context.rootLayer->layoutObject())), 419 FloatPoint(), context.rootLayer->layoutObject())),
420 clipRects); 420 clipRects);
421 } 421 }
422 } 422 }
423 423
424 static ClipRect backgroundClipRectForPosition(const ClipRects& parentRects, 424 static ClipRect backgroundClipRectForPosition(const ClipRects& parentRects,
425 EPosition position) { 425 EPosition position) {
426 if (position == FixedPosition) 426 if (position == EPosition::kFixed)
427 return parentRects.fixedClipRect(); 427 return parentRects.fixedClipRect();
428 428
429 if (position == AbsolutePosition) 429 if (position == EPosition::kAbsolute)
430 return parentRects.posClipRect(); 430 return parentRects.posClipRect();
431 431
432 return parentRects.overflowClipRect(); 432 return parentRects.overflowClipRect();
433 } 433 }
434 434
435 ClipRect PaintLayerClipper::clipRectWithGeometryMapper( 435 ClipRect PaintLayerClipper::clipRectWithGeometryMapper(
436 const ClipRectsContext& context, 436 const ClipRectsContext& context,
437 bool isForeground) const { 437 bool isForeground) const {
438 DCHECK(m_geometryMapper); 438 DCHECK(m_geometryMapper);
439 LayoutRect source(LayoutRect::infiniteIntRect()); 439 LayoutRect source(LayoutRect::infiniteIntRect());
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 const LayoutSize& subpixelAccumulation) const { 575 const LayoutSize& subpixelAccumulation) const {
576 DCHECK(!m_geometryMapper); 576 DCHECK(!m_geometryMapper);
577 ClipRectsContext context(rootLayer, PaintingClipRects, 577 ClipRectsContext context(rootLayer, PaintingClipRects,
578 IgnoreOverlayScrollbarSize, subpixelAccumulation); 578 IgnoreOverlayScrollbarSize, subpixelAccumulation);
579 if (respectOverflowClip == IgnoreOverflowClip) 579 if (respectOverflowClip == IgnoreOverflowClip)
580 context.setIgnoreOverflowClip(); 580 context.setIgnoreOverflowClip();
581 return getClipRects(context); 581 return getClipRects(context);
582 } 582 }
583 583
584 } // namespace blink 584 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698