| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "core/html/HTMLFormElement.h" | 58 #include "core/html/HTMLFormElement.h" |
| 59 #include "core/html/HTMLPlugInElement.h" | 59 #include "core/html/HTMLPlugInElement.h" |
| 60 #include "core/loader/FormState.h" | 60 #include "core/loader/FormState.h" |
| 61 #include "core/loader/FrameLoadRequest.h" | 61 #include "core/loader/FrameLoadRequest.h" |
| 62 #include "core/page/FocusController.h" | 62 #include "core/page/FocusController.h" |
| 63 #include "core/page/Page.h" | 63 #include "core/page/Page.h" |
| 64 #include "core/page/scrolling/ScrollingCoordinator.h" | 64 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 65 #include "core/plugins/PluginOcclusionSupport.h" | 65 #include "core/plugins/PluginOcclusionSupport.h" |
| 66 #include "core/rendering/HitTestResult.h" | 66 #include "core/rendering/HitTestResult.h" |
| 67 #include "core/rendering/RenderBox.h" | 67 #include "core/rendering/RenderBox.h" |
| 68 #include "core/rendering/RenderLayer.h" |
| 68 #include "platform/HostWindow.h" | 69 #include "platform/HostWindow.h" |
| 69 #include "platform/KeyboardCodes.h" | 70 #include "platform/KeyboardCodes.h" |
| 70 #include "platform/PlatformGestureEvent.h" | 71 #include "platform/PlatformGestureEvent.h" |
| 71 #include "platform/UserGestureIndicator.h" | 72 #include "platform/UserGestureIndicator.h" |
| 72 #include "platform/graphics/GraphicsContext.h" | 73 #include "platform/graphics/GraphicsContext.h" |
| 73 #include "platform/graphics/GraphicsLayer.h" | 74 #include "platform/graphics/GraphicsLayer.h" |
| 74 #include "platform/scroll/ScrollAnimator.h" | 75 #include "platform/scroll/ScrollAnimator.h" |
| 75 #include "platform/scroll/ScrollView.h" | 76 #include "platform/scroll/ScrollView.h" |
| 76 #include "platform/scroll/ScrollbarTheme.h" | 77 #include "platform/scroll/ScrollbarTheme.h" |
| 77 #include "public/platform/Platform.h" | 78 #include "public/platform/Platform.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 if (!frame) | 282 if (!frame) |
| 282 return 1.0; | 283 return 1.0; |
| 283 return frame->pageZoomFactor(); | 284 return frame->pageZoomFactor(); |
| 284 } | 285 } |
| 285 | 286 |
| 286 void WebPluginContainerImpl::setWebLayer(WebLayer* layer) | 287 void WebPluginContainerImpl::setWebLayer(WebLayer* layer) |
| 287 { | 288 { |
| 288 if (m_webLayer == layer) | 289 if (m_webLayer == layer) |
| 289 return; | 290 return; |
| 290 | 291 |
| 291 // If anyone of the layers is null we need to switch between hardware | |
| 292 // and software compositing. | |
| 293 if (!m_webLayer || !layer) | |
| 294 m_element->scheduleSVGFilterLayerUpdateHack(); | |
| 295 if (m_webLayer) | 292 if (m_webLayer) |
| 296 GraphicsLayer::unregisterContentsLayer(m_webLayer); | 293 GraphicsLayer::unregisterContentsLayer(m_webLayer); |
| 297 if (layer) | 294 if (layer) |
| 298 GraphicsLayer::registerContentsLayer(layer); | 295 GraphicsLayer::registerContentsLayer(layer); |
| 296 |
| 297 // If anyone of the layers is null we need to switch between hardware |
| 298 // and software compositing. |
| 299 bool needsCompositingUpdate = !m_webLayer || !layer; |
| 300 |
| 299 m_webLayer = layer; | 301 m_webLayer = layer; |
| 302 |
| 303 if (!needsCompositingUpdate) |
| 304 return; |
| 305 |
| 306 m_element->setNeedsCompositingUpdate(); |
| 307 // Being composited or not affects the self painting layer bit |
| 308 // on the RenderLayer. |
| 309 if (RenderPart* renderer = m_element->renderPart()) { |
| 310 RELEASE_ASSERT(renderer->hasLayer()); |
| 311 renderer->layer()->updateSelfPaintingLayer(); |
| 312 } |
| 300 } | 313 } |
| 301 | 314 |
| 302 bool WebPluginContainerImpl::supportsPaginatedPrint() const | 315 bool WebPluginContainerImpl::supportsPaginatedPrint() const |
| 303 { | 316 { |
| 304 return m_webPlugin->supportsPaginatedPrint(); | 317 return m_webPlugin->supportsPaginatedPrint(); |
| 305 } | 318 } |
| 306 | 319 |
| 307 bool WebPluginContainerImpl::isPrintScalingDisabled() const | 320 bool WebPluginContainerImpl::isPrintScalingDisabled() const |
| 308 { | 321 { |
| 309 return m_webPlugin->isPrintScalingDisabled(); | 322 return m_webPlugin->isPrintScalingDisabled(); |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 | 908 |
| 896 return clipRect; | 909 return clipRect; |
| 897 } | 910 } |
| 898 | 911 |
| 899 bool WebPluginContainerImpl::pluginShouldPersist() const | 912 bool WebPluginContainerImpl::pluginShouldPersist() const |
| 900 { | 913 { |
| 901 return m_webPlugin->shouldPersist(); | 914 return m_webPlugin->shouldPersist(); |
| 902 } | 915 } |
| 903 | 916 |
| 904 } // namespace blink | 917 } // namespace blink |
| OLD | NEW |