| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // we have a scrolling contents layer to paint it into. | 365 // we have a scrolling contents layer to paint it into. |
| 366 BackgroundPaintLocation paintLocation = | 366 BackgroundPaintLocation paintLocation = |
| 367 m_owningLayer.backgroundPaintLocation(); | 367 m_owningLayer.backgroundPaintLocation(); |
| 368 bool shouldPaintOntoScrollingContentsLayer = | 368 bool shouldPaintOntoScrollingContentsLayer = |
| 369 paintLocation & BackgroundPaintInScrollingContents && | 369 paintLocation & BackgroundPaintInScrollingContents && |
| 370 m_owningLayer.getScrollableArea()->usesCompositedScrolling(); | 370 m_owningLayer.getScrollableArea()->usesCompositedScrolling(); |
| 371 if (shouldPaintOntoScrollingContentsLayer != | 371 if (shouldPaintOntoScrollingContentsLayer != |
| 372 backgroundPaintsOntoScrollingContentsLayer()) { | 372 backgroundPaintsOntoScrollingContentsLayer()) { |
| 373 m_backgroundPaintsOntoScrollingContentsLayer = | 373 m_backgroundPaintsOntoScrollingContentsLayer = |
| 374 shouldPaintOntoScrollingContentsLayer; | 374 shouldPaintOntoScrollingContentsLayer; |
| 375 // If the background is no longer painted onto the scrolling contents layer | 375 // The scrolling contents layer needs to be updated for changed |
| 376 // the scrolling contents layer needs to be updated. If it is going to be | 376 // m_backgroundPaintsOntoScrollingContentsLayer. |
| 377 // painted onto the scrolling contents layer this update will be triggered | 377 if (hasScrollingLayer()) |
| 378 // by LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect | |
| 379 if (hasScrollingLayer() && !shouldPaintOntoScrollingContentsLayer) | |
| 380 m_scrollingContentsLayer->setNeedsDisplay(); | 378 m_scrollingContentsLayer->setNeedsDisplay(); |
| 381 } | 379 } |
| 382 m_backgroundPaintsOntoGraphicsLayer = | 380 bool shouldPaintOntoGraphicsLayer = |
| 383 !m_backgroundPaintsOntoScrollingContentsLayer || | 381 !m_backgroundPaintsOntoScrollingContentsLayer || |
| 384 paintLocation & BackgroundPaintInGraphicsLayer; | 382 paintLocation & BackgroundPaintInGraphicsLayer; |
| 383 if (shouldPaintOntoGraphicsLayer != !!m_backgroundPaintsOntoGraphicsLayer) { |
| 384 m_backgroundPaintsOntoGraphicsLayer = shouldPaintOntoGraphicsLayer; |
| 385 // The graphics layer needs to be updated for changed |
| 386 // m_backgroundPaintsOntoGraphicsLayer. |
| 387 m_graphicsLayer->setNeedsDisplay(); |
| 388 } |
| 385 } | 389 } |
| 386 | 390 |
| 387 void CompositedLayerMapping::updateContentsOpaque() { | 391 void CompositedLayerMapping::updateContentsOpaque() { |
| 388 if (isAcceleratedCanvas(layoutObject())) { | 392 if (isAcceleratedCanvas(layoutObject())) { |
| 389 // Determine whether the rendering context's external texture layer is | 393 // Determine whether the rendering context's external texture layer is |
| 390 // opaque. | 394 // opaque. |
| 391 CanvasRenderingContext* context = | 395 CanvasRenderingContext* context = |
| 392 toHTMLCanvasElement(layoutObject()->node())->renderingContext(); | 396 toHTMLCanvasElement(layoutObject()->node())->renderingContext(); |
| 393 if (!context->creationAttributes().alpha()) | 397 if (!context->creationAttributes().alpha()) |
| 394 m_graphicsLayer->setContentsOpaque(true); | 398 m_graphicsLayer->setContentsOpaque(true); |
| (...skipping 2975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3370 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { | 3374 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { |
| 3371 name = "Decoration Layer"; | 3375 name = "Decoration Layer"; |
| 3372 } else { | 3376 } else { |
| 3373 ASSERT_NOT_REACHED(); | 3377 ASSERT_NOT_REACHED(); |
| 3374 } | 3378 } |
| 3375 | 3379 |
| 3376 return name; | 3380 return name; |
| 3377 } | 3381 } |
| 3378 | 3382 |
| 3379 } // namespace blink | 3383 } // namespace blink |
| OLD | NEW |