Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1206 else | 1206 else |
| 1207 m_layer->layer()->setScrollClient(this); | 1207 m_layer->layer()->setScrollClient(this); |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip) | 1210 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip) |
| 1211 { | 1211 { |
| 1212 paintGraphicsLayerContents(context, clip); | 1212 paintGraphicsLayerContents(context, clip); |
| 1213 } | 1213 } |
| 1214 | 1214 |
| 1215 | 1215 |
| 1216 void GraphicsLayer::notifyAnimationStarted(double wallClockTime, double monotoni cTime, WebAnimation::TargetProperty) | 1216 void GraphicsLayer::notifyAnimationStarted(double wallClockTime, double monotoni cTime, WebAnimation::TargetProperty targetProperty) |
| 1217 { | 1217 { |
| 1218 if (targetProperty == WebAnimation::TargetPropertyScrollOffset) { | |
| 1219 if (m_scrollableArea) | |
| 1220 m_scrollableArea->notifyAnimationStarted(monotonicTime); | |
| 1221 return; | |
| 1222 } | |
| 1223 | |
| 1218 if (m_client) | 1224 if (m_client) |
| 1219 m_client->notifyAnimationStarted(this, wallClockTime, monotonicTime); | 1225 m_client->notifyAnimationStarted(this, wallClockTime, monotonicTime); |
| 1220 } | 1226 } |
| 1221 | 1227 |
| 1222 void GraphicsLayer::notifyAnimationFinished(double, double, WebAnimation::Target Property) | 1228 void GraphicsLayer::notifyAnimationFinished(double wallClockTime, double monoton icTime, WebAnimation::TargetProperty targetProperty) |
| 1223 { | 1229 { |
| 1224 // Do nothing. | 1230 if (targetProperty == WebAnimation::TargetPropertyScrollOffset && m_scrollab leArea) |
| 1231 m_scrollableArea->notifyAnimationStarted(monotonicTime); | |
|
Ian Vollick
2014/02/06 16:02:31
Hmm. This is confusing at a glance. Could you add
| |
| 1225 } | 1232 } |
| 1226 | 1233 |
| 1227 void GraphicsLayer::didScroll() | 1234 void GraphicsLayer::didScroll() |
| 1228 { | 1235 { |
| 1229 if (m_scrollableArea) | 1236 if (m_scrollableArea) |
| 1230 m_scrollableArea->scrollToOffsetWithoutAnimation(m_scrollableArea->minim umScrollPosition() + toIntSize(m_layer->layer()->scrollPosition())); | 1237 m_scrollableArea->scrollToOffsetWithoutAnimation(m_scrollableArea->minim umScrollPosition() + toIntSize(m_layer->layer()->scrollPosition())); |
| 1231 } | 1238 } |
| 1232 | 1239 |
| 1233 } // namespace WebCore | 1240 } // namespace WebCore |
| 1234 | 1241 |
| 1235 #ifndef NDEBUG | 1242 #ifndef NDEBUG |
| 1236 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) | 1243 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) |
| 1237 { | 1244 { |
| 1238 if (!layer) | 1245 if (!layer) |
| 1239 return; | 1246 return; |
| 1240 | 1247 |
| 1241 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); | 1248 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); |
| 1242 fprintf(stderr, "%s\n", output.utf8().data()); | 1249 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1243 } | 1250 } |
| 1244 #endif | 1251 #endif |
| OLD | NEW |