Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(686)

Side by Side Diff: Source/web/LinkHighlight.cpp

Issue 412123002: Rename WebAnimation to WebCompositorAnimation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Set upstream branch Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 22 matching lines...) Expand all
33 #include "core/frame/LocalFrame.h" 33 #include "core/frame/LocalFrame.h"
34 #include "core/rendering/RenderLayer.h" 34 #include "core/rendering/RenderLayer.h"
35 #include "core/rendering/RenderLayerModelObject.h" 35 #include "core/rendering/RenderLayerModelObject.h"
36 #include "core/rendering/RenderObject.h" 36 #include "core/rendering/RenderObject.h"
37 #include "core/rendering/RenderPart.h" 37 #include "core/rendering/RenderPart.h"
38 #include "core/rendering/RenderView.h" 38 #include "core/rendering/RenderView.h"
39 #include "core/rendering/compositing/CompositedLayerMapping.h" 39 #include "core/rendering/compositing/CompositedLayerMapping.h"
40 #include "core/rendering/style/ShadowData.h" 40 #include "core/rendering/style/ShadowData.h"
41 #include "platform/graphics/Color.h" 41 #include "platform/graphics/Color.h"
42 #include "public/platform/Platform.h" 42 #include "public/platform/Platform.h"
43 #include "public/platform/WebAnimationCurve.h" 43 #include "public/platform/WebCompositorAnimationCurve.h"
44 #include "public/platform/WebCompositorSupport.h" 44 #include "public/platform/WebCompositorSupport.h"
45 #include "public/platform/WebFloatAnimationCurve.h" 45 #include "public/platform/WebFloatAnimationCurve.h"
46 #include "public/platform/WebFloatPoint.h" 46 #include "public/platform/WebFloatPoint.h"
47 #include "public/platform/WebRect.h" 47 #include "public/platform/WebRect.h"
48 #include "public/platform/WebSize.h" 48 #include "public/platform/WebSize.h"
49 #include "public/web/WebKit.h" 49 #include "public/web/WebKit.h"
50 #include "web/WebLocalFrameImpl.h" 50 #include "web/WebLocalFrameImpl.h"
51 #include "web/WebViewImpl.h" 51 #include "web/WebViewImpl.h"
52 #include "wtf/CurrentTime.h" 52 #include "wtf/CurrentTime.h"
53 53
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(compositorSupport->createFlo atAnimationCurve()); 282 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(compositorSupport->createFlo atAnimationCurve());
283 283
284 curve->add(WebFloatKeyframe(0, startOpacity)); 284 curve->add(WebFloatKeyframe(0, startOpacity));
285 // Make sure we have displayed for at least minPreFadeDuration before starti ng to fade out. 285 // Make sure we have displayed for at least minPreFadeDuration before starti ng to fade out.
286 float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast <float>(monotonicallyIncreasingTime() - m_startTime)); 286 float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast <float>(monotonicallyIncreasingTime() - m_startTime));
287 if (extraDurationRequired) 287 if (extraDurationRequired)
288 curve->add(WebFloatKeyframe(extraDurationRequired, startOpacity)); 288 curve->add(WebFloatKeyframe(extraDurationRequired, startOpacity));
289 // For layout tests we don't fade out. 289 // For layout tests we don't fade out.
290 curve->add(WebFloatKeyframe(fadeDuration + extraDurationRequired, blink::lay outTestMode() ? startOpacity : 0)); 290 curve->add(WebFloatKeyframe(fadeDuration + extraDurationRequired, blink::lay outTestMode() ? startOpacity : 0));
291 291
292 OwnPtr<WebAnimation> animation = adoptPtr(compositorSupport->createAnimation (*curve, WebAnimation::TargetPropertyOpacity)); 292 OwnPtr<WebCompositorAnimation> animation = adoptPtr(compositorSupport->creat eAnimation(*curve, WebCompositorAnimation::TargetPropertyOpacity));
293 293
294 m_contentLayer->layer()->setDrawsContent(true); 294 m_contentLayer->layer()->setDrawsContent(true);
295 m_contentLayer->layer()->addAnimation(animation.leakPtr()); 295 m_contentLayer->layer()->addAnimation(animation.leakPtr());
296 296
297 invalidate(); 297 invalidate();
298 m_owningWebViewImpl->scheduleAnimation(); 298 m_owningWebViewImpl->scheduleAnimation();
299 } 299 }
300 300
301 void LinkHighlight::clearGraphicsLayerLinkHighlightPointer() 301 void LinkHighlight::clearGraphicsLayerLinkHighlightPointer()
302 { 302 {
303 if (m_currentGraphicsLayer) { 303 if (m_currentGraphicsLayer) {
304 m_currentGraphicsLayer->removeLinkHighlight(this); 304 m_currentGraphicsLayer->removeLinkHighlight(this);
305 m_currentGraphicsLayer = 0; 305 m_currentGraphicsLayer = 0;
306 } 306 }
307 } 307 }
308 308
309 void LinkHighlight::notifyAnimationStarted(double, blink::WebAnimation::TargetPr operty) 309 void LinkHighlight::notifyAnimationStarted(double, blink::WebCompositorAnimation ::TargetProperty)
310 { 310 {
311 } 311 }
312 312
313 void LinkHighlight::notifyAnimationFinished(double, blink::WebAnimation::TargetP roperty) 313 void LinkHighlight::notifyAnimationFinished(double, blink::WebCompositorAnimatio n::TargetProperty)
314 { 314 {
315 // Since WebViewImpl may hang on to us for a while, make sure we 315 // Since WebViewImpl may hang on to us for a while, make sure we
316 // release resources as soon as possible. 316 // release resources as soon as possible.
317 clearGraphicsLayerLinkHighlightPointer(); 317 clearGraphicsLayerLinkHighlightPointer();
318 releaseResources(); 318 releaseResources();
319 } 319 }
320 320
321 void LinkHighlight::updateGeometry() 321 void LinkHighlight::updateGeometry()
322 { 322 {
323 // To avoid unnecessary updates (e.g. other entities have requested animatio ns from our WebViewImpl), 323 // To avoid unnecessary updates (e.g. other entities have requested animatio ns from our WebViewImpl),
(...skipping 28 matching lines...) Expand all
352 // Make sure we update geometry on the next callback from WebViewImpl::layou t(). 352 // Make sure we update geometry on the next callback from WebViewImpl::layou t().
353 m_geometryNeedsUpdate = true; 353 m_geometryNeedsUpdate = true;
354 } 354 }
355 355
356 WebLayer* LinkHighlight::layer() 356 WebLayer* LinkHighlight::layer()
357 { 357 {
358 return clipLayer(); 358 return clipLayer();
359 } 359 }
360 360
361 } // namespace WeKit 361 } // namespace WeKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698