| OLD | NEW |
| 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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 #ifndef NDEBUG | 92 #ifndef NDEBUG |
| 93 #include <stdio.h> | 93 #include <stdio.h> |
| 94 #endif | 94 #endif |
| 95 | 95 |
| 96 namespace blink { | 96 namespace blink { |
| 97 | 97 |
| 98 namespace { | 98 namespace { |
| 99 | 99 |
| 100 static bool gModifyRenderTreeStructureAnyState = false; | 100 static bool gModifyRenderTreeStructureAnyState = false; |
| 101 | 101 |
| 102 bool firstPaintInvalidationTrackingEnabled() |
| 103 { |
| 104 bool isEnabled; |
| 105 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.invalida
tion"), &isEnabled); |
| 106 return isEnabled; |
| 107 } |
| 108 |
| 109 typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<const RenderObject> > RenderObj
ectWeakSet; |
| 110 RenderObjectWeakSet& renderObjectNeverHadPaintInvalidationSet() |
| 111 { |
| 112 DEFINE_STATIC_LOCAL(RenderObjectWeakSet, set, ()); |
| 113 return set; |
| 114 } |
| 115 |
| 102 } // namespace | 116 } // namespace |
| 103 | 117 |
| 104 using namespace HTMLNames; | 118 using namespace HTMLNames; |
| 105 | 119 |
| 106 #if ENABLE(ASSERT) | 120 #if ENABLE(ASSERT) |
| 107 | 121 |
| 108 RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope(Rende
rObject& renderObject) | 122 RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope(Rende
rObject& renderObject) |
| 109 : m_renderObject(renderObject) | 123 : m_renderObject(renderObject) |
| 110 , m_preexistingForbidden(m_renderObject.isSetNeedsLayoutForbidden()) | 124 , m_preexistingForbidden(m_renderObject.isSetNeedsLayoutForbidden()) |
| 111 { | 125 { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 , m_next(nullptr) | 240 , m_next(nullptr) |
| 227 #if ENABLE(ASSERT) | 241 #if ENABLE(ASSERT) |
| 228 , m_hasAXObject(false) | 242 , m_hasAXObject(false) |
| 229 , m_setNeedsLayoutForbidden(false) | 243 , m_setNeedsLayoutForbidden(false) |
| 230 #if ENABLE(OILPAN) | 244 #if ENABLE(OILPAN) |
| 231 , m_didCallDestroy(false) | 245 , m_didCallDestroy(false) |
| 232 #endif | 246 #endif |
| 233 #endif | 247 #endif |
| 234 , m_bitfields(node) | 248 , m_bitfields(node) |
| 235 { | 249 { |
| 250 if (firstPaintInvalidationTrackingEnabled()) |
| 251 renderObjectNeverHadPaintInvalidationSet().add(this); |
| 252 |
| 236 #ifndef NDEBUG | 253 #ifndef NDEBUG |
| 237 renderObjectCounter.increment(); | 254 renderObjectCounter.increment(); |
| 238 #endif | 255 #endif |
| 239 ++s_instanceCount; | 256 ++s_instanceCount; |
| 240 } | 257 } |
| 241 | 258 |
| 242 RenderObject::~RenderObject() | 259 RenderObject::~RenderObject() |
| 243 { | 260 { |
| 261 if (firstPaintInvalidationTrackingEnabled()) |
| 262 renderObjectNeverHadPaintInvalidationSet().remove(this); |
| 263 |
| 244 ASSERT(!m_hasAXObject); | 264 ASSERT(!m_hasAXObject); |
| 245 #if ENABLE(OILPAN) | 265 #if ENABLE(OILPAN) |
| 246 ASSERT(m_didCallDestroy); | 266 ASSERT(m_didCallDestroy); |
| 247 #endif | 267 #endif |
| 248 #ifndef NDEBUG | 268 #ifndef NDEBUG |
| 249 renderObjectCounter.decrement(); | 269 renderObjectCounter.decrement(); |
| 250 #endif | 270 #endif |
| 251 --s_instanceCount; | 271 --s_instanceCount; |
| 252 } | 272 } |
| 253 | 273 |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1405 topLevelRect = result; | 1425 topLevelRect = result; |
| 1406 for (RenderObject* current = slowFirstChild(); current; current = current->n
extSibling()) | 1426 for (RenderObject* current = slowFirstChild(); current; current = current->n
extSibling()) |
| 1407 current->addAbsoluteRectForLayer(result); | 1427 current->addAbsoluteRectForLayer(result); |
| 1408 return result; | 1428 return result; |
| 1409 } | 1429 } |
| 1410 | 1430 |
| 1411 void RenderObject::paint(PaintInfo&, const LayoutPoint&) | 1431 void RenderObject::paint(PaintInfo&, const LayoutPoint&) |
| 1412 { | 1432 { |
| 1413 } | 1433 } |
| 1414 | 1434 |
| 1435 void RenderObject::setHadPaintInvalidation() |
| 1436 { |
| 1437 if (firstPaintInvalidationTrackingEnabled()) |
| 1438 renderObjectNeverHadPaintInvalidationSet().remove(this); |
| 1439 } |
| 1440 |
| 1441 bool RenderObject::hadPaintInvalidation() const |
| 1442 { |
| 1443 if (firstPaintInvalidationTrackingEnabled()) |
| 1444 return true; |
| 1445 |
| 1446 return !renderObjectNeverHadPaintInvalidationSet().contains(this); |
| 1447 } |
| 1448 |
| 1415 const RenderLayerModelObject* RenderObject::containerForPaintInvalidation() cons
t | 1449 const RenderLayerModelObject* RenderObject::containerForPaintInvalidation() cons
t |
| 1416 { | 1450 { |
| 1417 if (!isRooted()) | 1451 if (!isRooted()) |
| 1418 return 0; | 1452 return 0; |
| 1419 | 1453 |
| 1420 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta
iner()); | 1454 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta
iner()); |
| 1421 } | 1455 } |
| 1422 | 1456 |
| 1423 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const | 1457 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const |
| 1424 { | 1458 { |
| (...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3454 { | 3488 { |
| 3455 if (object1) { | 3489 if (object1) { |
| 3456 const blink::RenderObject* root = object1; | 3490 const blink::RenderObject* root = object1; |
| 3457 while (root->parent()) | 3491 while (root->parent()) |
| 3458 root = root->parent(); | 3492 root = root->parent(); |
| 3459 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3493 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3460 } | 3494 } |
| 3461 } | 3495 } |
| 3462 | 3496 |
| 3463 #endif | 3497 #endif |
| OLD | NEW |