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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 setNeedsDisplay(); | 295 setNeedsDisplay(); |
296 } | 296 } |
297 | 297 |
298 IntRect GraphicsLayer::interestRect() | 298 IntRect GraphicsLayer::interestRect() |
299 { | 299 { |
300 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) | 300 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) |
301 m_previousInterestRect = m_client->computeInterestRect(this, m_previousI nterestRect); | 301 m_previousInterestRect = m_client->computeInterestRect(this, m_previousI nterestRect); |
302 return m_previousInterestRect; | 302 return m_previousInterestRect; |
303 } | 303 } |
304 | 304 |
305 void GraphicsLayer::paint(GraphicsContext& context, const IntRect* interestRect) | 305 void GraphicsLayer::paint(GraphicsContext& context, const IntRect* interestRect) |
jbroman
2015/12/01 21:11:02
Is the plan to ultimately remove the argument from
| |
306 { | 306 { |
307 ASSERT(interestRect || RuntimeEnabledFeatures::slimmingPaintSynchronizedPain tingEnabled()); | |
308 ASSERT(drawsContent()); | 307 ASSERT(drawsContent()); |
309 ASSERT(&context.paintController() == m_paintController); | 308 ASSERT(&context.paintController() == m_paintController); |
310 | 309 |
311 if (!m_client) | 310 if (!m_client) |
312 return; | 311 return; |
313 if (firstPaintInvalidationTrackingEnabled()) | 312 if (firstPaintInvalidationTrackingEnabled()) |
314 m_debugInfo.clearAnnotatedInvalidateRects(); | 313 m_debugInfo.clearAnnotatedInvalidateRects(); |
315 incrementPaintCount(); | 314 incrementPaintCount(); |
316 | 315 |
317 IntRect newInterestRect; | 316 IntRect newInterestRect; |
317 if (!interestRect) { | |
318 newInterestRect = m_client->computeInterestRect(this, m_previousInterest Rect); | |
319 interestRect = &newInterestRect; | |
320 } | |
321 | |
318 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { | 322 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { |
319 if (!interestRect) { | |
320 newInterestRect = m_client->computeInterestRect(this, m_previousInte restRect); | |
321 interestRect = &newInterestRect; | |
322 } | |
323 if (!m_client->needsRepaint() && !paintController()->cacheIsEmpty() && m _previousInterestRect == *interestRect) { | 323 if (!m_client->needsRepaint() && !paintController()->cacheIsEmpty() && m _previousInterestRect == *interestRect) { |
324 paintController()->createAndAppend<CachedDisplayItem>(*this, Display Item::CachedDisplayItemList); | 324 paintController()->createAndAppend<CachedDisplayItem>(*this, Display Item::CachedDisplayItemList); |
325 return; | 325 return; |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 #ifndef NDEBUG | 329 #ifndef NDEBUG |
330 if (contentsOpaque() && s_drawDebugRedFill) { | 330 if (contentsOpaque() && s_drawDebugRedFill) { |
331 FloatRect rect(FloatPoint(), size()); | 331 FloatRect rect(FloatPoint(), size()); |
332 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) { | 332 if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, Display Item::DebugRedFill)) { |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1222 { | 1222 { |
1223 if (!layer) { | 1223 if (!layer) { |
1224 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1224 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
1225 return; | 1225 return; |
1226 } | 1226 } |
1227 | 1227 |
1228 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1228 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1229 fprintf(stderr, "%s\n", output.utf8().data()); | 1229 fprintf(stderr, "%s\n", output.utf8().data()); |
1230 } | 1230 } |
1231 #endif | 1231 #endif |
OLD | NEW |