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 | |
471 void GraphicsLayer::trackPaintInvalidationRect(const FloatRect& rect) | 463 void GraphicsLayer::trackPaintInvalidationRect(const FloatRect& rect) |
472 { | 464 { |
473 if (rect.isEmpty()) | 465 if (rect.isEmpty()) |
474 return; | 466 return; |
475 | 467 |
476 // The caller must check isTrackingPaintInvalidations() before calling this
method | 468 // The caller must check isTrackingPaintInvalidations() before calling this
method |
477 // to avoid constructing the rect unnecessarily. | 469 // to avoid constructing the rect unnecessarily. |
478 ASSERT(isTrackingPaintInvalidations()); | 470 ASSERT(isTrackingPaintInvalidations()); |
479 | 471 |
480 paintInvalidationTrackingMap().add(this, PaintInvalidationTrackingInfo()).st
oredValue->value.invalidationRects.append(rect); | 472 paintInvalidationTrackingMap().add(this, PaintInvalidationTrackingInfo()).st
oredValue->value.invalidationRects.append(rect); |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 { | 1156 { |
1165 if (!layer) { | 1157 if (!layer) { |
1166 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1158 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
1167 return; | 1159 return; |
1168 } | 1160 } |
1169 | 1161 |
1170 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1162 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1171 fprintf(stderr, "%s\n", output.utf8().data()); | 1163 fprintf(stderr, "%s\n", output.utf8().data()); |
1172 } | 1164 } |
1173 #endif | 1165 #endif |
OLD | NEW |