| 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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 // TODO(chrishtr): stop invalidating the rects once FrameView::paintRecursiv
ely does so. | 1050 // TODO(chrishtr): stop invalidating the rects once FrameView::paintRecursiv
ely does so. |
| 1051 m_layer->layer()->invalidate(); | 1051 m_layer->layer()->invalidate(); |
| 1052 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 1052 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
| 1053 m_linkHighlights[i]->invalidate(); | 1053 m_linkHighlights[i]->invalidate(); |
| 1054 getPaintController().invalidateAll(); | 1054 getPaintController().invalidateAll(); |
| 1055 | 1055 |
| 1056 if (isTrackingPaintInvalidations()) | 1056 if (isTrackingPaintInvalidations()) |
| 1057 trackPaintInvalidation(*this, FloatRect(FloatPoint(), m_size), PaintInva
lidationFull); | 1057 trackPaintInvalidation(*this, FloatRect(FloatPoint(), m_size), PaintInva
lidationFull); |
| 1058 } | 1058 } |
| 1059 | 1059 |
| 1060 void GraphicsLayer::setNeedsDisplayInRect(const IntRect& rect, PaintInvalidation
Reason invalidationReason, const DisplayItemClient& client) | 1060 void GraphicsLayer::setNeedsDisplayInRect(const Vector<NeedsDisplayRecord>& rect
s) |
| 1061 { | 1061 { |
| 1062 if (!drawsContent()) | 1062 if (!drawsContent()) |
| 1063 return; | 1063 return; |
| 1064 | 1064 |
| 1065 m_layer->layer()->invalidateRect(rect); | 1065 std::vector<blink::WebRect> offsetRects(rects.size()); |
| 1066 if (firstPaintInvalidationTrackingEnabled()) | 1066 |
| 1067 m_debugInfo.appendAnnotatedInvalidateRect(rect, invalidationReason); | 1067 for (size_t i = 0; i < rects.size(); ++i) { |
| 1068 IntRect rect = rects[i].r; |
| 1069 rect.move(-offsetFromLayoutObject()); |
| 1070 offsetRects[i] = rect; |
| 1071 } |
| 1072 |
| 1073 m_layer->layer()->invalidateRects(offsetRects); |
| 1074 |
| 1075 if (firstPaintInvalidationTrackingEnabled()) { |
| 1076 for (size_t i = 0; i < rects.size(); ++i) { |
| 1077 IntRect rect = rects[i].r; |
| 1078 rect.move(-offsetFromLayoutObject()); |
| 1079 m_debugInfo.appendAnnotatedInvalidateRect(rect, rects[i].invalidatio
nReason); |
| 1080 } |
| 1081 } |
| 1082 |
| 1068 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 1083 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
| 1069 m_linkHighlights[i]->invalidate(); | 1084 m_linkHighlights[i]->invalidate(); |
| 1070 | 1085 |
| 1071 if (isTrackingPaintInvalidations()) | 1086 if (isTrackingPaintInvalidations()) { |
| 1072 trackPaintInvalidation(client, rect, invalidationReason); | 1087 for (size_t i = 0; i < rects.size(); ++i) { |
| 1088 IntRect rect = rects[i].r; |
| 1089 rect.move(-offsetFromLayoutObject()); |
| 1090 trackPaintInvalidation(rects[i].client, rect, rects[i].invalidationR
eason); |
| 1091 } |
| 1092 } |
| 1073 } | 1093 } |
| 1074 | 1094 |
| 1075 void GraphicsLayer::invalidateDisplayItemClient(const DisplayItemClient& display
ItemClient, PaintInvalidationReason invalidationReason) | 1095 void GraphicsLayer::invalidateDisplayItemClient(const DisplayItemClient& display
ItemClient, PaintInvalidationReason invalidationReason) |
| 1076 { | 1096 { |
| 1077 if (!drawsContent()) | 1097 if (!drawsContent()) |
| 1078 return; | 1098 return; |
| 1079 | 1099 |
| 1080 getPaintController().invalidate(displayItemClient); | 1100 getPaintController().invalidate(displayItemClient); |
| 1081 | 1101 |
| 1082 if (isTrackingPaintInvalidations()) | 1102 if (isTrackingPaintInvalidations()) |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 { | 1248 { |
| 1229 if (!layer) { | 1249 if (!layer) { |
| 1230 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1250 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
| 1231 return; | 1251 return; |
| 1232 } | 1252 } |
| 1233 | 1253 |
| 1234 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1254 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1235 fprintf(stderr, "%s\n", output.utf8().data()); | 1255 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1236 } | 1256 } |
| 1237 #endif | 1257 #endif |
| OLD | NEW |