| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include "core/dom/LayoutTreeBuilderTraversal.h" | 28 #include "core/dom/LayoutTreeBuilderTraversal.h" |
| 29 #include "core/dom/Node.h" | 29 #include "core/dom/Node.h" |
| 30 #include "core/frame/FrameView.h" | 30 #include "core/frame/FrameView.h" |
| 31 #include "core/frame/LocalFrame.h" | 31 #include "core/frame/LocalFrame.h" |
| 32 #include "core/layout/LayoutBoxModelObject.h" | 32 #include "core/layout/LayoutBoxModelObject.h" |
| 33 #include "core/layout/LayoutObject.h" | 33 #include "core/layout/LayoutObject.h" |
| 34 #include "core/layout/LayoutView.h" | 34 #include "core/layout/LayoutView.h" |
| 35 #include "core/layout/compositing/CompositedLayerMapping.h" | 35 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 36 #include "core/paint/PaintLayer.h" | 36 #include "core/paint/PaintLayer.h" |
| 37 #include "platform/CompositorFactory.h" |
| 37 #include "platform/RuntimeEnabledFeatures.h" | 38 #include "platform/RuntimeEnabledFeatures.h" |
| 39 #include "platform/animation/WebCompositorAnimationCurve.h" |
| 40 #include "platform/animation/WebFloatAnimationCurve.h" |
| 38 #include "platform/graphics/Color.h" | 41 #include "platform/graphics/Color.h" |
| 39 #include "platform/graphics/GraphicsLayer.h" | 42 #include "platform/graphics/GraphicsLayer.h" |
| 40 #include "platform/graphics/paint/DrawingRecorder.h" | 43 #include "platform/graphics/paint/DrawingRecorder.h" |
| 41 #include "public/platform/Platform.h" | 44 #include "public/platform/Platform.h" |
| 42 #include "public/platform/WebCompositorAnimationCurve.h" | |
| 43 #include "public/platform/WebCompositorSupport.h" | 45 #include "public/platform/WebCompositorSupport.h" |
| 44 #include "public/platform/WebContentLayer.h" | 46 #include "public/platform/WebContentLayer.h" |
| 45 #include "public/platform/WebDisplayItemList.h" | 47 #include "public/platform/WebDisplayItemList.h" |
| 46 #include "public/platform/WebFloatAnimationCurve.h" | |
| 47 #include "public/platform/WebFloatPoint.h" | 48 #include "public/platform/WebFloatPoint.h" |
| 48 #include "public/platform/WebLayer.h" | 49 #include "public/platform/WebLayer.h" |
| 49 #include "public/platform/WebRect.h" | 50 #include "public/platform/WebRect.h" |
| 50 #include "public/platform/WebSize.h" | 51 #include "public/platform/WebSize.h" |
| 51 #include "public/web/WebKit.h" | 52 #include "public/web/WebKit.h" |
| 52 #include "third_party/skia/include/core/SkCanvas.h" | 53 #include "third_party/skia/include/core/SkCanvas.h" |
| 53 #include "third_party/skia/include/core/SkPictureRecorder.h" | 54 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 54 #include "third_party/skia/include/utils/SkMatrix44.h" | 55 #include "third_party/skia/include/utils/SkMatrix44.h" |
| 55 #include "ui/gfx/geometry/rect.h" | 56 #include "ui/gfx/geometry/rect.h" |
| 56 #include "web/WebLocalFrameImpl.h" | 57 #include "web/WebLocalFrameImpl.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 m_isAnimating = true; | 290 m_isAnimating = true; |
| 290 const float startOpacity = 1; | 291 const float startOpacity = 1; |
| 291 // FIXME: Should duration be configurable? | 292 // FIXME: Should duration be configurable? |
| 292 const float fadeDuration = 0.1f; | 293 const float fadeDuration = 0.1f; |
| 293 const float minPreFadeDuration = 0.1f; | 294 const float minPreFadeDuration = 0.1f; |
| 294 | 295 |
| 295 m_contentLayer->layer()->setOpacity(startOpacity); | 296 m_contentLayer->layer()->setOpacity(startOpacity); |
| 296 | 297 |
| 297 WebCompositorSupport* compositorSupport = Platform::current()->compositorSup
port(); | 298 WebCompositorSupport* compositorSupport = Platform::current()->compositorSup
port(); |
| 298 | 299 |
| 299 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(compositorSupport->createFlo
atAnimationCurve()); | 300 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(CompositorFactory::current()
.createFloatAnimationCurve()); |
| 300 | 301 |
| 301 curve->add(WebFloatKeyframe(0, startOpacity)); | 302 curve->add(WebFloatKeyframe(0, startOpacity)); |
| 302 // Make sure we have displayed for at least minPreFadeDuration before starti
ng to fade out. | 303 // Make sure we have displayed for at least minPreFadeDuration before starti
ng to fade out. |
| 303 float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast
<float>(monotonicallyIncreasingTime() - m_startTime)); | 304 float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast
<float>(monotonicallyIncreasingTime() - m_startTime)); |
| 304 if (extraDurationRequired) | 305 if (extraDurationRequired) |
| 305 curve->add(WebFloatKeyframe(extraDurationRequired, startOpacity)); | 306 curve->add(WebFloatKeyframe(extraDurationRequired, startOpacity)); |
| 306 // For layout tests we don't fade out. | 307 // For layout tests we don't fade out. |
| 307 curve->add(WebFloatKeyframe(fadeDuration + extraDurationRequired, layoutTest
Mode() ? startOpacity : 0)); | 308 curve->add(WebFloatKeyframe(fadeDuration + extraDurationRequired, layoutTest
Mode() ? startOpacity : 0)); |
| 308 | 309 |
| 309 OwnPtr<WebCompositorAnimation> animation = adoptPtr(compositorSupport->creat
eAnimation(*curve, WebCompositorAnimation::TargetPropertyOpacity)); | 310 OwnPtr<WebCompositorAnimation> animation = adoptPtr(compositorSupport->creat
eAnimation(*curve, WebCompositorAnimation::TargetPropertyOpacity)); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 { | 382 { |
| 382 return clipLayer(); | 383 return clipLayer(); |
| 383 } | 384 } |
| 384 | 385 |
| 385 WebCompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const | 386 WebCompositorAnimationPlayer* LinkHighlightImpl::compositorPlayer() const |
| 386 { | 387 { |
| 387 return m_compositorPlayer.get(); | 388 return m_compositorPlayer.get(); |
| 388 } | 389 } |
| 389 | 390 |
| 390 } // namespace blink | 391 } // namespace blink |
| OLD | NEW |