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 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 m_ninePatchLayer->setBitmap(bitmap); | 1042 m_ninePatchLayer->setBitmap(bitmap); |
1043 m_ninePatchLayer->setAperture(aperture); | 1043 m_ninePatchLayer->setAperture(aperture); |
1044 m_ninePatchLayer->setBorder(border); | 1044 m_ninePatchLayer->setBorder(border); |
1045 | 1045 |
1046 m_ninePatchLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque(
)); | 1046 m_ninePatchLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque(
)); |
1047 registerContentsLayer(m_ninePatchLayer->layer()); | 1047 registerContentsLayer(m_ninePatchLayer->layer()); |
1048 } | 1048 } |
1049 setContentsTo(m_ninePatchLayer ? m_ninePatchLayer->layer() : 0); | 1049 setContentsTo(m_ninePatchLayer ? m_ninePatchLayer->layer() : 0); |
1050 } | 1050 } |
1051 | 1051 |
1052 bool GraphicsLayer::addAnimation(PassOwnPtr<WebCompositorAnimation> popAnimation
) | |
1053 { | |
1054 OwnPtr<WebCompositorAnimation> animation(popAnimation); | |
1055 ASSERT(animation); | |
1056 platformLayer()->setAnimationDelegate(this); | |
1057 | |
1058 // Remove any existing animations with the same animation id and target prop
erty. | |
1059 platformLayer()->removeAnimation(animation->id(), animation->targetProperty(
)); | |
1060 return platformLayer()->addAnimation(animation.leakPtr()); | |
1061 } | |
1062 | |
1063 void GraphicsLayer::pauseAnimation(int animationId, double timeOffset) | |
1064 { | |
1065 platformLayer()->pauseAnimation(animationId, timeOffset); | |
1066 } | |
1067 | |
1068 void GraphicsLayer::removeAnimation(int animationId) | |
1069 { | |
1070 platformLayer()->removeAnimation(animationId); | |
1071 } | |
1072 | |
1073 WebLayer* GraphicsLayer::platformLayer() const | 1052 WebLayer* GraphicsLayer::platformLayer() const |
1074 { | 1053 { |
1075 return m_layer->layer(); | 1054 return m_layer->layer(); |
1076 } | 1055 } |
1077 | 1056 |
1078 void GraphicsLayer::setFilters(const FilterOperations& filters) | 1057 void GraphicsLayer::setFilters(const FilterOperations& filters) |
1079 { | 1058 { |
1080 SkiaImageFilterBuilder builder; | 1059 SkiaImageFilterBuilder builder; |
1081 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compo
sitorSupport()->createFilterOperations()); | 1060 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compo
sitorSupport()->createFilterOperations()); |
1082 FilterOutsets outsets = filters.outsets(); | 1061 FilterOutsets outsets = filters.outsets(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 else | 1106 else |
1128 m_layer->layer()->setScrollClient(this); | 1107 m_layer->layer()->setScrollClient(this); |
1129 } | 1108 } |
1130 | 1109 |
1131 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip) | 1110 void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip) |
1132 { | 1111 { |
1133 paintGraphicsLayerContents(context, clip); | 1112 paintGraphicsLayerContents(context, clip); |
1134 } | 1113 } |
1135 | 1114 |
1136 | 1115 |
1137 void GraphicsLayer::notifyAnimationStarted(double monotonicTime, int group) | |
1138 { | |
1139 if (m_client) | |
1140 m_client->notifyAnimationStarted(this, monotonicTime, group); | |
1141 } | |
1142 | |
1143 void GraphicsLayer::notifyAnimationFinished(double, int group) | |
1144 { | |
1145 if (m_scrollableArea) | |
1146 m_scrollableArea->notifyCompositorAnimationFinished(group); | |
1147 } | |
1148 | |
1149 void GraphicsLayer::didScroll() | 1116 void GraphicsLayer::didScroll() |
1150 { | 1117 { |
1151 if (m_scrollableArea) { | 1118 if (m_scrollableArea) { |
1152 DoublePoint newPosition = m_scrollableArea->minimumScrollPosition() + to
DoubleSize(m_layer->layer()->scrollPositionDouble()); | 1119 DoublePoint newPosition = m_scrollableArea->minimumScrollPosition() + to
DoubleSize(m_layer->layer()->scrollPositionDouble()); |
1153 bool cancelProgrammaticAnimations = false; | 1120 bool cancelProgrammaticAnimations = false; |
1154 // FIXME: Remove the toFloatPoint(). crbug.com/414283. | 1121 // FIXME: Remove the toFloatPoint(). crbug.com/414283. |
1155 m_scrollableArea->scrollToOffsetWithoutAnimation(toFloatPoint(newPositio
n), cancelProgrammaticAnimations); | 1122 m_scrollableArea->scrollToOffsetWithoutAnimation(toFloatPoint(newPositio
n), cancelProgrammaticAnimations); |
1156 } | 1123 } |
1157 } | 1124 } |
1158 | 1125 |
(...skipping 11 matching lines...) Expand all Loading... |
1170 #ifndef NDEBUG | 1137 #ifndef NDEBUG |
1171 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) | 1138 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) |
1172 { | 1139 { |
1173 if (!layer) | 1140 if (!layer) |
1174 return; | 1141 return; |
1175 | 1142 |
1176 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1143 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1177 fprintf(stderr, "%s\n", output.utf8().data()); | 1144 fprintf(stderr, "%s\n", output.utf8().data()); |
1178 } | 1145 } |
1179 #endif | 1146 #endif |
OLD | NEW |