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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 if (!tracking) | 509 if (!tracking) |
510 return; | 510 return; |
511 | 511 |
512 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) | 512 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) |
513 tracking->trackedRasterInvalidations.clear(); | 513 tracking->trackedRasterInvalidations.clear(); |
514 else | 514 else |
515 rasterInvalidationTrackingMap().remove(this); | 515 rasterInvalidationTrackingMap().remove(this); |
516 } | 516 } |
517 | 517 |
518 bool GraphicsLayer::hasTrackedRasterInvalidations() const { | 518 bool GraphicsLayer::hasTrackedRasterInvalidations() const { |
519 RasterInvalidationTracking* tracking = | 519 if (auto* tracking = getRasterInvalidationTracking()) |
520 rasterInvalidationTrackingMap().find(this); | |
521 if (tracking) | |
522 return !tracking->trackedRasterInvalidations.isEmpty(); | 520 return !tracking->trackedRasterInvalidations.isEmpty(); |
523 return false; | 521 return false; |
524 } | 522 } |
525 | 523 |
| 524 const RasterInvalidationTracking* GraphicsLayer::getRasterInvalidationTracking() |
| 525 const { |
| 526 return rasterInvalidationTrackingMap().find(this); |
| 527 } |
| 528 |
526 void GraphicsLayer::trackRasterInvalidation(const DisplayItemClient& client, | 529 void GraphicsLayer::trackRasterInvalidation(const DisplayItemClient& client, |
527 const IntRect& rect, | 530 const IntRect& rect, |
528 PaintInvalidationReason reason) { | 531 PaintInvalidationReason reason) { |
529 if (!isTrackingOrCheckingRasterInvalidations() || rect.isEmpty()) | 532 if (!isTrackingOrCheckingRasterInvalidations() || rect.isEmpty()) |
530 return; | 533 return; |
531 | 534 |
532 RasterInvalidationTracking& tracking = | 535 RasterInvalidationTracking& tracking = |
533 rasterInvalidationTrackingMap().add(this); | 536 rasterInvalidationTrackingMap().add(this); |
534 | 537 |
535 if (m_isTrackingRasterInvalidations) { | 538 if (m_isTrackingRasterInvalidations) { |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1294 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
1292 if (!layer) { | 1295 if (!layer) { |
1293 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1296 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
1294 return; | 1297 return; |
1295 } | 1298 } |
1296 | 1299 |
1297 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1300 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1298 fprintf(stderr, "%s\n", output.utf8().data()); | 1301 fprintf(stderr, "%s\n", output.utf8().data()); |
1299 } | 1302 } |
1300 #endif | 1303 #endif |
OLD | NEW |