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

Side by Side Diff: Source/platform/graphics/GraphicsLayer.cpp

Issue 134443003: Implement CSSOM Smooth Scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 else 1098 else
1099 m_layer->layer()->setScrollClient(this); 1099 m_layer->layer()->setScrollClient(this);
1100 } 1100 }
1101 1101
1102 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip) 1102 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip)
1103 { 1103 {
1104 paintGraphicsLayerContents(context, clip); 1104 paintGraphicsLayerContents(context, clip);
1105 } 1105 }
1106 1106
1107 1107
1108 void GraphicsLayer::notifyAnimationStarted(double monotonicTime, WebAnimation::T argetProperty) 1108 void GraphicsLayer::notifyAnimationStarted(double monotonicTime, WebAnimation::T argetProperty targetProperty)
1109 { 1109 {
1110 if (targetProperty == WebAnimation::TargetPropertyScrollOffset) {
1111 if (m_scrollableArea)
1112 m_scrollableArea->notifyAnimationStarted(monotonicTime);
1113 return;
1114 }
1110 if (m_client) 1115 if (m_client)
1111 m_client->notifyAnimationStarted(this, monotonicTime); 1116 m_client->notifyAnimationStarted(this, monotonicTime);
1112 } 1117 }
1113 1118
1114 void GraphicsLayer::notifyAnimationFinished(double, WebAnimation::TargetProperty ) 1119 void GraphicsLayer::notifyAnimationFinished(double monotonicTime, WebAnimation:: TargetProperty targetProperty)
1115 { 1120 {
1116 // Do nothing. 1121 if (targetProperty == WebAnimation::TargetPropertyScrollOffset && m_scrollab leArea) {
1122 m_scrollableArea->notifyAnimationFinished(monotonicTime);
1123 }
1117 } 1124 }
1118 1125
1119 void GraphicsLayer::didScroll() 1126 void GraphicsLayer::didScroll()
1120 { 1127 {
1121 if (m_scrollableArea) 1128 if (m_scrollableArea)
1122 m_scrollableArea->scrollToOffsetWithoutAnimation(m_scrollableArea->minim umScrollPosition() + toIntSize(m_layer->layer()->scrollPosition())); 1129 m_scrollableArea->scrollToOffsetWithoutAnimation(m_scrollableArea->minim umScrollPosition() + toIntSize(m_layer->layer()->scrollPosition()));
1123 } 1130 }
1124 1131
1125 } // namespace WebCore 1132 } // namespace WebCore
1126 1133
1127 #ifndef NDEBUG 1134 #ifndef NDEBUG
1128 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) 1135 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
1129 { 1136 {
1130 if (!layer) 1137 if (!layer)
1131 return; 1138 return;
1132 1139
1133 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); 1140 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo);
1134 fprintf(stderr, "%s\n", output.utf8().data()); 1141 fprintf(stderr, "%s\n", output.utf8().data());
1135 } 1142 }
1136 #endif 1143 #endif
OLDNEW
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/platform/scroll/ProgrammaticScrollAnimator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698