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

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

Issue 899753003: Walk render tree instead of render layers for paint. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: address review comments Created 5 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 | « sky/engine/core/rendering/RenderLineBoxList.h ('k') | sky/engine/core/rendering/RenderObject.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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer, InlineFlowBox* box, const PaintInfo& paintInfo, const LayoutPoint& offset) const 179 bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer, InlineFlowBox* box, const PaintInfo& paintInfo, const LayoutPoint& offset) const
180 { 180 {
181 RootInlineBox& root = box->root(); 181 RootInlineBox& root = box->root();
182 LayoutUnit logicalTop = std::min<LayoutUnit>(box->logicalTopVisualOverflow(r oot.lineTop()), root.selectionTop()); 182 LayoutUnit logicalTop = std::min<LayoutUnit>(box->logicalTopVisualOverflow(r oot.lineTop()), root.selectionTop());
183 LayoutUnit logicalBottom = box->logicalBottomVisualOverflow(root.lineBottom( )); 183 LayoutUnit logicalBottom = box->logicalBottomVisualOverflow(root.lineBottom( ));
184 184
185 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.re ct, offset); 185 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.re ct, offset);
186 } 186 }
187 187
188 void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn fo, const LayoutPoint& paintOffset) const 188 void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn fo, const LayoutPoint& paintOffset, Vector<RenderBox*>& layers) const
189 { 189 {
190 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could paint like this is if it has a la yer. 190 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could paint like this is if it has a la yer.
191 191
192 // If we have no lines then we have no work to do. 192 // If we have no lines then we have no work to do.
193 if (!firstLineBox()) 193 if (!firstLineBox())
194 return; 194 return;
195 195
196 if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset)) 196 if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset))
197 return; 197 return;
198 198
199 PaintInfo info(paintInfo); 199 PaintInfo info(paintInfo);
200 200
201 // See if our root lines intersect with the dirty rect. If so, then we pain t 201 // See if our root lines intersect with the dirty rect. If so, then we pain t
202 // them. Note that boxes can easily overlap, so we can't make any assumptio ns 202 // them. Note that boxes can easily overlap, so we can't make any assumptio ns
203 // based off positions of our first line box or our last line box. 203 // based off positions of our first line box or our last line box.
204 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { 204 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
205 if (lineIntersectsDirtyRect(renderer, curr, info, paintOffset)) { 205 if (lineIntersectsDirtyRect(renderer, curr, info, paintOffset)) {
206 RootInlineBox& root = curr->root(); 206 RootInlineBox& root = curr->root();
207 curr->paint(info, paintOffset, root.lineTop(), root.lineBottom()); 207 curr->paint(info, paintOffset, root.lineTop(), root.lineBottom(), la yers);
208 } 208 }
209 } 209 }
210 } 210 }
211 211
212 bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq uest& request, HitTestResult& result, const HitTestLocation& locationInContainer , const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) const 212 bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq uest& request, HitTestResult& result, const HitTestLocation& locationInContainer , const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) const
213 { 213 {
214 if (hitTestAction != HitTestForeground) 214 if (hitTestAction != HitTestForeground)
215 return false; 215 return false;
216 216
217 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could hit test like this is if it has a layer. 217 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could hit test like this is if it has a layer.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 ASSERT(child->prevLineBox() == prev); 341 ASSERT(child->prevLineBox() == prev);
342 prev = child; 342 prev = child;
343 } 343 }
344 ASSERT(prev == m_lastLineBox); 344 ASSERT(prev == m_lastLineBox);
345 #endif 345 #endif
346 } 346 }
347 347
348 #endif 348 #endif
349 349
350 } 350 }
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderLineBoxList.h ('k') | sky/engine/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698