| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 void styleChanged(StyleDifference, const RenderStyle* oldStyle); | 112 void styleChanged(StyleDifference, const RenderStyle* oldStyle); |
| 113 | 113 |
| 114 // FIXME: Many people call this function while it has out-of-date informatio
n. | 114 // FIXME: Many people call this function while it has out-of-date informatio
n. |
| 115 bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } | 115 bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } |
| 116 | 116 |
| 117 void setLayerType(LayerType layerType) { m_layerType = layerType; } | 117 void setLayerType(LayerType layerType) { m_layerType = layerType; } |
| 118 | 118 |
| 119 bool isTransparent() const { return renderer()->isTransparent() || renderer(
)->hasMask(); } | 119 bool isTransparent() const { return renderer()->isTransparent() || renderer(
)->hasMask(); } |
| 120 RenderLayer* transparentPaintingAncestor(); | 120 RenderLayer* transparentPaintingAncestor(); |
| 121 void beginTransparencyLayers(GraphicsContext*, const RenderLayer* rootLayer,
const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, Paint
Behavior); | 121 void beginTransparencyLayers(GraphicsContext*, const RenderLayer* rootLayer,
const LayoutRect& paintDirtyRect, const LayoutSize& subPixelAccumulation); |
| 122 | 122 |
| 123 const RenderLayer* root() const | 123 const RenderLayer* root() const |
| 124 { | 124 { |
| 125 const RenderLayer* curr = this; | 125 const RenderLayer* curr = this; |
| 126 while (curr->parent()) | 126 while (curr->parent()) |
| 127 curr = curr->parent(); | 127 curr = curr->parent(); |
| 128 return curr; | 128 return curr; |
| 129 } | 129 } |
| 130 | 130 |
| 131 LayoutPoint location() const; | 131 LayoutPoint location() const; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint&) co
nst; | 177 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint&) co
nst; |
| 178 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) con
st; | 178 void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutRect&) con
st; |
| 179 | 179 |
| 180 // The two main functions that use the layer system. The paint method | 180 // The two main functions that use the layer system. The paint method |
| 181 // paints the layers that intersect the damage rect from back to | 181 // paints the layers that intersect the damage rect from back to |
| 182 // front. The hitTest method looks for mouse events by walking | 182 // front. The hitTest method looks for mouse events by walking |
| 183 // layers that intersect the point from front to back. | 183 // layers that intersect the point from front to back. |
| 184 // paint() assumes that the caller will clip to the bounds of damageRect if
necessary. | 184 // paint() assumes that the caller will clip to the bounds of damageRect if
necessary. |
| 185 void paint(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior = P
aintBehaviorNormal, RenderObject* paintingRoot = 0, PaintLayerFlags = 0); | 185 void paint(GraphicsContext*, const LayoutRect& damageRect, RenderObject* pai
ntingRoot = 0, PaintLayerFlags = 0); |
| 186 bool hitTest(const HitTestRequest&, HitTestResult&); | 186 bool hitTest(const HitTestRequest&, HitTestResult&); |
| 187 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); | 187 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); |
| 188 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect,
PaintBehavior, RenderObject* paintingRoot = 0); | 188 void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect,
RenderObject* paintingRoot = 0); |
| 189 | 189 |
| 190 // Pass offsetFromRoot if known. | 190 // Pass offsetFromRoot if known. |
| 191 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& d
amageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot = 0)
const; | 191 bool intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& d
amageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot = 0)
const; |
| 192 | 192 |
| 193 // Bounding box relative to some ancestor layer. Pass offsetFromRoot if know
n. | 193 // Bounding box relative to some ancestor layer. Pass offsetFromRoot if know
n. |
| 194 LayoutRect physicalBoundingBox(const RenderLayer* ancestorLayer, const Layou
tPoint* offsetFromRoot = 0) const; | 194 LayoutRect physicalBoundingBox(const RenderLayer* ancestorLayer, const Layou
tPoint* offsetFromRoot = 0) const; |
| 195 LayoutRect physicalBoundingBoxIncludingReflectionAndStackingChildren(const R
enderLayer* ancestorLayer, const LayoutPoint& offsetFromRoot) const; | 195 LayoutRect physicalBoundingBoxIncludingReflectionAndStackingChildren(const R
enderLayer* ancestorLayer, const LayoutPoint& offsetFromRoot) const; |
| 196 | 196 |
| 197 // FIXME: This function is inconsistent as to whether the returned rect has
been flipped for writing mode. | 197 // FIXME: This function is inconsistent as to whether the returned rect has
been flipped for writing mode. |
| 198 LayoutRect boundingBoxForCompositingOverlapTest() const { return overlapBoun
dsIncludeChildren() ? boundingBoxForCompositing() : logicalBoundingBox(); } | 198 LayoutRect boundingBoxForCompositingOverlapTest() const { return overlapBoun
dsIncludeChildren() ? boundingBoxForCompositing() : logicalBoundingBox(); } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 216 LayoutSize subpixelAccumulation() const; | 216 LayoutSize subpixelAccumulation() const; |
| 217 void setSubpixelAccumulation(const LayoutSize&); | 217 void setSubpixelAccumulation(const LayoutSize&); |
| 218 | 218 |
| 219 bool hasTransform() const { return renderer()->hasTransform(); } | 219 bool hasTransform() const { return renderer()->hasTransform(); } |
| 220 // Note that this transform has the transform-origin baked in. | 220 // Note that this transform has the transform-origin baked in. |
| 221 TransformationMatrix* transform() const { return m_transform.get(); } | 221 TransformationMatrix* transform() const { return m_transform.get(); } |
| 222 // currentTransform computes a transform which takes accelerated animations
into account. The | 222 // currentTransform computes a transform which takes accelerated animations
into account. The |
| 223 // resulting transform has transform-origin baked in. If the layer does not
have a transform, | 223 // resulting transform has transform-origin baked in. If the layer does not
have a transform, |
| 224 // returns the identity matrix. | 224 // returns the identity matrix. |
| 225 TransformationMatrix currentTransform(RenderStyle::ApplyTransformOrigin = Re
nderStyle::IncludeTransformOrigin) const; | 225 TransformationMatrix currentTransform(RenderStyle::ApplyTransformOrigin = Re
nderStyle::IncludeTransformOrigin) const; |
| 226 TransformationMatrix renderableTransform(PaintBehavior) const; | 226 TransformationMatrix renderableTransform() const; |
| 227 | 227 |
| 228 // Get the perspective transform, which is applied to transformed sublayers. | 228 // Get the perspective transform, which is applied to transformed sublayers. |
| 229 // Returns true if the layer has a -webkit-perspective. | 229 // Returns true if the layer has a -webkit-perspective. |
| 230 // Note that this transform has the perspective-origin baked in. | 230 // Note that this transform has the perspective-origin baked in. |
| 231 TransformationMatrix perspectiveTransform() const; | 231 TransformationMatrix perspectiveTransform() const; |
| 232 FloatPoint perspectiveOrigin() const; | 232 FloatPoint perspectiveOrigin() const; |
| 233 bool preserves3D() const { return renderer()->style()->transformStyle3D() ==
TransformStyle3DPreserve3D; } | 233 bool preserves3D() const { return renderer()->style()->transformStyle3D() ==
TransformStyle3DPreserve3D; } |
| 234 bool has3DTransform() const { return m_transform && !m_transform->isAffine()
; } | 234 bool has3DTransform() const { return m_transform && !m_transform->isAffine()
; } |
| 235 | 235 |
| 236 // FIXME: reflections should force transform-style to be flat in the style:
https://bugs.webkit.org/show_bug.cgi?id=106959 | 236 // FIXME: reflections should force transform-style to be flat in the style:
https://bugs.webkit.org/show_bug.cgi?id=106959 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 249 // FIXME: invert the logic to have paint invalidation containers take care o
f painting objects into them, rather than the reverse. | 249 // FIXME: invert the logic to have paint invalidation containers take care o
f painting objects into them, rather than the reverse. |
| 250 // This will allow us to clean up this static method messiness. | 250 // This will allow us to clean up this static method messiness. |
| 251 static LayoutPoint positionFromPaintInvalidationContainer(const RenderObject
*, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalida
tionState* = 0); | 251 static LayoutPoint positionFromPaintInvalidationContainer(const RenderObject
*, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalida
tionState* = 0); |
| 252 | 252 |
| 253 // Adjusts the given rect (in the coordinate space of the RenderObject) to t
he coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing. | 253 // Adjusts the given rect (in the coordinate space of the RenderObject) to t
he coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing. |
| 254 static void mapRectToPaintInvalidationBacking(const RenderObject*, const Ren
derLayerModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalid
ationState* = 0); | 254 static void mapRectToPaintInvalidationBacking(const RenderObject*, const Ren
derLayerModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalid
ationState* = 0); |
| 255 | 255 |
| 256 // Computes the bounding paint invalidation rect for |renderObject|, in the
coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing. | 256 // Computes the bounding paint invalidation rect for |renderObject|, in the
coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing. |
| 257 static LayoutRect computePaintInvalidationRect(const RenderObject*, const Re
nderLayer* paintInvalidationContainer, const PaintInvalidationState* = 0); | 257 static LayoutRect computePaintInvalidationRect(const RenderObject*, const Re
nderLayer* paintInvalidationContainer, const PaintInvalidationState* = 0); |
| 258 | 258 |
| 259 bool paintsWithTransform(PaintBehavior) const; | 259 bool paintsWithTransform() const; |
| 260 | 260 |
| 261 // Returns true if background phase is painted opaque in the given rect. | 261 // Returns true if background phase is painted opaque in the given rect. |
| 262 // The query rect is given in local coordinates. | 262 // The query rect is given in local coordinates. |
| 263 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; | 263 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; |
| 264 | 264 |
| 265 bool containsDirtyOverlayScrollbars() const { return m_containsDirtyOverlayS
crollbars; } | 265 bool containsDirtyOverlayScrollbars() const { return m_containsDirtyOverlayS
crollbars; } |
| 266 void setContainsDirtyOverlayScrollbars(bool dirtyScrollbars) { m_containsDir
tyOverlayScrollbars = dirtyScrollbars; } | 266 void setContainsDirtyOverlayScrollbars(bool dirtyScrollbars) { m_containsDir
tyOverlayScrollbars = dirtyScrollbars; } |
| 267 | 267 |
| 268 FilterOperations computeFilterOperations(const RenderStyle*); | 268 FilterOperations computeFilterOperations(const RenderStyle*); |
| 269 bool paintsWithFilters() const; | 269 bool paintsWithFilters() const; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 456 |
| 457 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo
&, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint()); | 457 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo
&, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint()); |
| 458 | 458 |
| 459 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa
intingInfo&, PaintLayerFlags); | 459 void paintChildren(unsigned childrenToVisit, GraphicsContext*, const LayerPa
intingInfo&, PaintLayerFlags); |
| 460 | 460 |
| 461 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, const L
ayoutRect& dirtyRect, | 461 void collectFragments(LayerFragments&, const RenderLayer* rootLayer, const L
ayoutRect& dirtyRect, |
| 462 ClipRectsCacheSlot, const LayoutPoint* offsetFromRoot = 0, | 462 ClipRectsCacheSlot, const LayoutPoint* offsetFromRoot = 0, |
| 463 const LayoutSize& subPixelAccumulation = LayoutSize(), const LayoutRect*
layerBoundingBox = 0); | 463 const LayoutSize& subPixelAccumulation = LayoutSize(), const LayoutRect*
layerBoundingBox = 0); |
| 464 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo
&, PaintLayerFlags, bool shouldPaintContent, const LayoutPoint* offsetFromRoot); | 464 void updatePaintingInfoForFragments(LayerFragments&, const LayerPaintingInfo
&, PaintLayerFlags, bool shouldPaintContent, const LayoutPoint* offsetFromRoot); |
| 465 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, | 465 void paintBackgroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, |
| 466 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, Pai
ntLayerFlags); | 466 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, RenderObject* paintingRootForRenderer, PaintLayerFlags); |
| 467 void paintForegroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, | 467 void paintForegroundForFragments(const LayerFragments&, GraphicsContext*, Gr
aphicsContext* transparencyLayerContext, |
| 468 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, | 468 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, con
st LayerPaintingInfo&, RenderObject* paintingRootForRenderer, |
| 469 PaintLayerFlags); | 469 PaintLayerFlags); |
| 470 void paintForegroundForFragmentsWithPhase(PaintPhase, const LayerFragments&,
GraphicsContext*, const LayerPaintingInfo&, PaintBehavior, RenderObject* painti
ngRootForRenderer, PaintLayerFlags); | 470 void paintForegroundForFragmentsWithPhase(PaintPhase, const LayerFragments&,
GraphicsContext*, const LayerPaintingInfo&, RenderObject* paintingRootForRender
er, PaintLayerFlags); |
| 471 void paintOutlineForFragments(const LayerFragments&, GraphicsContext*, const
LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer, Paint
LayerFlags); | 471 void paintOutlineForFragments(const LayerFragments&, GraphicsContext*, const
LayerPaintingInfo&, RenderObject* paintingRootForRenderer, PaintLayerFlags); |
| 472 void paintOverflowControlsForFragments(const LayerFragments&, GraphicsContex
t*, const LayerPaintingInfo&, PaintLayerFlags); | 472 void paintOverflowControlsForFragments(const LayerFragments&, GraphicsContex
t*, const LayerPaintingInfo&, PaintLayerFlags); |
| 473 void paintMaskForFragments(const LayerFragments&, GraphicsContext*, const La
yerPaintingInfo&, RenderObject* paintingRootForRenderer, PaintLayerFlags); | 473 void paintMaskForFragments(const LayerFragments&, GraphicsContext*, const La
yerPaintingInfo&, RenderObject* paintingRootForRenderer, PaintLayerFlags); |
| 474 void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsConte
xt*, const LayerPaintingInfo&, RenderObject* paintingRootForRenderer, PaintLayer
Flags); | 474 void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsConte
xt*, const LayerPaintingInfo&, RenderObject* paintingRootForRenderer, PaintLayer
Flags); |
| 475 | 475 |
| 476 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLaye
r, const HitTestRequest& request, HitTestResult& result, | 476 RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLaye
r, const HitTestRequest& request, HitTestResult& result, |
| 477 const LayoutRect& hitTestRect, const HitTestLocati
on&, bool appliedTransform, | 477 const LayoutRect& hitTestRect, const HitTestLocati
on&, bool appliedTransform, |
| 478 const HitTestingTransformState* transformState = 0
, double* zOffset = 0); | 478 const HitTestingTransformState* transformState = 0
, double* zOffset = 0); |
| 479 RenderLayer* hitTestLayerByApplyingTransform(RenderLayer* rootLayer, RenderL
ayer* containerLayer, const HitTestRequest&, HitTestResult&, | 479 RenderLayer* hitTestLayerByApplyingTransform(RenderLayer* rootLayer, RenderL
ayer* containerLayer, const HitTestRequest&, HitTestResult&, |
| 480 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0, | 480 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0, |
| 481 const LayoutPoint& translationOffset = LayoutPoint()); | 481 const LayoutPoint& translationOffset = LayoutPoint()); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 506 void updateScrollableArea(); | 506 void updateScrollableArea(); |
| 507 | 507 |
| 508 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); | 508 void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); |
| 509 | 509 |
| 510 void dirty3DTransformedDescendantStatus(); | 510 void dirty3DTransformedDescendantStatus(); |
| 511 // Both updates the status, and returns true if descendants of this have 3d. | 511 // Both updates the status, and returns true if descendants of this have 3d. |
| 512 bool update3DTransformedDescendantStatus(); | 512 bool update3DTransformedDescendantStatus(); |
| 513 | 513 |
| 514 void updateOrRemoveFilterClients(); | 514 void updateOrRemoveFilterClients(); |
| 515 | 515 |
| 516 LayoutRect paintingExtent(const RenderLayer* rootLayer, const LayoutRect& pa
intDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior); | 516 LayoutRect paintingExtent(const RenderLayer* rootLayer, const LayoutRect& pa
intDirtyRect, const LayoutSize& subPixelAccumulation); |
| 517 | 517 |
| 518 LayerType m_layerType; | 518 LayerType m_layerType; |
| 519 | 519 |
| 520 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting | 520 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting |
| 521 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. | 521 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. |
| 522 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. | 522 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. |
| 523 unsigned m_isSelfPaintingLayer : 1; | 523 unsigned m_isSelfPaintingLayer : 1; |
| 524 | 524 |
| 525 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to | 525 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to |
| 526 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). | 526 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 | 589 |
| 590 } // namespace blink | 590 } // namespace blink |
| 591 | 591 |
| 592 #ifndef NDEBUG | 592 #ifndef NDEBUG |
| 593 // Outside the WebCore namespace for ease of invocation from gdb. | 593 // Outside the WebCore namespace for ease of invocation from gdb. |
| 594 void showLayerTree(const blink::RenderLayer*); | 594 void showLayerTree(const blink::RenderLayer*); |
| 595 void showLayerTree(const blink::RenderObject*); | 595 void showLayerTree(const blink::RenderObject*); |
| 596 #endif | 596 #endif |
| 597 | 597 |
| 598 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ | 598 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ |
| OLD | NEW |