Chromium Code Reviews| 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 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1497 addJsonObjectForRect(value.get(), "rect", rect); | 1497 addJsonObjectForRect(value.get(), "rect", rect); |
| 1498 value->setString("invalidation_reason", invalidationReason); | 1498 value->setString("invalidation_reason", invalidationReason); |
| 1499 return value; | 1499 return value; |
| 1500 } | 1500 } |
| 1501 | 1501 |
| 1502 LayoutRect RenderObject::computePaintInvalidationRect(const RenderLayerModelObje ct* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationS tate) const | 1502 LayoutRect RenderObject::computePaintInvalidationRect(const RenderLayerModelObje ct* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationS tate) const |
| 1503 { | 1503 { |
| 1504 return clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, p aintInvalidationState); | 1504 return clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, p aintInvalidationState); |
| 1505 } | 1505 } |
| 1506 | 1506 |
| 1507 void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* p aintInvalidationContainer, const LayoutRect& r, InvalidationReason invalidationR eason) const | 1507 void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* p aintInvalidationContainer, const LayoutRect& r, InvalidationReason invalidationR eason) |
| 1508 { | 1508 { |
| 1509 if (r.isEmpty()) | 1509 if (r.isEmpty()) |
| 1510 return; | 1510 return; |
| 1511 | 1511 |
| 1512 // FIXME: This should be an assert, but editing/selection can trigger this c ase to invalidate | 1512 // FIXME: This should be an assert, but editing/selection can trigger this c ase to invalidate |
| 1513 // the selection. crbug.com/368140. | 1513 // the selection. crbug.com/368140. |
| 1514 if (!isRooted()) | 1514 if (!isRooted()) |
| 1515 return; | 1515 return; |
| 1516 | 1516 |
| 1517 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject: :invalidatePaintUsingContainer()", | 1517 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject: :invalidatePaintUsingContainer()", |
| 1518 "object", this->debugName().ascii(), | 1518 "object", this->debugName().ascii(), |
| 1519 "info", jsonObjectForPaintInvalidationInfo(r, invalidationReasonToString (invalidationReason))); | 1519 "info", jsonObjectForPaintInvalidationInfo(r, invalidationReasonToString (invalidationReason))); |
| 1520 | 1520 |
| 1521 if (view()->usesCompositing() && !hadPaintInvalidation()) | |
|
chrishtr
2014/08/25 16:55:05
Let's put this inside of RenderLayerRepainter::set
kouhei (in TOK)
2014/08/26 14:18:18
Done.
| |
| 1522 paintInvalidationContainer->layer()->paintInvalidator().setBackingInclud esFirstPaintInvalidation(); | |
| 1523 setHadPaintInvalidation(true); | |
| 1524 | |
| 1521 // For querying RenderLayer::compositingState() | 1525 // For querying RenderLayer::compositingState() |
| 1522 DisableCompositingQueryAsserts disabler; | 1526 DisableCompositingQueryAsserts disabler; |
| 1523 | 1527 |
| 1524 if (paintInvalidationContainer->isRenderFlowThread()) { | 1528 if (paintInvalidationContainer->isRenderFlowThread()) { |
| 1525 toRenderFlowThread(paintInvalidationContainer)->paintInvalidationRectang leInRegions(r); | 1529 toRenderFlowThread(paintInvalidationContainer)->paintInvalidationRectang leInRegions(r); |
| 1526 return; | 1530 return; |
| 1527 } | 1531 } |
| 1528 | 1532 |
| 1529 if (paintInvalidationContainer->hasFilter() && paintInvalidationContainer->l ayer()->requiresFullLayerImageForFilters()) { | 1533 if (paintInvalidationContainer->hasFilter() && paintInvalidationContainer->l ayer()->requiresFullLayerImageForFilters()) { |
| 1530 paintInvalidationContainer->layer()->paintInvalidator().setFilterBackend NeedsPaintInvalidationInRect(r); | 1534 paintInvalidationContainer->layer()->paintInvalidator().setFilterBackend NeedsPaintInvalidationInRect(r); |
| 1531 return; | 1535 return; |
| 1532 } | 1536 } |
| 1533 | 1537 |
| 1534 if (paintInvalidationContainer->isRenderView()) { | 1538 if (paintInvalidationContainer->isRenderView()) { |
| 1535 toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r) ; | 1539 toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r) ; |
| 1536 return; | 1540 return; |
| 1537 } | 1541 } |
| 1538 if (paintInvalidationContainer->view()->usesCompositing()) { | 1542 if (paintInvalidationContainer->view()->usesCompositing()) { |
| 1539 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo ntainer->layer()->compositingState() == PaintsIntoGroupedBacking)); | 1543 ASSERT(paintInvalidationContainer->hasLayer() && (paintInvalidationConta iner->layer()->compositingState() == PaintsIntoOwnBacking || paintInvalidationCo ntainer->layer()->compositingState() == PaintsIntoGroupedBacking)); |
| 1540 paintInvalidationContainer->layer()->paintInvalidator().setBackingNeedsP aintInvalidationInRect(r); | 1544 paintInvalidationContainer->layer()->paintInvalidator().setBackingNeedsP aintInvalidationInRect(r); |
| 1541 } | 1545 } |
| 1542 } | 1546 } |
| 1543 | 1547 |
| 1544 void RenderObject::invalidatePaintForWholeRenderer() const | 1548 void RenderObject::invalidatePaintForWholeRenderer() |
| 1545 { | 1549 { |
| 1546 if (!isRooted()) | 1550 if (!isRooted()) |
| 1547 return; | 1551 return; |
| 1548 | 1552 |
| 1549 if (view()->document().printing()) | 1553 if (view()->document().printing()) |
| 1550 return; // Don't invalidate paints if we're printing. | 1554 return; // Don't invalidate paints if we're printing. |
| 1551 | 1555 |
| 1552 // FIXME: really, we're in the paint invalidation phase here, and the follow ing queries are legal. | 1556 // FIXME: really, we're in the paint invalidation phase here, and the follow ing queries are legal. |
| 1553 // Until those states are fully fledged, I'll just disable the ASSERTS. | 1557 // Until those states are fully fledged, I'll just disable the ASSERTS. |
| 1554 DisableCompositingQueryAsserts disabler; | 1558 DisableCompositingQueryAsserts disabler; |
| 1555 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation(); | 1559 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation(); |
| 1556 | 1560 |
| 1557 // FIXME: We should invalidate only previousPaintInvalidationRect, but for n ow we invalidate both the previous | 1561 // FIXME: We should invalidate only previousPaintInvalidationRect, but for n ow we invalidate both the previous |
| 1558 // and current paint rects to meet the expectations of some callers in some cases (crbug.com/397555): | 1562 // and current paint rects to meet the expectations of some callers in some cases (crbug.com/397555): |
| 1559 // - transform style change without a layout - crbug.com/394004; | 1563 // - transform style change without a layout - crbug.com/394004; |
| 1560 // - some objects don't save previousPaintInvalidationRect - crbug.com/39413 3. | 1564 // - some objects don't save previousPaintInvalidationRect - crbug.com/39413 3. |
| 1561 LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(paintInval idationContainer); | 1565 LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(paintInval idationContainer); |
| 1562 invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationR ect, InvalidationPaint); | 1566 invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationR ect, InvalidationPaint); |
| 1563 if (paintInvalidationRect != previousPaintInvalidationRect()) | 1567 if (paintInvalidationRect != previousPaintInvalidationRect()) |
| 1564 invalidatePaintUsingContainer(paintInvalidationContainer, previousPaintI nvalidationRect(), InvalidationPaint); | 1568 invalidatePaintUsingContainer(paintInvalidationContainer, previousPaintI nvalidationRect(), InvalidationPaint); |
| 1565 } | 1569 } |
| 1566 | 1570 |
| 1567 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb ject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidatio nState) const | 1571 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb ject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidatio nState) const |
| 1568 { | 1572 { |
| 1569 if (!paintInvalidationContainer) | 1573 if (!paintInvalidationContainer) |
| 1570 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState); | 1574 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState); |
| 1571 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont ainer->layer(), paintInvalidationState); | 1575 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont ainer->layer(), paintInvalidationState); |
| 1572 } | 1576 } |
| 1573 | 1577 |
| 1574 void RenderObject::invalidatePaintRectangle(const LayoutRect& r) const | 1578 void RenderObject::invalidatePaintRectangle(const LayoutRect& r) |
| 1575 { | 1579 { |
| 1576 if (!isRooted()) | 1580 if (!isRooted()) |
| 1577 return; | 1581 return; |
| 1578 | 1582 |
| 1579 if (view()->document().printing()) | 1583 if (view()->document().printing()) |
| 1580 return; // Don't invalidate paints if we're printing. | 1584 return; // Don't invalidate paints if we're printing. |
| 1581 | 1585 |
| 1582 LayoutRect dirtyRect(r); | 1586 LayoutRect dirtyRect(r); |
| 1583 | 1587 |
| 1584 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation(); | 1588 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation(); |
| (...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3481 { | 3485 { |
| 3482 if (object1) { | 3486 if (object1) { |
| 3483 const blink::RenderObject* root = object1; | 3487 const blink::RenderObject* root = object1; |
| 3484 while (root->parent()) | 3488 while (root->parent()) |
| 3485 root = root->parent(); | 3489 root = root->parent(); |
| 3486 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3490 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3487 } | 3491 } |
| 3488 } | 3492 } |
| 3489 | 3493 |
| 3490 #endif | 3494 #endif |
| OLD | NEW |