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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 resetTrackedRepaints(); | 140 resetTrackedRepaints(); |
141 ASSERT(!m_parent); | 141 ASSERT(!m_parent); |
142 } | 142 } |
143 | 143 |
144 void GraphicsLayer::setParent(GraphicsLayer* layer) | 144 void GraphicsLayer::setParent(GraphicsLayer* layer) |
145 { | 145 { |
146 ASSERT(!layer || !layer->hasAncestor(this)); | 146 ASSERT(!layer || !layer->hasAncestor(this)); |
147 m_parent = layer; | 147 m_parent = layer; |
148 } | 148 } |
149 | 149 |
150 #if ASSERT_ENABLED | 150 #if ENABLE(ASSERT) |
151 | 151 |
152 bool GraphicsLayer::hasAncestor(GraphicsLayer* ancestor) const | 152 bool GraphicsLayer::hasAncestor(GraphicsLayer* ancestor) const |
153 { | 153 { |
154 for (GraphicsLayer* curr = parent(); curr; curr = curr->parent()) { | 154 for (GraphicsLayer* curr = parent(); curr; curr = curr->parent()) { |
155 if (curr == ancestor) | 155 if (curr == ancestor) |
156 return true; | 156 return true; |
157 } | 157 } |
158 | 158 |
159 return false; | 159 return false; |
160 } | 160 } |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 #ifndef NDEBUG | 1127 #ifndef NDEBUG |
1128 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) | 1128 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) |
1129 { | 1129 { |
1130 if (!layer) | 1130 if (!layer) |
1131 return; | 1131 return; |
1132 | 1132 |
1133 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); | 1133 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); |
1134 fprintf(stderr, "%s\n", output.utf8().data()); | 1134 fprintf(stderr, "%s\n", output.utf8().data()); |
1135 } | 1135 } |
1136 #endif | 1136 #endif |
OLD | NEW |