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 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 if (renderObject->node() && renderObject->node()->isDocumentNode()) { | 1689 if (renderObject->node() && renderObject->node()->isDocumentNode()) { |
1690 // Look to see if the root object has a non-simple background | 1690 // Look to see if the root object has a non-simple background |
1691 RenderObject* rootObject = renderObject->document().documentElement() ?
renderObject->document().documentElement()->renderer() : 0; | 1691 RenderObject* rootObject = renderObject->document().documentElement() ?
renderObject->document().documentElement()->renderer() : 0; |
1692 // Reject anything that has a border, a border-radius or outline, | 1692 // Reject anything that has a border, a border-radius or outline, |
1693 // or is not a simple background (no background, or solid color). | 1693 // or is not a simple background (no background, or solid color). |
1694 if (rootObject && hasBoxDecorationsOrBackgroundImage(rootObject->style()
)) | 1694 if (rootObject && hasBoxDecorationsOrBackgroundImage(rootObject->style()
)) |
1695 return true; | 1695 return true; |
1696 | 1696 |
1697 // Now look at the body's renderer. | 1697 // Now look at the body's renderer. |
1698 HTMLElement* body = renderObject->document().body(); | 1698 HTMLElement* body = renderObject->document().body(); |
1699 RenderObject* bodyObject = (body && body->hasLocalName(bodyTag)) ? body-
>renderer() : 0; | 1699 RenderObject* bodyObject = isHTMLBodyElement(body) ? body->renderer() :
0; |
1700 if (bodyObject && hasBoxDecorationsOrBackgroundImage(bodyObject->style()
)) | 1700 if (bodyObject && hasBoxDecorationsOrBackgroundImage(bodyObject->style()
)) |
1701 return true; | 1701 return true; |
1702 } | 1702 } |
1703 | 1703 |
1704 // FIXME: it's O(n^2). A better solution is needed. | 1704 // FIXME: it's O(n^2). A better solution is needed. |
1705 return paintsChildren(); | 1705 return paintsChildren(); |
1706 } | 1706 } |
1707 | 1707 |
1708 // An image can be directly compositing if it's the sole content of the layer, a
nd has no box decorations | 1708 // An image can be directly compositing if it's the sole content of the layer, a
nd has no box decorations |
1709 // that require painting. Direct compositing saves backing store. | 1709 // that require painting. Direct compositing saves backing store. |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2250 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2250 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2251 name = "Scrolling Block Selection Layer"; | 2251 name = "Scrolling Block Selection Layer"; |
2252 } else { | 2252 } else { |
2253 ASSERT_NOT_REACHED(); | 2253 ASSERT_NOT_REACHED(); |
2254 } | 2254 } |
2255 | 2255 |
2256 return name; | 2256 return name; |
2257 } | 2257 } |
2258 | 2258 |
2259 } // namespace blink | 2259 } // namespace blink |
OLD | NEW |