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

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

Issue 301843002: Store repaint rects in the coordinate space of their backing GraphicsLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Changed name. Created 6 years, 6 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
« no previous file with comments | « Source/core/rendering/RenderInline.h ('k') | Source/core/rendering/RenderLayer.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 1020
1021 if (hitRepaintContainer || !cb) 1021 if (hitRepaintContainer || !cb)
1022 return repaintRect; 1022 return repaintRect;
1023 1023
1024 if (cb->hasColumns()) 1024 if (cb->hasColumns())
1025 cb->adjustRectForColumns(repaintRect); 1025 cb->adjustRectForColumns(repaintRect);
1026 1026
1027 if (cb->hasOverflowClip()) 1027 if (cb->hasOverflowClip())
1028 cb->applyCachedClipAndScrollOffsetForRepaint(repaintRect); 1028 cb->applyCachedClipAndScrollOffsetForRepaint(repaintRect);
1029 1029
1030 cb->computeRectForRepaint(repaintContainer, repaintRect); 1030 cb->mapRectToRepaintBacking(repaintContainer, repaintRect);
1031 1031
1032 if (outlineSize) { 1032 if (outlineSize) {
1033 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling() ) { 1033 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling() ) {
1034 if (!curr->isText()) 1034 if (!curr->isText())
1035 repaintRect.unite(curr->rectWithOutlineForRepaint(repaintContain er, outlineSize)); 1035 repaintRect.unite(curr->rectWithOutlineForRepaint(repaintContain er, outlineSize));
1036 } 1036 }
1037 1037
1038 if (continuation() && !continuation()->isInline() && continuation()->par ent()) 1038 if (continuation() && !continuation()->isInline() && continuation()->par ent())
1039 repaintRect.unite(continuation()->rectWithOutlineForRepaint(repaintC ontainer, outlineSize)); 1039 repaintRect.unite(continuation()->rectWithOutlineForRepaint(repaintC ontainer, outlineSize));
1040 } 1040 }
1041 1041
1042 return repaintRect; 1042 return repaintRect;
1043 } 1043 }
1044 1044
1045 LayoutRect RenderInline::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const 1045 LayoutRect RenderInline::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const
1046 { 1046 {
1047 LayoutRect r(RenderBoxModelObject::rectWithOutlineForRepaint(repaintContaine r, outlineWidth)); 1047 LayoutRect r(RenderBoxModelObject::rectWithOutlineForRepaint(repaintContaine r, outlineWidth));
1048 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { 1048 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
1049 if (!curr->isText()) 1049 if (!curr->isText())
1050 r.unite(curr->rectWithOutlineForRepaint(repaintContainer, outlineWid th)); 1050 r.unite(curr->rectWithOutlineForRepaint(repaintContainer, outlineWid th));
1051 } 1051 }
1052 return r; 1052 return r;
1053 } 1053 }
1054 1054
1055 void RenderInline::computeRectForRepaint(const RenderLayerModelObject* repaintCo ntainer, LayoutRect& rect, bool fixed) const 1055 void RenderInline::mapRectToRepaintBacking(const RenderLayerModelObject* repaint Container, LayoutRect& rect, bool fixed) const
1056 { 1056 {
1057 if (RenderView* v = view()) { 1057 if (RenderView* v = view()) {
1058 // LayoutState is only valid for root-relative repainting 1058 // LayoutState is only valid for root-relative repainting
1059 if (v->canUseLayoutStateForContainer(repaintContainer)) { 1059 if (v->canUseLayoutStateForContainer(repaintContainer)) {
1060 LayoutState* layoutState = v->layoutState(); 1060 LayoutState* layoutState = v->layoutState();
1061 if (style()->hasInFlowPosition() && layer()) 1061 if (style()->hasInFlowPosition() && layer())
1062 rect.move(layer()->offsetForInFlowPosition()); 1062 rect.move(layer()->offsetForInFlowPosition());
1063 rect.move(layoutState->paintOffset()); 1063 rect.move(layoutState->paintOffset());
1064 if (layoutState->isClipped()) 1064 if (layoutState->isClipped())
1065 rect.intersect(layoutState->clipRect()); 1065 rect.intersect(layoutState->clipRect());
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 return; 1105 return;
1106 } 1106 }
1107 1107
1108 if (containerSkipped) { 1108 if (containerSkipped) {
1109 // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates. 1109 // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates.
1110 LayoutSize containerOffset = repaintContainer->offsetFromAncestorContain er(o); 1110 LayoutSize containerOffset = repaintContainer->offsetFromAncestorContain er(o);
1111 rect.move(-containerOffset); 1111 rect.move(-containerOffset);
1112 return; 1112 return;
1113 } 1113 }
1114 1114
1115 o->computeRectForRepaint(repaintContainer, rect, fixed); 1115 o->mapRectToRepaintBacking(repaintContainer, rect, fixed);
1116 } 1116 }
1117 1117
1118 LayoutSize RenderInline::offsetFromContainer(const RenderObject* container, cons t LayoutPoint& point, bool* offsetDependsOnPoint) const 1118 LayoutSize RenderInline::offsetFromContainer(const RenderObject* container, cons t LayoutPoint& point, bool* offsetDependsOnPoint) const
1119 { 1119 {
1120 ASSERT(container == this->container()); 1120 ASSERT(container == this->container());
1121 1121
1122 LayoutSize offset; 1122 LayoutSize offset;
1123 if (isInFlowPositioned()) 1123 if (isInFlowPositioned())
1124 offset += offsetForInFlowPosition(); 1124 offset += offsetForInFlowPosition();
1125 1125
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 container = this; 1576 container = this;
1577 1577
1578 FloatPoint absPos = container->localToAbsolute(); 1578 FloatPoint absPos = container->localToAbsolute();
1579 region.bounds.setX(absPos.x() + region.bounds.x()); 1579 region.bounds.setX(absPos.x() + region.bounds.x());
1580 region.bounds.setY(absPos.y() + region.bounds.y()); 1580 region.bounds.setY(absPos.y() + region.bounds.y());
1581 1581
1582 regions.append(region); 1582 regions.append(region);
1583 } 1583 }
1584 1584
1585 } // namespace WebCore 1585 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderInline.h ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698