Changeset 147145 in webkit
- Timestamp:
- Mar 28, 2013 12:59:07 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r147144 r147145 1 2013-03-28 ChangSeok Oh <changseok.oh@collabora.com> 2 3 [GTK][AC] Use transform property of ClutterActor 4 https://bugs.webkit.org/show_bug.cgi?id=113317 5 6 Reviewed by Gustavo Noronha Silva. 7 8 ClutterActor has a transform property to set transformation matrix directly 9 since version 1.12. So we don't need to keep and use the matrix property of GraphicsLayerActor. 10 11 No new tests because of no functionality change. 12 13 * platform/graphics/clutter/GraphicsLayerActor.cpp: 14 (_GraphicsLayerActorPrivate): 15 (graphicsLayerActorDispose): 16 (graphicsLayerActorApplyTransform): 17 * platform/graphics/clutter/GraphicsLayerActor.h: 18 * platform/graphics/clutter/GraphicsLayerClutter.cpp: 19 (WebCore::GraphicsLayerClutter::updateTransform): 20 * platform/graphics/clutter/PlatformClutterAnimation.cpp: 21 (WebCore::PlatformClutterAnimation::addTransformTransition): 22 1 23 2013-03-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 24 -
trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.cpp
r147121 r147145 42 42 43 43 RefPtr<cairo_surface_t> surface; 44 CoglMatrix* matrix;45 44 46 45 PlatformClutterLayerClient* layerClient; … … 151 150 priv->surface.clear(); 152 151 153 if (priv->matrix)154 cogl_matrix_free(priv->matrix);155 156 152 G_OBJECT_CLASS(graphics_layer_actor_parent_class)->dispose(object); 157 153 } … … 208 204 209 205 CLUTTER_ACTOR_CLASS(graphics_layer_actor_parent_class)->apply_transform(actor, matrix); 210 211 if (priv->matrix) {212 float width = 0, height = 0;213 clutter_actor_get_size(actor, &width, &height);214 if (width <= 1.0 || height <= 1.0)215 return;216 217 // The pivot of actor is a normalized value, so we need an actual anchor position218 // in actor's local coordinate system for translating.219 float anchorX = 0, anchorY = 0, anchorZ = 0;220 graphicsLayerActorGetAnchorPoint(GRAPHICS_LAYER_ACTOR(actor), &anchorX, &anchorY, &anchorZ);221 anchorX *= width;222 anchorY *= height;223 224 // CSS3 tranform-style can be changed on the fly,225 // so we have to copy priv->matrix in order to recover z-axis.226 CoglMatrix* localMatrix = cogl_matrix_copy(priv->matrix);227 228 cogl_matrix_translate(matrix, anchorX, anchorY, anchorZ);229 cogl_matrix_multiply(matrix, matrix, localMatrix);230 cogl_matrix_translate(matrix, -anchorX, -anchorY, -anchorZ);231 cogl_matrix_free(localMatrix);232 }233 206 } 234 207 … … 381 354 // FIXME: Need to invalidate a specific area? 382 355 clutter_content_invalidate(canvas); 383 }384 385 void graphicsLayerActorSetTransform(GraphicsLayerActor* layer, const CoglMatrix* matrix)386 {387 bool needToRedraw = false;388 389 GraphicsLayerActorPrivate* priv = layer->priv;390 if (priv->matrix) {391 cogl_matrix_free(priv->matrix);392 needToRedraw = true;393 }394 395 if (matrix && !cogl_matrix_is_identity(matrix)) {396 priv->matrix = cogl_matrix_copy(matrix);397 needToRedraw = true;398 } else399 priv->matrix = 0;400 401 if (needToRedraw)402 clutter_actor_queue_redraw(CLUTTER_ACTOR(layer));403 356 } 404 357 -
trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.h
r142094 r147145 82 82 void graphicsLayerActorSetSurface(GraphicsLayerActor*, cairo_surface_t*); 83 83 void graphicsLayerActorInvalidateRectangle(GraphicsLayerActor*, const WebCore::FloatRect&); 84 void graphicsLayerActorSetTransform(GraphicsLayerActor*, const CoglMatrix*);85 84 void graphicsLayerActorSetAnchorPoint(GraphicsLayerActor*, float, float, float); 86 85 void graphicsLayerActorGetAnchorPoint(GraphicsLayerActor*, float*, float*, float*); -
trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp
r147121 r147145 679 679 { 680 680 CoglMatrix matrix = m_transform; 681 graphicsLayerActorSetTransform(primaryLayer(), &matrix);681 clutter_actor_set_transform(CLUTTER_ACTOR(primaryLayer()), &matrix); 682 682 } 683 683 -
trunk/Source/WebCore/platform/graphics/clutter/PlatformClutterAnimation.cpp
r146609 r147145 612 612 } 613 613 614 // If clutter covers valueFunction type animations, we should release keeping transform matrix.615 // Otherwise, the transformation is applied twice unexpectedly. See graphicsLayerActorApplyTransform.616 graphicsLayerActorSetTransform(GRAPHICS_LAYER_ACTOR(m_layer.get()), 0);614 // FIXME: Work-around the fact that if there is a transform already set the animation fails to start. 615 // https://bugzilla.gnome.org/show_bug.cgi?id=696804 616 clutter_actor_set_transform(m_layer.get(), 0); 617 617 } 618 618
Note: See TracChangeset
for help on using the changeset viewer.