| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 #include "platform/NotImplemented.h" | 105 #include "platform/NotImplemented.h" |
| 106 #include "platform/PlatformGestureEvent.h" | 106 #include "platform/PlatformGestureEvent.h" |
| 107 #include "platform/PlatformKeyboardEvent.h" | 107 #include "platform/PlatformKeyboardEvent.h" |
| 108 #include "platform/PlatformMouseEvent.h" | 108 #include "platform/PlatformMouseEvent.h" |
| 109 #include "platform/RuntimeEnabledFeatures.h" | 109 #include "platform/RuntimeEnabledFeatures.h" |
| 110 #include "platform/TraceEvent.h" | 110 #include "platform/TraceEvent.h" |
| 111 #include "platform/UserGestureIndicator.h" | 111 #include "platform/UserGestureIndicator.h" |
| 112 #include "platform/exported/WebActiveGestureAnimation.h" | 112 #include "platform/exported/WebActiveGestureAnimation.h" |
| 113 #include "platform/fonts/FontCache.h" | 113 #include "platform/fonts/FontCache.h" |
| 114 #include "platform/graphics/Color.h" | 114 #include "platform/graphics/Color.h" |
| 115 #include "platform/graphics/CompositorFactory.h" |
| 115 #include "platform/graphics/FirstPaintInvalidationTracking.h" | 116 #include "platform/graphics/FirstPaintInvalidationTracking.h" |
| 116 #include "platform/graphics/GraphicsContext.h" | 117 #include "platform/graphics/GraphicsContext.h" |
| 117 #include "platform/graphics/Image.h" | 118 #include "platform/graphics/Image.h" |
| 118 #include "platform/graphics/ImageBuffer.h" | 119 #include "platform/graphics/ImageBuffer.h" |
| 119 #include "platform/graphics/gpu/DrawingBuffer.h" | 120 #include "platform/graphics/gpu/DrawingBuffer.h" |
| 120 #include "platform/graphics/paint/DrawingRecorder.h" | 121 #include "platform/graphics/paint/DrawingRecorder.h" |
| 121 #include "platform/scroll/ScrollbarTheme.h" | 122 #include "platform/scroll/ScrollbarTheme.h" |
| 122 #include "platform/weborigin/SchemeRegistry.h" | 123 #include "platform/weborigin/SchemeRegistry.h" |
| 123 #include "public/platform/Platform.h" | 124 #include "public/platform/Platform.h" |
| 124 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" | 125 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" |
| (...skipping 4149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4274 void WebViewImpl::scheduleAnimation() | 4275 void WebViewImpl::scheduleAnimation() |
| 4275 { | 4276 { |
| 4276 if (m_layerTreeView) { | 4277 if (m_layerTreeView) { |
| 4277 m_layerTreeView->setNeedsBeginFrame(); | 4278 m_layerTreeView->setNeedsBeginFrame(); |
| 4278 return; | 4279 return; |
| 4279 } | 4280 } |
| 4280 if (m_client) | 4281 if (m_client) |
| 4281 m_client->scheduleAnimation(); | 4282 m_client->scheduleAnimation(); |
| 4282 } | 4283 } |
| 4283 | 4284 |
| 4284 void WebViewImpl::attachCompositorAnimationTimeline(WebCompositorAnimationTimeli
ne* timeline) | 4285 void WebViewImpl::attachCompositorAnimationTimeline(CompositorAnimationTimeline*
timeline) |
| 4285 { | 4286 { |
| 4286 if (m_layerTreeView) | 4287 if (m_layerTreeView) |
| 4287 m_layerTreeView->attachCompositorAnimationTimeline(timeline); | 4288 m_layerTreeView->attachCompositorAnimationTimeline(timeline->animationTi
meline()); |
| 4288 } | 4289 } |
| 4289 | 4290 |
| 4290 void WebViewImpl::detachCompositorAnimationTimeline(WebCompositorAnimationTimeli
ne* timeline) | 4291 void WebViewImpl::detachCompositorAnimationTimeline(CompositorAnimationTimeline*
timeline) |
| 4291 { | 4292 { |
| 4292 if (m_layerTreeView) | 4293 if (m_layerTreeView) |
| 4293 m_layerTreeView->detachCompositorAnimationTimeline(timeline); | 4294 m_layerTreeView->detachCompositorAnimationTimeline(timeline->animationTi
meline()); |
| 4294 } | 4295 } |
| 4295 | 4296 |
| 4296 void WebViewImpl::initializeLayerTreeView() | 4297 void WebViewImpl::initializeLayerTreeView() |
| 4297 { | 4298 { |
| 4298 if (m_client) { | 4299 if (m_client) { |
| 4299 m_client->initializeLayerTreeView(); | 4300 m_client->initializeLayerTreeView(); |
| 4300 m_layerTreeView = m_client->layerTreeView(); | 4301 m_layerTreeView = m_client->layerTreeView(); |
| 4301 } | 4302 } |
| 4302 | 4303 |
| 4303 if (WebDevToolsAgentImpl* devTools = mainFrameDevToolsAgentImpl()) | 4304 if (WebDevToolsAgentImpl* devTools = mainFrameDevToolsAgentImpl()) |
| 4304 devTools->layerTreeViewChanged(m_layerTreeView); | 4305 devTools->layerTreeViewChanged(m_layerTreeView); |
| 4305 | 4306 |
| 4306 m_page->settings().setAcceleratedCompositingEnabled(m_layerTreeView); | 4307 m_page->settings().setAcceleratedCompositingEnabled(m_layerTreeView); |
| 4307 if (m_layerTreeView) | 4308 if (m_layerTreeView) |
| 4308 m_page->layerTreeViewInitialized(*m_layerTreeView); | 4309 m_page->layerTreeViewInitialized(*m_layerTreeView); |
| 4309 | 4310 |
| 4310 // FIXME: only unittests, click to play, Android printing, and printing (for
headers and footers) | 4311 // FIXME: only unittests, click to play, Android printing, and printing (for
headers and footers) |
| 4311 // make this assert necessary. We should make them not hit this code and the
n delete allowsBrokenNullLayerTreeView. | 4312 // make this assert necessary. We should make them not hit this code and the
n delete allowsBrokenNullLayerTreeView. |
| 4312 ASSERT(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeVi
ew()); | 4313 ASSERT(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeVi
ew()); |
| 4313 | 4314 |
| 4314 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor
m::current()->isThreadedAnimationEnabled() && m_layerTreeView) { | 4315 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor
m::current()->isThreadedAnimationEnabled() && m_layerTreeView) { |
| 4315 ASSERT(Platform::current()->compositorSupport()); | 4316 m_linkHighlightsTimeline = adoptPtr(CompositorFactory::current().createA
nimationTimeline()); |
| 4316 m_linkHighlightsTimeline = adoptPtr(Platform::current()->compositorSuppo
rt()->createAnimationTimeline()); | |
| 4317 attachCompositorAnimationTimeline(m_linkHighlightsTimeline.get()); | 4317 attachCompositorAnimationTimeline(m_linkHighlightsTimeline.get()); |
| 4318 } | 4318 } |
| 4319 | 4319 |
| 4320 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 4320 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 4321 attachPaintArtifactCompositor(); | 4321 attachPaintArtifactCompositor(); |
| 4322 } | 4322 } |
| 4323 | 4323 |
| 4324 void WebViewImpl::applyViewportDeltas( | 4324 void WebViewImpl::applyViewportDeltas( |
| 4325 const WebFloatSize& visualViewportDelta, | 4325 const WebFloatSize& visualViewportDelta, |
| 4326 const WebFloatSize& layoutViewportDelta, | 4326 const WebFloatSize& layoutViewportDelta, |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4564 { | 4564 { |
| 4565 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4565 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4566 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4566 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4567 if (!page()) | 4567 if (!page()) |
| 4568 return 1; | 4568 return 1; |
| 4569 | 4569 |
| 4570 return page()->deviceScaleFactor(); | 4570 return page()->deviceScaleFactor(); |
| 4571 } | 4571 } |
| 4572 | 4572 |
| 4573 } // namespace blink | 4573 } // namespace blink |
| OLD | NEW |