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

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

Issue 867653005: Remove outline painting on inlines. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/RenderLayer.cpp ('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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) const
189 { 189 {
190 // Only paint during the foreground/selection phases. 190 if (paintInfo.phase != PaintPhaseForeground
191 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection && paintInfo.phase != PaintPhaseOutline 191 && paintInfo.phase != PaintPhaseSelection
192 && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintP haseChildOutlines
193 && paintInfo.phase != PaintPhaseMask) 192 && paintInfo.phase != PaintPhaseMask)
194 return; 193 return;
195 194
196 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could paint like this is if it has a la yer. 195 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could paint like this is if it has a la yer.
197 196
198 // If we have no lines then we have no work to do. 197 // If we have no lines then we have no work to do.
199 if (!firstLineBox()) 198 if (!firstLineBox())
200 return; 199 return;
201 200
202 if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset)) 201 if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset))
203 return; 202 return;
204 203
205 PaintInfo info(paintInfo); 204 PaintInfo info(paintInfo);
206 ListHashSet<RenderInline*> outlineObjects;
207 info.setOutlineObjects(&outlineObjects);
208 205
209 // See if our root lines intersect with the dirty rect. If so, then we pain t 206 // See if our root lines intersect with the dirty rect. If so, then we pain t
210 // them. Note that boxes can easily overlap, so we can't make any assumptio ns 207 // them. Note that boxes can easily overlap, so we can't make any assumptio ns
211 // based off positions of our first line box or our last line box. 208 // based off positions of our first line box or our last line box.
212 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { 209 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
213 if (lineIntersectsDirtyRect(renderer, curr, info, paintOffset)) { 210 if (lineIntersectsDirtyRect(renderer, curr, info, paintOffset)) {
214 RootInlineBox& root = curr->root(); 211 RootInlineBox& root = curr->root();
215 curr->paint(info, paintOffset, root.lineTop(), root.lineBottom()); 212 curr->paint(info, paintOffset, root.lineTop(), root.lineBottom());
216 } 213 }
217 } 214 }
218
219 if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline | | info.phase == PaintPhaseChildOutlines) {
ojan 2015/01/27 02:14:52 This is the part of the patch that actually change
220 ListHashSet<RenderInline*>::iterator end = info.outlineObjects()->end();
221 for (ListHashSet<RenderInline*>::iterator it = info.outlineObjects()->be gin(); it != end; ++it) {
222 RenderInline* flow = *it;
223 flow->paintOutline(info, paintOffset);
224 }
225 info.outlineObjects()->clear();
226 }
227 } 215 }
228 216
229 bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq uest& request, HitTestResult& result, const HitTestLocation& locationInContainer , const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) const 217 bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestReq uest& request, HitTestResult& result, const HitTestLocation& locationInContainer , const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) const
230 { 218 {
231 if (hitTestAction != HitTestForeground) 219 if (hitTestAction != HitTestForeground)
232 return false; 220 return false;
233 221
234 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could hit test like this is if it has a layer. 222 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer- >hasLayer())); // The only way an inline could hit test like this is if it has a layer.
235 223
236 // If we have no lines then we have no work to do. 224 // If we have no lines then we have no work to do.
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 ASSERT(child->prevLineBox() == prev); 346 ASSERT(child->prevLineBox() == prev);
359 prev = child; 347 prev = child;
360 } 348 }
361 ASSERT(prev == m_lastLineBox); 349 ASSERT(prev == m_lastLineBox);
362 #endif 350 #endif
363 } 351 }
364 352
365 #endif 353 #endif
366 354
367 } 355 }
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderLayer.cpp ('k') | sky/engine/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698