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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
266 | 266 |
267 // If the compositing layer offset changes, we need to repaint. | 267 // If the compositing layer offset changes, we need to repaint. |
268 if (shouldSetNeedsDisplay == SetNeedsDisplay) | 268 if (shouldSetNeedsDisplay == SetNeedsDisplay) |
269 setNeedsDisplay(); | 269 setNeedsDisplay(); |
270 } | 270 } |
271 | 271 |
272 void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const I ntRect& clip) | 272 void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const I ntRect& clip) |
273 { | 273 { |
274 if (!m_client) | 274 if (!m_client) |
275 return; | 275 return; |
276 m_debugInfo.clearAnnotatedInvalidateRects(); | |
276 incrementPaintCount(); | 277 incrementPaintCount(); |
277 m_client->paintContents(this, context, m_paintingPhase, clip); | 278 m_client->paintContents(this, context, m_paintingPhase, clip); |
278 } | 279 } |
279 | 280 |
280 void GraphicsLayer::updateChildList() | 281 void GraphicsLayer::updateChildList() |
281 { | 282 { |
282 WebLayer* childHost = m_layer->layer(); | 283 WebLayer* childHost = m_layer->layer(); |
283 childHost->removeAllChildren(); | 284 childHost->removeAllChildren(); |
284 | 285 |
285 clearContentsLayerIfUnregistered(); | 286 clearContentsLayerIfUnregistered(); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
890 void GraphicsLayer::setNeedsDisplay() | 891 void GraphicsLayer::setNeedsDisplay() |
891 { | 892 { |
892 if (drawsContent()) { | 893 if (drawsContent()) { |
893 m_layer->layer()->invalidate(); | 894 m_layer->layer()->invalidate(); |
894 addRepaintRect(FloatRect(FloatPoint(), m_size)); | 895 addRepaintRect(FloatRect(FloatPoint(), m_size)); |
895 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 896 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
896 m_linkHighlights[i]->invalidate(); | 897 m_linkHighlights[i]->invalidate(); |
897 } | 898 } |
898 } | 899 } |
899 | 900 |
900 void GraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect) | 901 void GraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect, WebInvalidation DebugAnnotations annotations) |
901 { | 902 { |
902 if (drawsContent()) { | 903 if (drawsContent()) { |
903 m_layer->layer()->invalidateRect(rect); | 904 m_layer->layer()->invalidateRect(rect); |
905 m_debugInfo.appendAnnotatedInvalidateRect(rect, annotations); | |
enne (OOO)
2014/09/02 19:41:34
Is there a way to only do this when tracing or sho
kouhei (in TOK)
2014/09/03 22:53:47
I agree we should have a way to only enable these
dsinclair
2014/09/04 15:38:38
For tracing, you can check if the given trace cate
| |
904 addRepaintRect(rect); | 906 addRepaintRect(rect); |
905 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 907 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
906 m_linkHighlights[i]->invalidate(); | 908 m_linkHighlights[i]->invalidate(); |
907 } | 909 } |
908 } | 910 } |
909 | 911 |
910 void GraphicsLayer::setContentsRect(const IntRect& rect) | 912 void GraphicsLayer::setContentsRect(const IntRect& rect) |
911 { | 913 { |
912 if (rect == m_contentsRect) | 914 if (rect == m_contentsRect) |
913 return; | 915 return; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1056 #ifndef NDEBUG | 1058 #ifndef NDEBUG |
1057 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) | 1059 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) |
1058 { | 1060 { |
1059 if (!layer) | 1061 if (!layer) |
1060 return; | 1062 return; |
1061 | 1063 |
1062 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1064 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1063 fprintf(stderr, "%s\n", output.utf8().data()); | 1065 fprintf(stderr, "%s\n", output.utf8().data()); |
1064 } | 1066 } |
1065 #endif | 1067 #endif |
OLD | NEW |