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

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

Issue 178473024: Convert some Shape code to use references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased patch Created 6 years, 9 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 | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('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 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 1393
1394 void RenderBlock::imageChanged(WrappedImagePtr image, const IntRect*) 1394 void RenderBlock::imageChanged(WrappedImagePtr image, const IntRect*)
1395 { 1395 {
1396 RenderBox::imageChanged(image); 1396 RenderBox::imageChanged(image);
1397 1397
1398 if (!parent() || !everHadLayout()) 1398 if (!parent() || !everHadLayout())
1399 return; 1399 return;
1400 1400
1401 ShapeValue* shapeValue = style()->shapeInside(); 1401 ShapeValue* shapeValue = style()->shapeInside();
1402 if (shapeValue && shapeValue->image() && shapeValue->image()->data() == imag e) { 1402 if (shapeValue && shapeValue->image() && shapeValue->image()->data() == imag e) {
1403 ShapeInsideInfo* shapeInsideInfo = ensureShapeInsideInfo(); 1403 ShapeInsideInfo& shapeInsideInfo = ensureShapeInsideInfo();
1404 shapeInsideInfo->markShapeAsDirty(); 1404 shapeInsideInfo.markShapeAsDirty();
1405 markShapeInsideDescendantsForLayout(); 1405 markShapeInsideDescendantsForLayout();
1406 } 1406 }
1407 } 1407 }
1408 1408
1409 void RenderBlock::updateShapeInsideInfoAfterStyleChange(const ShapeValue* shapeI nside, const ShapeValue* oldShapeInside) 1409 void RenderBlock::updateShapeInsideInfoAfterStyleChange(const ShapeValue* shapeI nside, const ShapeValue* oldShapeInside)
1410 { 1410 {
1411 // FIXME: A future optimization would do a deep comparison for equality. 1411 // FIXME: A future optimization would do a deep comparison for equality.
1412 if (shapeInside == oldShapeInside) 1412 if (shapeInside == oldShapeInside)
1413 return; 1413 return;
1414 1414
1415 if (shapeInside) { 1415 if (shapeInside) {
1416 ShapeInsideInfo* shapeInsideInfo = ensureShapeInsideInfo(); 1416 ShapeInsideInfo& shapeInsideInfo = ensureShapeInsideInfo();
1417 shapeInsideInfo->markShapeAsDirty(); 1417 shapeInsideInfo.markShapeAsDirty();
1418 } else { 1418 } else {
1419 setShapeInsideInfo(nullptr); 1419 setShapeInsideInfo(nullptr);
1420 markShapeInsideDescendantsForLayout(); 1420 markShapeInsideDescendantsForLayout();
1421 } 1421 }
1422 } 1422 }
1423 1423
1424 static inline bool shapeInfoRequiresRelayout(const RenderBlock* block) 1424 static inline bool shapeInfoRequiresRelayout(const RenderBlock* block)
1425 { 1425 {
1426 ShapeInsideInfo* info = block->shapeInsideInfo(); 1426 ShapeInsideInfo* info = block->shapeInsideInfo();
1427 if (info) 1427 if (info)
(...skipping 3590 matching lines...) Expand 10 before | Expand all | Expand 10 after
5018 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5018 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5019 { 5019 {
5020 showRenderObject(); 5020 showRenderObject();
5021 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5021 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5022 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5022 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5023 } 5023 }
5024 5024
5025 #endif 5025 #endif
5026 5026
5027 } // namespace WebCore 5027 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698