| 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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 return static_cast<double>(4 * size().width()) * size().height(); | 713 return static_cast<double>(4 * size().width()) * size().height(); |
| 714 } | 714 } |
| 715 | 715 |
| 716 void GraphicsLayer::resetTrackedRepaints() | 716 void GraphicsLayer::resetTrackedRepaints() |
| 717 { | 717 { |
| 718 repaintRectMap().remove(this); | 718 repaintRectMap().remove(this); |
| 719 } | 719 } |
| 720 | 720 |
| 721 void GraphicsLayer::addRepaintRect(const FloatRect& repaintRect) | 721 void GraphicsLayer::addRepaintRect(const FloatRect& repaintRect) |
| 722 { | 722 { |
| 723 if (m_client->isTrackingRepaints()) { | 723 if (m_client && m_client->isTrackingRepaints()) { |
| 724 FloatRect largestRepaintRect(FloatPoint(), m_size); | 724 FloatRect largestRepaintRect(FloatPoint(), m_size); |
| 725 largestRepaintRect.intersect(repaintRect); | 725 largestRepaintRect.intersect(repaintRect); |
| 726 RepaintMap::iterator repaintIt = repaintRectMap().find(this); | 726 RepaintMap::iterator repaintIt = repaintRectMap().find(this); |
| 727 if (repaintIt == repaintRectMap().end()) { | 727 if (repaintIt == repaintRectMap().end()) { |
| 728 Vector<FloatRect> repaintRects; | 728 Vector<FloatRect> repaintRects; |
| 729 repaintRects.append(largestRepaintRect); | 729 repaintRects.append(largestRepaintRect); |
| 730 repaintRectMap().set(this, repaintRects); | 730 repaintRectMap().set(this, repaintRects); |
| 731 } else { | 731 } else { |
| 732 Vector<FloatRect>& repaintRects = repaintIt->value; | 732 Vector<FloatRect>& repaintRects = repaintIt->value; |
| 733 repaintRects.append(largestRepaintRect); | 733 repaintRects.append(largestRepaintRect); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 } | 929 } |
| 930 | 930 |
| 931 void GraphicsLayer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | 931 void GraphicsLayer::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const |
| 932 { | 932 { |
| 933 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Layers); | 933 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Layers); |
| 934 info.addMember(m_children, "children"); | 934 info.addMember(m_children, "children"); |
| 935 info.addMember(m_parent, "parent"); | 935 info.addMember(m_parent, "parent"); |
| 936 info.addMember(m_maskLayer, "maskLayer"); | 936 info.addMember(m_maskLayer, "maskLayer"); |
| 937 info.addMember(m_replicaLayer, "replicaLayer"); | 937 info.addMember(m_replicaLayer, "replicaLayer"); |
| 938 info.addMember(m_replicatedLayer, "replicatedLayer"); | 938 info.addMember(m_replicatedLayer, "replicatedLayer"); |
| 939 info.ignoreMember(m_client); | 939 if (m_client) |
| 940 info.ignoreMember(m_client); |
| 940 info.addMember(m_name, "name"); | 941 info.addMember(m_name, "name"); |
| 941 info.addMember(m_nameBase, "nameBase"); | 942 info.addMember(m_nameBase, "nameBase"); |
| 942 info.addMember(m_layer, "layer"); | 943 info.addMember(m_layer, "layer"); |
| 943 info.addMember(m_imageLayer, "imageLayer"); | 944 info.addMember(m_imageLayer, "imageLayer"); |
| 944 info.addMember(m_contentsLayer, "contentsLayer"); | 945 info.addMember(m_contentsLayer, "contentsLayer"); |
| 945 info.addMember(m_linkHighlight, "linkHighlight"); | 946 info.addMember(m_linkHighlight, "linkHighlight"); |
| 946 info.addMember(m_opaqueRectTrackingContentLayerDelegate, "opaqueRectTracking
ContentLayerDelegate"); | 947 info.addMember(m_opaqueRectTrackingContentLayerDelegate, "opaqueRectTracking
ContentLayerDelegate"); |
| 947 info.addMember(m_animationIdMap, "animationIdMap"); | 948 info.addMember(m_animationIdMap, "animationIdMap"); |
| 948 info.addMember(m_scrollableArea, "scrollableArea"); | 949 info.addMember(m_scrollableArea, "scrollableArea"); |
| 949 } | 950 } |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1365 #ifndef NDEBUG | 1366 #ifndef NDEBUG |
| 1366 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) | 1367 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) |
| 1367 { | 1368 { |
| 1368 if (!layer) | 1369 if (!layer) |
| 1369 return; | 1370 return; |
| 1370 | 1371 |
| 1371 String output = layer->layerTreeAsText(LayerTreeAsTextDebug | LayerTreeAsTex
tIncludeVisibleRects); | 1372 String output = layer->layerTreeAsText(LayerTreeAsTextDebug | LayerTreeAsTex
tIncludeVisibleRects); |
| 1372 fprintf(stderr, "%s\n", output.utf8().data()); | 1373 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1373 } | 1374 } |
| 1374 #endif | 1375 #endif |
| OLD | NEW |