OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 3236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3247 // FIXME: Could eliminate the isRoot() check if we fix background painting s
o that the RenderView | 3247 // FIXME: Could eliminate the isRoot() check if we fix background painting s
o that the RenderView |
3248 // paints the root's background. | 3248 // paints the root's background. |
3249 if (isRootLayer() || renderer()->isRoot()) | 3249 if (isRootLayer() || renderer()->isRoot()) |
3250 return true; | 3250 return true; |
3251 | 3251 |
3252 // If we aren't an inline flow, and our layer bounds do intersect the damage
rect, then we | 3252 // If we aren't an inline flow, and our layer bounds do intersect the damage
rect, then we |
3253 // can go ahead and return true. | 3253 // can go ahead and return true. |
3254 RenderView* view = renderer()->view(); | 3254 RenderView* view = renderer()->view(); |
3255 ASSERT(view); | 3255 ASSERT(view); |
3256 if (view && !renderer()->isRenderInline()) { | 3256 if (view && !renderer()->isRenderInline()) { |
3257 LayoutRect b = layerBounds; | 3257 if (layerBounds.intersects(damageRect)) |
3258 b.inflate(view->maximalOutlineSize()); | |
3259 if (b.intersects(damageRect)) | |
3260 return true; | 3258 return true; |
3261 } | 3259 } |
3262 | 3260 |
3263 // Otherwise we need to compute the bounding box of this single layer and se
e if it intersects | 3261 // Otherwise we need to compute the bounding box of this single layer and se
e if it intersects |
3264 // the damage rect. | 3262 // the damage rect. |
3265 return boundingBox(rootLayer, 0, offsetFromRoot).intersects(damageRect); | 3263 return boundingBox(rootLayer, 0, offsetFromRoot).intersects(damageRect); |
3266 } | 3264 } |
3267 | 3265 |
3268 LayoutRect RenderLayer::localBoundingBox(CalculateLayerBoundsFlags flags) const | 3266 LayoutRect RenderLayer::localBoundingBox(CalculateLayerBoundsFlags flags) const |
3269 { | 3267 { |
(...skipping 28 matching lines...) Expand all Loading... |
3298 box->flipForWritingMode(result); // The mask clip rect is in physica
l coordinates, so we have to flip, since localBoundingBox is not. | 3296 box->flipForWritingMode(result); // The mask clip rect is in physica
l coordinates, so we have to flip, since localBoundingBox is not. |
3299 } else { | 3297 } else { |
3300 LayoutRect bbox = box->borderBoxRect(); | 3298 LayoutRect bbox = box->borderBoxRect(); |
3301 result = bbox; | 3299 result = bbox; |
3302 LayoutRect overflowRect = box->visualOverflowRect(); | 3300 LayoutRect overflowRect = box->visualOverflowRect(); |
3303 if (bbox != overflowRect) | 3301 if (bbox != overflowRect) |
3304 result.unite(overflowRect); | 3302 result.unite(overflowRect); |
3305 } | 3303 } |
3306 } | 3304 } |
3307 | 3305 |
3308 RenderView* view = renderer()->view(); | 3306 ASSERT(renderer()->view()); |
3309 ASSERT(view); | |
3310 if (view) | |
3311 result.inflate(view->maximalOutlineSize()); // Used to apply a fudge fac
tor to dirty-rect checks on blocks/tables. | |
3312 | 3307 |
3313 return result; | 3308 return result; |
3314 } | 3309 } |
3315 | 3310 |
3316 LayoutRect RenderLayer::boundingBox(const RenderLayer* ancestorLayer, CalculateL
ayerBoundsFlags flags, const LayoutPoint* offsetFromRoot) const | 3311 LayoutRect RenderLayer::boundingBox(const RenderLayer* ancestorLayer, CalculateL
ayerBoundsFlags flags, const LayoutPoint* offsetFromRoot) const |
3317 { | 3312 { |
3318 LayoutRect result = localBoundingBox(flags); | 3313 LayoutRect result = localBoundingBox(flags); |
3319 if (renderer()->isBox()) | 3314 if (renderer()->isBox()) |
3320 renderBox()->flipForWritingMode(result); | 3315 renderBox()->flipForWritingMode(result); |
3321 else | 3316 else |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4033 } | 4028 } |
4034 } | 4029 } |
4035 | 4030 |
4036 void showLayerTree(const WebCore::RenderObject* renderer) | 4031 void showLayerTree(const WebCore::RenderObject* renderer) |
4037 { | 4032 { |
4038 if (!renderer) | 4033 if (!renderer) |
4039 return; | 4034 return; |
4040 showLayerTree(renderer->enclosingLayer()); | 4035 showLayerTree(renderer->enclosingLayer()); |
4041 } | 4036 } |
4042 #endif | 4037 #endif |
OLD | NEW |