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

Side by Side Diff: sky/engine/core/rendering/RenderLayerClipper.cpp

Issue 681023002: Remove a bunch of frame-level scrolling machinery. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 clipRects.setPosClipRect(clipRects.overflowClipRect()); 62 clipRects.setPosClipRect(clipRects.overflowClipRect());
63 } else if (position == AbsolutePosition) { 63 } else if (position == AbsolutePosition) {
64 clipRects.setOverflowClipRect(clipRects.posClipRect()); 64 clipRects.setOverflowClipRect(clipRects.posClipRect());
65 } 65 }
66 } 66 }
67 67
68 static void applyClipRects(const ClipRectsContext& context, RenderObject& render er, LayoutPoint offset, ClipRects& clipRects) 68 static void applyClipRects(const ClipRectsContext& context, RenderObject& render er, LayoutPoint offset, ClipRects& clipRects)
69 { 69 {
70 ASSERT(renderer.hasOverflowClip() || renderer.hasClip()); 70 ASSERT(renderer.hasOverflowClip() || renderer.hasClip());
71 71
72 RenderView* view = renderer.view();
73 ASSERT(view);
74 if (clipRects.fixed() && context.rootLayer->renderer() == view)
75 offset -= view->frameView()->scrollOffsetForFixedPosition();
76
77 if (renderer.hasOverflowClip()) { 72 if (renderer.hasOverflowClip()) {
78 ClipRect newOverflowClip = toRenderBox(renderer).overflowClipRect(offset , context.scrollbarRelevancy); 73 ClipRect newOverflowClip = toRenderBox(renderer).overflowClipRect(offset , context.scrollbarRelevancy);
79 newOverflowClip.setHasRadius(renderer.style()->hasBorderRadius()); 74 newOverflowClip.setHasRadius(renderer.style()->hasBorderRadius());
80 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov erflowClipRect())); 75 clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.ov erflowClipRect()));
81 if (renderer.isPositioned()) 76 if (renderer.isPositioned())
82 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos ClipRect())); 77 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.pos ClipRect()));
83 } 78 }
84 79
85 if (renderer.hasClip()) { 80 if (renderer.hasClip()) {
86 LayoutRect newClip = toRenderBox(renderer).clipRect(offset); 81 LayoutRect newClip = toRenderBox(renderer).clipRect(offset);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 { 317 {
323 ASSERT(m_renderer.layer()->parent()); 318 ASSERT(m_renderer.layer()->parent());
324 ASSERT(m_renderer.view()); 319 ASSERT(m_renderer.view());
325 320
326 ClipRects parentClipRects; 321 ClipRects parentClipRects;
327 if (m_renderer.layer() == context.rootLayer) 322 if (m_renderer.layer() == context.rootLayer)
328 parentClipRects.reset(PaintInfo::infiniteRect()); 323 parentClipRects.reset(PaintInfo::infiniteRect());
329 else 324 else
330 m_renderer.layer()->parent()->clipper().getOrCalculateClipRects(context, parentClipRects); 325 m_renderer.layer()->parent()->clipper().getOrCalculateClipRects(context, parentClipRects);
331 326
332 ClipRect result = backgroundClipRectForPosition(parentClipRects, m_renderer. style()->position()); 327 return backgroundClipRectForPosition(parentClipRects, m_renderer.style()->po sition());
333
334 // Note: infinite clipRects should not be scrolled here, otherwise they will accidentally no longer be considered infinite.
335 if (parentClipRects.fixed() && context.rootLayer->renderer() == m_renderer.v iew() && result != PaintInfo::infiniteRect())
336 result.move(m_renderer.view()->frameView()->scrollOffsetForFixedPosition ());
337
338 return result;
339 } 328 }
340 329
341 void RenderLayerClipper::getOrCalculateClipRects(const ClipRectsContext& context , ClipRects& clipRects) const 330 void RenderLayerClipper::getOrCalculateClipRects(const ClipRectsContext& context , ClipRects& clipRects) const
342 { 331 {
343 if (context.usesCache()) 332 if (context.usesCache())
344 clipRects = *getClipRects(context); 333 clipRects = *getClipRects(context);
345 else 334 else
346 calculateClipRects(context, clipRects); 335 calculateClipRects(context, clipRects);
347 } 336 }
348 337
(...skipping 15 matching lines...) Expand all
364 ASSERT(current); 353 ASSERT(current);
365 if (current->transform() || current->isPaintInvalidationContainer()) 354 if (current->transform() || current->isPaintInvalidationContainer())
366 return const_cast<RenderLayer*>(current); 355 return const_cast<RenderLayer*>(current);
367 } 356 }
368 357
369 ASSERT_NOT_REACHED(); 358 ASSERT_NOT_REACHED();
370 return 0; 359 return 0;
371 } 360 }
372 361
373 } // namespace blink 362 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBoxModelObject.cpp ('k') | sky/engine/core/rendering/RenderLayerScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698