| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "wtf/HashSet.h" | 57 #include "wtf/HashSet.h" |
| 58 #include "wtf/text/WTFString.h" | 58 #include "wtf/text/WTFString.h" |
| 59 #include <algorithm> | 59 #include <algorithm> |
| 60 | 60 |
| 61 #ifndef NDEBUG | 61 #ifndef NDEBUG |
| 62 #include <stdio.h> | 62 #include <stdio.h> |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 namespace blink { | 65 namespace blink { |
| 66 | 66 |
| 67 // TODO(wangxianzhu): Remove this when we no longer invalidate rects. |
| 67 struct PaintInvalidationTrackingInfo { | 68 struct PaintInvalidationTrackingInfo { |
| 68 Vector<FloatRect> invalidationRects; | 69 Vector<FloatRect> invalidationRects; |
| 69 Vector<String> invalidationObjects; | 70 Vector<String> invalidationObjects; |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 typedef HashMap<const GraphicsLayer*, PaintInvalidationTrackingInfo> PaintInvali
dationTrackingMap; | 73 typedef HashMap<const GraphicsLayer*, PaintInvalidationTrackingInfo> PaintInvali
dationTrackingMap; |
| 73 static PaintInvalidationTrackingMap& paintInvalidationTrackingMap() | 74 static PaintInvalidationTrackingMap& paintInvalidationTrackingMap() |
| 74 { | 75 { |
| 75 DEFINE_STATIC_LOCAL(PaintInvalidationTrackingMap, map, ()); | 76 DEFINE_STATIC_LOCAL(PaintInvalidationTrackingMap, map, ()); |
| 76 return map; | 77 return map; |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 | 779 |
| 779 m_size = clampedSize; | 780 m_size = clampedSize; |
| 780 | 781 |
| 781 m_layer->layer()->setBounds(flooredIntSize(m_size)); | 782 m_layer->layer()->setBounds(flooredIntSize(m_size)); |
| 782 // Note that we don't resize m_contentsLayer. It's up the caller to do that. | 783 // Note that we don't resize m_contentsLayer. It's up the caller to do that. |
| 783 | 784 |
| 784 #ifndef NDEBUG | 785 #ifndef NDEBUG |
| 785 // The red debug fill needs to be invalidated if the layer resizes. | 786 // The red debug fill needs to be invalidated if the layer resizes. |
| 786 if (m_displayItemList) { | 787 if (m_displayItemList) { |
| 787 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); | 788 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); |
| 788 m_displayItemList->invalidate(displayItemClient()); | 789 m_displayItemList->invalidateUntracked(displayItemClient()); |
| 789 } | 790 } |
| 790 #endif | 791 #endif |
| 791 } | 792 } |
| 792 | 793 |
| 793 void GraphicsLayer::setTransform(const TransformationMatrix& transform) | 794 void GraphicsLayer::setTransform(const TransformationMatrix& transform) |
| 794 { | 795 { |
| 795 m_transform = transform; | 796 m_transform = transform; |
| 796 platformLayer()->setTransform(TransformationMatrix::toSkMatrix44(m_transform
)); | 797 platformLayer()->setTransform(TransformationMatrix::toSkMatrix44(m_transform
)); |
| 797 } | 798 } |
| 798 | 799 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 if (isTrackingPaintInvalidations()) | 980 if (isTrackingPaintInvalidations()) |
| 980 trackPaintInvalidationRect(rect); | 981 trackPaintInvalidationRect(rect); |
| 981 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 982 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
| 982 m_linkHighlights[i]->invalidate(); | 983 m_linkHighlights[i]->invalidate(); |
| 983 } | 984 } |
| 984 } | 985 } |
| 985 | 986 |
| 986 void GraphicsLayer::invalidateDisplayItemClient(const DisplayItemClientWrapper&
displayItemClient) | 987 void GraphicsLayer::invalidateDisplayItemClient(const DisplayItemClientWrapper&
displayItemClient) |
| 987 { | 988 { |
| 988 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); | 989 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); |
| 989 displayItemList()->invalidate(displayItemClient.displayItemClient()); | 990 displayItemList()->invalidate(displayItemClient); |
| 990 if (isTrackingPaintInvalidations()) | 991 if (isTrackingPaintInvalidations()) |
| 991 trackPaintInvalidationObject(displayItemClient.debugName()); | 992 trackPaintInvalidationObject(displayItemClient.debugName()); |
| 992 } | 993 } |
| 993 | 994 |
| 994 void GraphicsLayer::setContentsRect(const IntRect& rect) | 995 void GraphicsLayer::setContentsRect(const IntRect& rect) |
| 995 { | 996 { |
| 996 if (rect == m_contentsRect) | 997 if (rect == m_contentsRect) |
| 997 return; | 998 return; |
| 998 | 999 |
| 999 m_contentsRect = rect; | 1000 m_contentsRect = rect; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 { | 1156 { |
| 1156 if (!layer) { | 1157 if (!layer) { |
| 1157 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1158 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
| 1158 return; | 1159 return; |
| 1159 } | 1160 } |
| 1160 | 1161 |
| 1161 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1162 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1162 fprintf(stderr, "%s\n", output.utf8().data()); | 1163 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1163 } | 1164 } |
| 1164 #endif | 1165 #endif |
| OLD | NEW |