| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); USING_FAST_MALLOC(CompositedLa
yerMapping); | 80 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); USING_FAST_MALLOC(CompositedLa
yerMapping); |
| 81 public: | 81 public: |
| 82 explicit CompositedLayerMapping(PaintLayer&); | 82 explicit CompositedLayerMapping(PaintLayer&); |
| 83 ~CompositedLayerMapping() override; | 83 ~CompositedLayerMapping() override; |
| 84 | 84 |
| 85 PaintLayer& owningLayer() const { return m_owningLayer; } | 85 PaintLayer& owningLayer() const { return m_owningLayer; } |
| 86 | 86 |
| 87 bool updateGraphicsLayerConfiguration(); | 87 bool updateGraphicsLayerConfiguration(); |
| 88 void updateGraphicsLayerGeometry(const PaintLayer* compositingContainer, con
st PaintLayer* compositingStackingContext, Vector<PaintLayer*>& layersNeedingPai
ntInvalidation); | 88 void updateGraphicsLayerGeometry(const PaintLayer* compositingContainer, con
st PaintLayer* compositingStackingContext, Vector<PaintLayer*>& layersNeedingPai
ntInvalidation); |
| 89 | 89 |
| 90 // Update whether background paints onto scrolling contents layer. |
| 91 void updateBackgroundPaintingLayer(); |
| 92 |
| 90 // Update whether layer needs blending. | 93 // Update whether layer needs blending. |
| 91 void updateContentsOpaque(); | 94 void updateContentsOpaque(); |
| 92 | 95 |
| 93 GraphicsLayer* mainGraphicsLayer() const { return m_graphicsLayer.get(); } | 96 GraphicsLayer* mainGraphicsLayer() const { return m_graphicsLayer.get(); } |
| 94 | 97 |
| 95 // Layer to clip children | 98 // Layer to clip children |
| 96 bool hasClippingLayer() const { return m_childContainmentLayer.get(); } | 99 bool hasClippingLayer() const { return m_childContainmentLayer.get(); } |
| 97 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} | 100 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} |
| 98 | 101 |
| 99 // Layer to get clipped by ancestor | 102 // Layer to get clipped by ancestor |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 void updateScrollingBlockSelection(); | 219 void updateScrollingBlockSelection(); |
| 217 | 220 |
| 218 void adjustForCompositedScrolling(const GraphicsLayer*, IntSize& offset) con
st; | 221 void adjustForCompositedScrolling(const GraphicsLayer*, IntSize& offset) con
st; |
| 219 | 222 |
| 220 // Returns true for layers with scrollable overflow which have a background | 223 // Returns true for layers with scrollable overflow which have a background |
| 221 // that can be painted into the composited scrolling contents layer (i.e. | 224 // that can be painted into the composited scrolling contents layer (i.e. |
| 222 // the background can scroll with the content). When the background is also | 225 // the background can scroll with the content). When the background is also |
| 223 // opaque this allows us to composite the scroller even on low DPI as we can | 226 // opaque this allows us to composite the scroller even on low DPI as we can |
| 224 // draw with subpixel anti-aliasing. | 227 // draw with subpixel anti-aliasing. |
| 225 bool shouldPaintBackgroundOntoScrollingContentsLayer() const; | 228 bool shouldPaintBackgroundOntoScrollingContentsLayer() const; |
| 229 bool backgroundPaintsOntoScrollingContentsLayer() { return m_backgroundPaint
sOntoScrollingContentsLayer; } |
| 226 | 230 |
| 227 private: | 231 private: |
| 228 IntRect recomputeInterestRect(const GraphicsLayer*) const; | 232 IntRect recomputeInterestRect(const GraphicsLayer*) const; |
| 229 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere
stRect, const IntRect& newInterestRect, const IntSize& layerSize); | 233 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere
stRect, const IntRect& newInterestRect, const IntSize& layerSize); |
| 230 | 234 |
| 231 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj
ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn
dex); | 235 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj
ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn
dex); |
| 232 | 236 |
| 233 // Paints the scrollbar part associated with the given graphics layer into t
he given context. | 237 // Paints the scrollbar part associated with the given graphics layer into t
he given context. |
| 234 void paintScrollableArea(const GraphicsLayer*, GraphicsContext&, const IntRe
ct& interestRect) const; | 238 void paintScrollableArea(const GraphicsLayer*, GraphicsContext&, const IntRe
ct& interestRect) const; |
| 235 // Returns whether the given layer is part of the scrollable area, if any, a
ssociated with this mapping. | 239 // Returns whether the given layer is part of the scrollable area, if any, a
ssociated with this mapping. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 DoubleSize m_scrollingContentsOffset; | 458 DoubleSize m_scrollingContentsOffset; |
| 455 | 459 |
| 456 unsigned m_contentOffsetInCompositingLayerDirty : 1; | 460 unsigned m_contentOffsetInCompositingLayerDirty : 1; |
| 457 | 461 |
| 458 unsigned m_pendingUpdateScope : 2; | 462 unsigned m_pendingUpdateScope : 2; |
| 459 unsigned m_isMainFrameLayoutViewLayer : 1; | 463 unsigned m_isMainFrameLayoutViewLayer : 1; |
| 460 | 464 |
| 461 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; | 465 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; |
| 462 unsigned m_scrollingContentsAreEmpty : 1; | 466 unsigned m_scrollingContentsAreEmpty : 1; |
| 463 | 467 |
| 468 // Keep track of whether the background is painted onto the scrolling conten
ts layer for invalidations. |
| 469 unsigned m_backgroundPaintsOntoScrollingContentsLayer : 1; |
| 470 |
| 464 friend class CompositedLayerMappingTest; | 471 friend class CompositedLayerMappingTest; |
| 465 }; | 472 }; |
| 466 | 473 |
| 467 } // namespace blink | 474 } // namespace blink |
| 468 | 475 |
| 469 #endif // CompositedLayerMapping_h | 476 #endif // CompositedLayerMapping_h |
| OLD | NEW |