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

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

Issue 358913003: Get rid of one-off code in ScrollingCoordinator to handle graphics layer offsets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix. Created 6 years, 5 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 | Annotate | Revision Log
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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 // confused and think that we can use LayoutState. Ideally, we'd made 611 // confused and think that we can use LayoutState. Ideally, we'd made
612 // LayoutState work for all composited layers as well, but until then 612 // LayoutState work for all composited layers as well, but until then
613 // we need to disable LayoutState for squashed layers. 613 // we need to disable LayoutState for squashed layers.
614 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); 614 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor);
615 615
616 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra nsformedAncestor); 616 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra nsformedAncestor);
617 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi ngOffsetFromTransformedAncestor()); 617 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi ngOffsetFromTransformedAncestor());
618 return point; 618 return point;
619 } 619 }
620 620
621 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect ) 621 void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect)
622 { 622 {
623 if (!paintInvalidationContainer->layer()->groupedMapping()) { 623
624 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain er, rect); 624 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
625 if (!paintInvalidationLayer->groupedMapping()) {
626 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse tInCompositingLayer());
625 return; 627 return;
626 } 628 }
627 629
628 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la yer()->enclosingTransformedAncestor()->renderer(); 630 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos ingTransformedAncestor()->renderer();
629 if (!transformedAncestor) 631 if (!transformedAncestor)
630 return; 632 return;
631 633
632 // If the transformedAncestor is actually the RenderView, we might get 634 // If the transformedAncestor is actually the RenderView, we might get
633 // confused and think that we can use LayoutState. Ideally, we'd made 635 // confused and think that we can use LayoutState. Ideally, we'd made
634 // LayoutState work for all composited layers as well, but until then 636 // LayoutState work for all composited layers as well, but until then
635 // we need to disable LayoutState for squashed layers. 637 // we need to disable LayoutState for squashed layers.
636 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); 638 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor);
637 639
640 // |repaintContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the
641 // transformed ancestor.
642 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect (rect), transformedAncestor).boundingBox());
643
644 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr ansformedAncestor());
645 }
646
647 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect )
648 {
649 if (!paintInvalidationContainer->layer()->groupedMapping()) {
650 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain er, rect);
651 return;
652 }
653
638 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed) 654 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed)
639 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is 655 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is
640 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc. 656 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc.
641 // FIXME: remove this special-case code that works around the repainting cod e structure. 657 // FIXME: remove this special-case code that works around the repainting cod e structure.
642 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect); 658 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect);
643 659
644 // |repaintContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the 660 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re ct);
645 // transformed ancestor.
646 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect (rect), transformedAncestor).boundingBox());
647
648 rect.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashin gOffsetFromTransformedAncestor());
649 } 661 }
650 662
651 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO bject, const RenderLayer* paintInvalidationContainer) 663 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO bject, const RenderLayer* paintInvalidationContainer)
652 { 664 {
653 if (!paintInvalidationContainer->groupedMapping()) 665 if (!paintInvalidationContainer->groupedMapping())
654 return renderObject->computePaintInvalidationRect(paintInvalidationConta iner->renderer()); 666 return renderObject->computePaintInvalidationRect(paintInvalidationConta iner->renderer());
655 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->renderer()); 667 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->renderer());
656 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa intInvalidationContainer->renderer(), rect); 668 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa intInvalidationContainer->renderer(), rect);
657 return rect; 669 return rect;
658 } 670 }
(...skipping 3091 matching lines...) Expand 10 before | Expand all | Expand 10 after
3750 } 3762 }
3751 } 3763 }
3752 3764
3753 void showLayerTree(const WebCore::RenderObject* renderer) 3765 void showLayerTree(const WebCore::RenderObject* renderer)
3754 { 3766 {
3755 if (!renderer) 3767 if (!renderer)
3756 return; 3768 return;
3757 showLayerTree(renderer->enclosingLayer()); 3769 showLayerTree(renderer->enclosingLayer());
3758 } 3770 }
3759 #endif 3771 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698