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 22 matching lines...) Expand all Loading... |
33 #include "core/frame/RemoteFrame.h" | 33 #include "core/frame/RemoteFrame.h" |
34 #include "core/html/HTMLCanvasElement.h" | 34 #include "core/html/HTMLCanvasElement.h" |
35 #include "core/html/HTMLIFrameElement.h" | 35 #include "core/html/HTMLIFrameElement.h" |
36 #include "core/html/HTMLMediaElement.h" | 36 #include "core/html/HTMLMediaElement.h" |
37 #include "core/html/HTMLVideoElement.h" | 37 #include "core/html/HTMLVideoElement.h" |
38 #include "core/html/canvas/CanvasRenderingContext.h" | 38 #include "core/html/canvas/CanvasRenderingContext.h" |
39 #include "core/inspector/InspectorInstrumentation.h" | 39 #include "core/inspector/InspectorInstrumentation.h" |
40 #include "core/inspector/InspectorNodeIds.h" | 40 #include "core/inspector/InspectorNodeIds.h" |
41 #include "core/layout/FilterEffectRenderer.h" | 41 #include "core/layout/FilterEffectRenderer.h" |
42 #include "core/layout/LayerStackingNodeIterator.h" | 42 #include "core/layout/LayerStackingNodeIterator.h" |
| 43 #include "core/layout/LayoutImage.h" |
43 #include "core/layout/LayoutVideo.h" | 44 #include "core/layout/LayoutVideo.h" |
44 #include "core/layout/compositing/LayerCompositor.h" | 45 #include "core/layout/compositing/LayerCompositor.h" |
45 #include "core/layout/style/KeyframeList.h" | 46 #include "core/layout/style/KeyframeList.h" |
46 #include "core/page/Chrome.h" | 47 #include "core/page/Chrome.h" |
47 #include "core/page/ChromeClient.h" | 48 #include "core/page/ChromeClient.h" |
48 #include "core/page/Page.h" | 49 #include "core/page/Page.h" |
49 #include "core/page/scrolling/ScrollingCoordinator.h" | 50 #include "core/page/scrolling/ScrollingCoordinator.h" |
50 #include "core/paint/LayerPainter.h" | 51 #include "core/paint/LayerPainter.h" |
51 #include "core/paint/ScrollableAreaPainter.h" | 52 #include "core/paint/ScrollableAreaPainter.h" |
52 #include "core/paint/TransformRecorder.h" | 53 #include "core/paint/TransformRecorder.h" |
53 #include "core/plugins/PluginView.h" | 54 #include "core/plugins/PluginView.h" |
54 #include "core/rendering/RenderEmbeddedObject.h" | 55 #include "core/rendering/RenderEmbeddedObject.h" |
55 #include "core/rendering/RenderImage.h" | |
56 #include "core/rendering/RenderPart.h" | 56 #include "core/rendering/RenderPart.h" |
57 #include "core/rendering/RenderView.h" | 57 #include "core/rendering/RenderView.h" |
58 #include "platform/LengthFunctions.h" | 58 #include "platform/LengthFunctions.h" |
59 #include "platform/RuntimeEnabledFeatures.h" | 59 #include "platform/RuntimeEnabledFeatures.h" |
60 #include "platform/fonts/FontCache.h" | 60 #include "platform/fonts/FontCache.h" |
61 #include "platform/geometry/TransformState.h" | 61 #include "platform/geometry/TransformState.h" |
62 #include "platform/graphics/GraphicsContext.h" | 62 #include "platform/graphics/GraphicsContext.h" |
63 #include "platform/graphics/paint/ClipDisplayItem.h" | 63 #include "platform/graphics/paint/ClipDisplayItem.h" |
64 #include "platform/graphics/paint/DisplayItemList.h" | 64 #include "platform/graphics/paint/DisplayItemList.h" |
65 #include "platform/graphics/paint/TransformDisplayItem.h" | 65 #include "platform/graphics/paint/TransformDisplayItem.h" |
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1850 // An image can be directly compositing if it's the sole content of the layer, a
nd has no box decorations | 1850 // An image can be directly compositing if it's the sole content of the layer, a
nd has no box decorations |
1851 // that require painting. Direct compositing saves backing store. | 1851 // that require painting. Direct compositing saves backing store. |
1852 bool CompositedLayerMapping::isDirectlyCompositedImage() const | 1852 bool CompositedLayerMapping::isDirectlyCompositedImage() const |
1853 { | 1853 { |
1854 ASSERT(renderer()->isImage()); | 1854 ASSERT(renderer()->isImage()); |
1855 | 1855 |
1856 LayoutObject* layoutObject = renderer(); | 1856 LayoutObject* layoutObject = renderer(); |
1857 if (m_owningLayer.hasBoxDecorationsOrBackground() || layoutObject->hasClip()
|| layoutObject->hasClipPath()) | 1857 if (m_owningLayer.hasBoxDecorationsOrBackground() || layoutObject->hasClip()
|| layoutObject->hasClipPath()) |
1858 return false; | 1858 return false; |
1859 | 1859 |
1860 RenderImage* imageRenderer = toRenderImage(layoutObject); | 1860 LayoutImage* imageRenderer = toLayoutImage(layoutObject); |
1861 if (ImageResource* cachedImage = imageRenderer->cachedImage()) { | 1861 if (ImageResource* cachedImage = imageRenderer->cachedImage()) { |
1862 if (!cachedImage->hasImage()) | 1862 if (!cachedImage->hasImage()) |
1863 return false; | 1863 return false; |
1864 | 1864 |
1865 Image* image = cachedImage->imageForRenderer(imageRenderer); | 1865 Image* image = cachedImage->imageForRenderer(imageRenderer); |
1866 return image->isBitmapImage(); | 1866 return image->isBitmapImage(); |
1867 } | 1867 } |
1868 | 1868 |
1869 return false; | 1869 return false; |
1870 } | 1870 } |
1871 | 1871 |
1872 void CompositedLayerMapping::contentChanged(ContentChangeType changeType) | 1872 void CompositedLayerMapping::contentChanged(ContentChangeType changeType) |
1873 { | 1873 { |
1874 if ((changeType == ImageChanged) && renderer()->isImage() && isDirectlyCompo
sitedImage()) { | 1874 if ((changeType == ImageChanged) && renderer()->isImage() && isDirectlyCompo
sitedImage()) { |
1875 updateImageContents(); | 1875 updateImageContents(); |
1876 return; | 1876 return; |
1877 } | 1877 } |
1878 | 1878 |
1879 if (changeType == CanvasChanged && isAcceleratedCanvas(renderer())) { | 1879 if (changeType == CanvasChanged && isAcceleratedCanvas(renderer())) { |
1880 m_graphicsLayer->setContentsNeedsDisplay(); | 1880 m_graphicsLayer->setContentsNeedsDisplay(); |
1881 return; | 1881 return; |
1882 } | 1882 } |
1883 } | 1883 } |
1884 | 1884 |
1885 void CompositedLayerMapping::updateImageContents() | 1885 void CompositedLayerMapping::updateImageContents() |
1886 { | 1886 { |
1887 ASSERT(renderer()->isImage()); | 1887 ASSERT(renderer()->isImage()); |
1888 RenderImage* imageRenderer = toRenderImage(renderer()); | 1888 LayoutImage* imageRenderer = toLayoutImage(renderer()); |
1889 | 1889 |
1890 ImageResource* cachedImage = imageRenderer->cachedImage(); | 1890 ImageResource* cachedImage = imageRenderer->cachedImage(); |
1891 if (!cachedImage) | 1891 if (!cachedImage) |
1892 return; | 1892 return; |
1893 | 1893 |
1894 Image* image = cachedImage->imageForRenderer(imageRenderer); | 1894 Image* image = cachedImage->imageForRenderer(imageRenderer); |
1895 if (!image) | 1895 if (!image) |
1896 return; | 1896 return; |
1897 | 1897 |
1898 // We have to wait until the image is fully loaded before setting it on the
layer. | 1898 // We have to wait until the image is fully loaded before setting it on the
layer. |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2356 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2356 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2357 name = "Scrolling Block Selection Layer"; | 2357 name = "Scrolling Block Selection Layer"; |
2358 } else { | 2358 } else { |
2359 ASSERT_NOT_REACHED(); | 2359 ASSERT_NOT_REACHED(); |
2360 } | 2360 } |
2361 | 2361 |
2362 return name; | 2362 return name; |
2363 } | 2363 } |
2364 | 2364 |
2365 } // namespace blink | 2365 } // namespace blink |
OLD | NEW |