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 4148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4273 void WebViewImpl::scheduleAnimation() | 4274 void WebViewImpl::scheduleAnimation() |
4274 { | 4275 { |
4275 if (m_layerTreeView) { | 4276 if (m_layerTreeView) { |
4276 m_layerTreeView->setNeedsBeginFrame(); | 4277 m_layerTreeView->setNeedsBeginFrame(); |
4277 return; | 4278 return; |
4278 } | 4279 } |
4279 if (m_client) | 4280 if (m_client) |
4280 m_client->scheduleAnimation(); | 4281 m_client->scheduleAnimation(); |
4281 } | 4282 } |
4282 | 4283 |
4283 void WebViewImpl::attachCompositorAnimationTimeline(WebCompositorAnimationTimeli
ne* timeline) | 4284 void WebViewImpl::attachCompositorAnimationTimeline(CompositorAnimationTimeline*
timeline) |
4284 { | 4285 { |
4285 if (m_layerTreeView) | 4286 if (m_layerTreeView) |
4286 m_layerTreeView->attachCompositorAnimationTimeline(timeline); | 4287 m_layerTreeView->attachCompositorAnimationTimeline(timeline->animationTi
meline()); |
4287 } | 4288 } |
4288 | 4289 |
4289 void WebViewImpl::detachCompositorAnimationTimeline(WebCompositorAnimationTimeli
ne* timeline) | 4290 void WebViewImpl::detachCompositorAnimationTimeline(CompositorAnimationTimeline*
timeline) |
4290 { | 4291 { |
4291 if (m_layerTreeView) | 4292 if (m_layerTreeView) |
4292 m_layerTreeView->detachCompositorAnimationTimeline(timeline); | 4293 m_layerTreeView->detachCompositorAnimationTimeline(timeline->animationTi
meline()); |
4293 } | 4294 } |
4294 | 4295 |
4295 void WebViewImpl::initializeLayerTreeView() | 4296 void WebViewImpl::initializeLayerTreeView() |
4296 { | 4297 { |
4297 if (m_client) { | 4298 if (m_client) { |
4298 m_client->initializeLayerTreeView(); | 4299 m_client->initializeLayerTreeView(); |
4299 m_layerTreeView = m_client->layerTreeView(); | 4300 m_layerTreeView = m_client->layerTreeView(); |
4300 } | 4301 } |
4301 | 4302 |
4302 if (WebDevToolsAgentImpl* devTools = mainFrameDevToolsAgentImpl()) | 4303 if (WebDevToolsAgentImpl* devTools = mainFrameDevToolsAgentImpl()) |
4303 devTools->layerTreeViewChanged(m_layerTreeView); | 4304 devTools->layerTreeViewChanged(m_layerTreeView); |
4304 | 4305 |
4305 m_page->settings().setAcceleratedCompositingEnabled(m_layerTreeView); | 4306 m_page->settings().setAcceleratedCompositingEnabled(m_layerTreeView); |
4306 if (m_layerTreeView) | 4307 if (m_layerTreeView) |
4307 m_page->layerTreeViewInitialized(*m_layerTreeView); | 4308 m_page->layerTreeViewInitialized(*m_layerTreeView); |
4308 | 4309 |
4309 // FIXME: only unittests, click to play, Android printing, and printing (for
headers and footers) | 4310 // FIXME: only unittests, click to play, Android printing, and printing (for
headers and footers) |
4310 // make this assert necessary. We should make them not hit this code and the
n delete allowsBrokenNullLayerTreeView. | 4311 // make this assert necessary. We should make them not hit this code and the
n delete allowsBrokenNullLayerTreeView. |
4311 ASSERT(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeVi
ew()); | 4312 ASSERT(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeVi
ew()); |
4312 | 4313 |
4313 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor
m::current()->isThreadedAnimationEnabled() && m_layerTreeView) { | 4314 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor
m::current()->isThreadedAnimationEnabled() && m_layerTreeView) { |
4314 ASSERT(Platform::current()->compositorSupport()); | 4315 m_linkHighlightsTimeline = adoptPtr(CompositorFactory::current().createA
nimationTimeline()); |
4315 m_linkHighlightsTimeline = adoptPtr(Platform::current()->compositorSuppo
rt()->createAnimationTimeline()); | |
4316 attachCompositorAnimationTimeline(m_linkHighlightsTimeline.get()); | 4316 attachCompositorAnimationTimeline(m_linkHighlightsTimeline.get()); |
4317 } | 4317 } |
4318 | 4318 |
4319 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 4319 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
4320 attachPaintArtifactCompositor(); | 4320 attachPaintArtifactCompositor(); |
4321 } | 4321 } |
4322 | 4322 |
4323 void WebViewImpl::applyViewportDeltas( | 4323 void WebViewImpl::applyViewportDeltas( |
4324 const WebFloatSize& visualViewportDelta, | 4324 const WebFloatSize& visualViewportDelta, |
4325 const WebFloatSize& layoutViewportDelta, | 4325 const WebFloatSize& layoutViewportDelta, |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4563 { | 4563 { |
4564 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4564 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4565 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4565 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4566 if (!page()) | 4566 if (!page()) |
4567 return 1; | 4567 return 1; |
4568 | 4568 |
4569 return page()->deviceScaleFactor(); | 4569 return page()->deviceScaleFactor(); |
4570 } | 4570 } |
4571 | 4571 |
4572 } // namespace blink | 4572 } // namespace blink |
OLD | NEW |