| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 { | 453 { |
| 454 clearContentsLayerIfUnregistered(); | 454 clearContentsLayerIfUnregistered(); |
| 455 return m_contentsLayer; | 455 return m_contentsLayer; |
| 456 } | 456 } |
| 457 | 457 |
| 458 void GraphicsLayer::resetTrackedPaintInvalidations() | 458 void GraphicsLayer::resetTrackedPaintInvalidations() |
| 459 { | 459 { |
| 460 paintInvalidationTrackingMap().remove(this); | 460 paintInvalidationTrackingMap().remove(this); |
| 461 } | 461 } |
| 462 | 462 |
| 463 bool GraphicsLayer::hasTrackedPaintInvalidations() const |
| 464 { |
| 465 PaintInvalidationTrackingMap::iterator it = paintInvalidationTrackingMap().f
ind(this); |
| 466 if (it != paintInvalidationTrackingMap().end()) |
| 467 return !it->value.invalidationRects.isEmpty(); |
| 468 return false; |
| 469 } |
| 470 |
| 463 void GraphicsLayer::trackPaintInvalidationRect(const FloatRect& rect) | 471 void GraphicsLayer::trackPaintInvalidationRect(const FloatRect& rect) |
| 464 { | 472 { |
| 465 if (rect.isEmpty()) | 473 if (rect.isEmpty()) |
| 466 return; | 474 return; |
| 467 | 475 |
| 468 // The caller must check isTrackingPaintInvalidations() before calling this
method | 476 // The caller must check isTrackingPaintInvalidations() before calling this
method |
| 469 // to avoid constructing the rect unnecessarily. | 477 // to avoid constructing the rect unnecessarily. |
| 470 ASSERT(isTrackingPaintInvalidations()); | 478 ASSERT(isTrackingPaintInvalidations()); |
| 471 | 479 |
| 472 paintInvalidationTrackingMap().add(this, PaintInvalidationTrackingInfo()).st
oredValue->value.invalidationRects.append(rect); | 480 paintInvalidationTrackingMap().add(this, PaintInvalidationTrackingInfo()).st
oredValue->value.invalidationRects.append(rect); |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 { | 1164 { |
| 1157 if (!layer) { | 1165 if (!layer) { |
| 1158 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1166 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
| 1159 return; | 1167 return; |
| 1160 } | 1168 } |
| 1161 | 1169 |
| 1162 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1170 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1163 fprintf(stderr, "%s\n", output.utf8().data()); | 1171 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1164 } | 1172 } |
| 1165 #endif | 1173 #endif |
| OLD | NEW |