| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 if (offset == m_offsetFromLayoutObject) | 285 if (offset == m_offsetFromLayoutObject) |
| 286 return; | 286 return; |
| 287 | 287 |
| 288 m_offsetFromLayoutObject = offset; | 288 m_offsetFromLayoutObject = offset; |
| 289 | 289 |
| 290 // If the compositing layer offset changes, we need to repaint. | 290 // If the compositing layer offset changes, we need to repaint. |
| 291 if (shouldSetNeedsDisplay == SetNeedsDisplay) | 291 if (shouldSetNeedsDisplay == SetNeedsDisplay) |
| 292 setNeedsDisplay(); | 292 setNeedsDisplay(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 IntRect GraphicsLayer::interestRect() |
| 296 { |
| 297 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) |
| 298 m_previousInterestRect = m_client->computeInterestRect(this, m_previousI
nterestRect); |
| 299 return m_previousInterestRect; |
| 300 } |
| 301 |
| 295 void GraphicsLayer::paint(GraphicsContext& context, const IntRect* interestRect) | 302 void GraphicsLayer::paint(GraphicsContext& context, const IntRect* interestRect) |
| 296 { | 303 { |
| 297 ASSERT(interestRect || RuntimeEnabledFeatures::slimmingPaintSynchronizedPain
tingEnabled()); | 304 ASSERT(interestRect || RuntimeEnabledFeatures::slimmingPaintSynchronizedPain
tingEnabled()); |
| 298 ASSERT(drawsContent()); | 305 ASSERT(drawsContent()); |
| 299 | 306 |
| 300 if (!m_client) | 307 if (!m_client) |
| 301 return; | 308 return; |
| 302 if (firstPaintInvalidationTrackingEnabled()) | 309 if (firstPaintInvalidationTrackingEnabled()) |
| 303 m_debugInfo.clearAnnotatedInvalidateRects(); | 310 m_debugInfo.clearAnnotatedInvalidateRects(); |
| 304 incrementPaintCount(); | 311 incrementPaintCount(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 317 if (!interestRect) { | 324 if (!interestRect) { |
| 318 newInterestRect = m_client->computeInterestRect(this, m_previousInte
restRect); | 325 newInterestRect = m_client->computeInterestRect(this, m_previousInte
restRect); |
| 319 interestRect = &newInterestRect; | 326 interestRect = &newInterestRect; |
| 320 } | 327 } |
| 321 if (!m_client->needsRepaint() && !paintController()->cacheIsEmpty() && m
_previousInterestRect == *interestRect) { | 328 if (!m_client->needsRepaint() && !paintController()->cacheIsEmpty() && m
_previousInterestRect == *interestRect) { |
| 322 paintController()->createAndAppend<CachedDisplayItem>(*this, Display
Item::CachedDisplayItemList); | 329 paintController()->createAndAppend<CachedDisplayItem>(*this, Display
Item::CachedDisplayItemList); |
| 323 return; | 330 return; |
| 324 } | 331 } |
| 325 } | 332 } |
| 326 | 333 |
| 334 m_previousInterestRect = *interestRect; |
| 327 m_client->paintContents(this, context, m_paintingPhase, *interestRect); | 335 m_client->paintContents(this, context, m_paintingPhase, *interestRect); |
| 328 notifyFirstPaintToClient(); | 336 notifyFirstPaintToClient(); |
| 329 m_previousInterestRect = *interestRect; | |
| 330 } | 337 } |
| 331 | 338 |
| 332 void GraphicsLayer::notifyFirstPaintToClient() | 339 void GraphicsLayer::notifyFirstPaintToClient() |
| 333 { | 340 { |
| 334 if (!m_painted) { | 341 if (!m_painted) { |
| 335 m_painted = true; | 342 m_painted = true; |
| 336 m_client->notifyFirstPaint(); | 343 m_client->notifyFirstPaint(); |
| 337 } | 344 } |
| 338 if (!m_textPainted && m_paintController->textPainted()) { | 345 if (!m_textPainted && m_paintController->textPainted()) { |
| 339 m_textPainted = true; | 346 m_textPainted = true; |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 { | 1212 { |
| 1206 if (!layer) { | 1213 if (!layer) { |
| 1207 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1214 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
| 1208 return; | 1215 return; |
| 1209 } | 1216 } |
| 1210 | 1217 |
| 1211 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1218 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1212 fprintf(stderr, "%s\n", output.utf8().data()); | 1219 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1213 } | 1220 } |
| 1214 #endif | 1221 #endif |
| OLD | NEW |