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

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: 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
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 if (renderer->isRenderPart()) 528 if (renderer->isRenderPart())
529 layerConfigChanged = RenderLayerCompositor::parentFrameContentLayers(toR enderPart(renderer)); 529 layerConfigChanged = RenderLayerCompositor::parentFrameContentLayers(toR enderPart(renderer));
530 530
531 return layerConfigChanged; 531 return layerConfigChanged;
532 } 532 }
533 533
534 static IntRect clipBox(RenderBox* renderer) 534 static IntRect clipBox(RenderBox* renderer)
535 { 535 {
536 LayoutRect result = PaintInfo::infiniteRect(); 536 LayoutRect result = PaintInfo::infiniteRect();
537 if (renderer->hasOverflowClip()) 537 if (renderer->hasOverflowClip())
538 result = renderer->overflowClipRect(LayoutPoint(), 0); // FIXME: Incorre ct for CSS regions. 538 result = renderer->overflowClipRect(LayoutPoint());
539 539
540 if (renderer->hasClip()) 540 if (renderer->hasClip())
541 result.intersect(renderer->clipRect(LayoutPoint(), 0)); // FIXME: Incorr ect for CSS regions. 541 result.intersect(renderer->clipRect(LayoutPoint()));
542 542
543 return pixelSnappedIntRect(result); 543 return pixelSnappedIntRect(result);
544 } 544 }
545 545
546 void CompositedLayerMapping::adjustBoundsForSubPixelAccumulation(const RenderLay er* compositedAncestor, IntRect& localBounds, IntRect& relativeBounds, IntPoint& delta) 546 void CompositedLayerMapping::adjustBoundsForSubPixelAccumulation(const RenderLay er* compositedAncestor, IntRect& localBounds, IntRect& relativeBounds, IntPoint& delta)
547 { 547 {
548 LayoutRect localRawCompositingBounds = compositedBounds(); 548 LayoutRect localRawCompositingBounds = compositedBounds();
549 LayoutPoint rawDelta; 549 LayoutPoint rawDelta;
550 m_owningLayer->convertToLayerCoords(compositedAncestor, rawDelta); 550 m_owningLayer->convertToLayerCoords(compositedAncestor, rawDelta);
551 delta = flooredIntPoint(rawDelta); 551 delta = flooredIntPoint(rawDelta);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 RenderBox* renderBox = toRenderBox(compAncestor->renderer()); 673 RenderBox* renderBox = toRenderBox(compAncestor->renderer());
674 IntSize scrollOffset = renderBox->scrolledContentOffset(); 674 IntSize scrollOffset = renderBox->scrolledContentOffset();
675 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop()); 675 IntPoint scrollOrigin(renderBox->borderLeft(), renderBox->borderTop());
676 graphicsLayerParentLocation = scrollOrigin - scrollOffset; 676 graphicsLayerParentLocation = scrollOrigin - scrollOffset;
677 } 677 }
678 678
679 if (compAncestor && m_ancestorClippingLayer) { 679 if (compAncestor && m_ancestorClippingLayer) {
680 // Call calculateRects to get the backgroundRect which is what is used t o clip the contents of this 680 // Call calculateRects to get the backgroundRect which is what is used t o clip the contents of this
681 // layer. Note that we call it with temporaryClipRects = true because no rmally when computing clip rects 681 // layer. Note that we call it with temporaryClipRects = true because no rmally when computing clip rects
682 // for a compositing layer, rootLayer is the layer itself. 682 // for a compositing layer, rootLayer is the layer itself.
683 ClipRectsContext clipRectsContext(compAncestor, 0, TemporaryClipRects, I gnoreOverlayScrollbarSize, IgnoreOverflowClip); 683 ClipRectsContext clipRectsContext(compAncestor, TemporaryClipRects, Igno reOverlayScrollbarSize, IgnoreOverflowClip);
684 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->clipper().ba ckgroundClipRect(clipRectsContext).rect()); // FIXME: Incorrect for CSS regions. 684 IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer->clipper().ba ckgroundClipRect(clipRectsContext).rect());
685 ASSERT(parentClipRect != PaintInfo::infiniteRect()); 685 ASSERT(parentClipRect != PaintInfo::infiniteRect());
686 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location( ) - graphicsLayerParentLocation)); 686 m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location( ) - graphicsLayerParentLocation));
687 m_ancestorClippingLayer->setSize(parentClipRect.size()); 687 m_ancestorClippingLayer->setSize(parentClipRect.size());
688 688
689 // backgroundRect is relative to compAncestor, so subtract deltaX/deltaY to get back to local coords. 689 // backgroundRect is relative to compAncestor, so subtract deltaX/deltaY to get back to local coords.
690 m_ancestorClippingLayer->setOffsetFromRenderer(parentClipRect.location() - delta); 690 m_ancestorClippingLayer->setOffsetFromRenderer(parentClipRect.location() - delta);
691 691
692 // The primary layer is then parented in, and positioned relative to thi s clipping layer. 692 // The primary layer is then parented in, and positioned relative to thi s clipping layer.
693 graphicsLayerParentLocation = parentClipRect.location(); 693 graphicsLayerParentLocation = parentClipRect.location();
694 } 694 }
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2148 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2149 name = "Scrolling Contents Layer"; 2149 name = "Scrolling Contents Layer";
2150 } else { 2150 } else {
2151 ASSERT_NOT_REACHED(); 2151 ASSERT_NOT_REACHED();
2152 } 2152 }
2153 2153
2154 return name; 2154 return name;
2155 } 2155 }
2156 2156
2157 } // namespace WebCore 2157 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698