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

Side by Side Diff: Source/core/rendering/CompositedLayerMapping.cpp

Issue 134473008: Remove CSS regions support, keeping a bare minimum to support "region-based" multicol. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master Created 6 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
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/core/rendering/FixedTableLayout.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 RenderView* view = m_owningLayer->renderer()->view(); 355 RenderView* view = m_owningLayer->renderer()->view();
356 RenderLayer* rootLayer = view->layer(); 356 RenderLayer* rootLayer = view->layer();
357 357
358 LayoutRect clippingBounds; 358 LayoutRect clippingBounds;
359 if (renderer()->style()->position() == FixedPosition && renderer()->cont ainer() == view) 359 if (renderer()->style()->position() == FixedPosition && renderer()->cont ainer() == view)
360 clippingBounds = view->frameView()->viewportConstrainedVisibleConten tRect(); 360 clippingBounds = view->frameView()->viewportConstrainedVisibleConten tRect();
361 else 361 else
362 clippingBounds = view->unscaledDocumentRect(); 362 clippingBounds = view->unscaledDocumentRect();
363 363
364 if (m_owningLayer != rootLayer) 364 if (m_owningLayer != rootLayer)
365 clippingBounds.intersect(m_owningLayer->clipper().backgroundClipRect (ClipRectsContext(rootLayer, 0, AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions. 365 clippingBounds.intersect(m_owningLayer->clipper().backgroundClipRect (ClipRectsContext(rootLayer, AbsoluteClipRects)).rect());
366 366
367 LayoutPoint delta; 367 LayoutPoint delta;
368 m_owningLayer->convertToLayerCoords(rootLayer, delta); 368 m_owningLayer->convertToLayerCoords(rootLayer, delta);
369 clippingBounds.move(-delta.x(), -delta.y()); 369 clippingBounds.move(-delta.x(), -delta.y());
370 370
371 layerBounds.intersect(clippingBounds); 371 layerBounds.intersect(clippingBounds);
372 } 372 }
373 373
374 // If the element has a transform-origin that has fixed lengths, and the ren derer has zero size, 374 // If the element has a transform-origin that has fixed lengths, and the ren derer has zero size,
375 // then we need to ensure that the compositing layer has non-zero size so th at we can apply 375 // then we need to ensure that the compositing layer has non-zero size so th at we can apply
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 if (renderer->isRenderPart()) 536 if (renderer->isRenderPart())
537 layerConfigChanged = RenderLayerCompositor::parentFrameContentLayers(toR enderPart(renderer)); 537 layerConfigChanged = RenderLayerCompositor::parentFrameContentLayers(toR enderPart(renderer));
538 538
539 return layerConfigChanged; 539 return layerConfigChanged;
540 } 540 }
541 541
542 static IntRect clipBox(RenderBox* renderer) 542 static IntRect clipBox(RenderBox* renderer)
543 { 543 {
544 LayoutRect result = PaintInfo::infiniteRect(); 544 LayoutRect result = PaintInfo::infiniteRect();
545 if (renderer->hasOverflowClip()) 545 if (renderer->hasOverflowClip())
546 result = renderer->overflowClipRect(LayoutPoint(), 0); // FIXME: Incorre ct for CSS regions. 546 result = renderer->overflowClipRect(LayoutPoint());
547 547
548 if (renderer->hasClip()) 548 if (renderer->hasClip())
549 result.intersect(renderer->clipRect(LayoutPoint(), 0)); // FIXME: Incorr ect for CSS regions. 549 result.intersect(renderer->clipRect(LayoutPoint()));
550 550
551 return pixelSnappedIntRect(result); 551 return pixelSnappedIntRect(result);
552 } 552 }
553 553
554 void CompositedLayerMapping::adjustBoundsForSubPixelAccumulation(const RenderLay er* compositedAncestor, IntRect& localBounds, IntRect& relativeBounds, IntPoint& delta) 554 void CompositedLayerMapping::adjustBoundsForSubPixelAccumulation(const RenderLay er* compositedAncestor, IntRect& localBounds, IntRect& relativeBounds, IntPoint& delta)
555 { 555 {
556 LayoutRect localRawCompositingBounds = compositedBounds(); 556 LayoutRect localRawCompositingBounds = compositedBounds();
557 LayoutPoint rawDelta; 557 LayoutPoint rawDelta;
558 m_owningLayer->convertToLayerCoords(compositedAncestor, rawDelta); 558 m_owningLayer->convertToLayerCoords(compositedAncestor, rawDelta);
559 delta = flooredIntPoint(rawDelta); 559 delta = flooredIntPoint(rawDelta);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 RenderBox* renderBox = toRenderBox(compAncestor->renderer()); 681 RenderBox* renderBox = toRenderBox(compAncestor->renderer());
682 IntSize scrollOffset = renderBox->scrolledContentOffset(); 682 IntSize scrollOffset = renderBox->scrolledContentOffset();
683 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop()); 683 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop());
684 graphicsLayerParentLocation = scrollOrigin - scrollOffset; 684 graphicsLayerParentLocation = scrollOrigin - scrollOffset;
685 } 685 }
686 686
687 if (compAncestor && m_ancestorClippingLayer) { 687 if (compAncestor && m_ancestorClippingLayer) {
688 // Call calculateRects to get the backgroundRect which is what is used t o clip the contents of this 688 // Call calculateRects to get the backgroundRect which is what is used t o clip the contents of this
689 // layer. Note that we call it with temporaryClipRects = true because no rmally when computing clip rects 689 // layer. Note that we call it with temporaryClipRects = true because no rmally when computing clip rects
690 // for a compositing layer, rootLayer is the layer itself. 690 // for a compositing layer, rootLayer is the layer itself.
691 ClipRectsContext clipRectsContext(compAncestor, 0, TemporaryClipRects, I gnoreOverlayScrollbarSize, IgnoreOverflowClip); 691 ClipRectsContext clipRectsContext(compAncestor, TemporaryClipRects, Igno reOverlayScrollbarSize, IgnoreOverflowClip);
692 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->clipper().ba ckgroundClipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. 692 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->clipper().ba ckgroundClipRect(clipRectsContext).rect());
693 ASSERT(parentClipRect != PaintInfo::infiniteRect()); 693 ASSERT(parentClipRect != PaintInfo::infiniteRect());
694 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location( ) - graphicsLayerParentLocation)); 694 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location( ) - graphicsLayerParentLocation));
695 m_ancestorClippingLayer->setSize(parentClipRect.size()); 695 m_ancestorClippingLayer->setSize(parentClipRect.size());
696 696
697 // backgroundRect is relative to compAncestor, so subtract deltaX/deltaY to get back to local coords. 697 // backgroundRect is relative to compAncestor, so subtract deltaX/deltaY to get back to local coords.
698 m_ancestorClippingLayer->setOffsetFromRenderer(parentClipRect.location() - delta); 698 m_ancestorClippingLayer->setOffsetFromRenderer(parentClipRect.location() - delta);
699 699
700 // The primary layer is then parented in, and positioned relative to thi s clipping layer. 700 // The primary layer is then parented in, and positioned relative to thi s clipping layer.
701 graphicsLayerParentLocation = parentClipRect.location(); 701 graphicsLayerParentLocation = parentClipRect.location();
702 } 702 }
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
2185 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2185 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2186 name = "Scrolling Contents Layer"; 2186 name = "Scrolling Contents Layer";
2187 } else { 2187 } else {
2188 ASSERT_NOT_REACHED(); 2188 ASSERT_NOT_REACHED();
2189 } 2189 }
2190 2190
2191 return name; 2191 return name;
2192 } 2192 }
2193 2193
2194 } // namespace WebCore 2194 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/core/rendering/FixedTableLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698