Diff
Modified: trunk/Source/WebCore/ChangeLog (149280 => 149281)
--- trunk/Source/WebCore/ChangeLog 2013-04-29 14:26:09 UTC (rev 149280)
+++ trunk/Source/WebCore/ChangeLog 2013-04-29 14:36:31 UTC (rev 149281)
@@ -1,3 +1,27 @@
+2013-04-29 ChangSeok Oh <[email protected]>
+
+ [GTK][AC] Clean up code related with the children management stuff for clutter based AC
+ https://bugs.webkit.org/show_bug.cgi?id=114260
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Remove unused or usless code for children management stuff.
+
+ No new tests since no functionality changed.
+
+ * platform/graphics/clutter/GraphicsLayerActor.cpp:
+ (_GraphicsLayerActorPrivate):
+ (graphics_layer_actor_class_init):
+ (graphicsLayerActorAllocate):
+ (graphicsLayerActorDraw):
+ (graphicsLayerActorNew):
+ (graphicsLayerActorSetSublayers):
+ * platform/graphics/clutter/GraphicsLayerActor.h:
+ * platform/graphics/clutter/GraphicsLayerClutter.cpp:
+ (WebCore::idleDestroy):
+ (WebCore::GraphicsLayerClutter::ensureStructuralLayer):
+ (WebCore::GraphicsLayerClutter::updateLayerDrawsContent):
+
2013-04-29 Patrick Gansterer <[email protected]>
[WIN] Guard cfHDropFormat() with USE(CF) instead of OS(WINCE)
Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.cpp (149280 => 149281)
--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.cpp 2013-04-29 14:26:09 UTC (rev 149280)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.cpp 2013-04-29 14:36:31 UTC (rev 149281)
@@ -40,12 +40,10 @@
#define GRAPHICS_LAYER_ACTOR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GRAPHICS_LAYER_TYPE_ACTOR, GraphicsLayerActorPrivate))
struct _GraphicsLayerActorPrivate {
- GraphicsLayerClutter::LayerType layerType;
- gboolean allocating;
-
+ PlatformClutterLayerClient* layerClient;
RefPtr<cairo_surface_t> surface;
- PlatformClutterLayerClient* layerClient;
+ GraphicsLayerClutter::LayerType layerType;
bool flatten;
bool drawsContent;
@@ -85,8 +83,9 @@
objectClass->get_property = graphicsLayerActorGetProperty;
objectClass->set_property = graphicsLayerActorSetProperty;
objectClass->dispose = graphicsLayerActorDispose;
- actorClass->apply_transform = graphicsLayerActorApplyTransform;
+
actorClass->allocate = graphicsLayerActorAllocate;
+ actorClass->apply_transform = graphicsLayerActorApplyTransform;
actorClass->paint = graphicsLayerActorPaint;
g_type_class_add_private(klass, sizeof(GraphicsLayerActorPrivate));
@@ -158,11 +157,6 @@
static void graphicsLayerActorAllocate(ClutterActor* self, const ClutterActorBox* box, ClutterAllocationFlags flags)
{
- GraphicsLayerActor* layer = GRAPHICS_LAYER_ACTOR(self);
- GraphicsLayerActorPrivate* priv = layer->priv;
-
- priv->allocating = TRUE;
-
CLUTTER_ACTOR_CLASS(graphics_layer_actor_parent_class)->allocate(self, box, flags);
ClutterContent* canvas = clutter_actor_get_content(self);
@@ -186,8 +180,6 @@
clutter_actor_allocate(childActor, &childBox, flags);
}
-
- priv->allocating = FALSE;
}
static void graphicsLayerActorApplyTransform(ClutterActor* actor, CoglMatrix* matrix)
@@ -224,10 +216,10 @@
if (!width || !height)
return FALSE;
- GraphicsLayerActorPrivate* priv = layer->priv;
GraphicsContext context(cr);
context.clearRect(FloatRect(0, 0, width, height));
+ GraphicsLayerActorPrivate* priv = layer->priv;
if (priv->surface) {
gint surfaceWidth = cairo_image_surface_get_width(priv->surface.get());
gint surfaceHeight = cairo_image_surface_get_height(priv->surface.get());
@@ -286,8 +278,7 @@
priv->layerClient->platformClutterLayerPaintContents(context, clip);
}
-
-GraphicsLayerActor* graphicsLayerActorNew(GraphicsLayerClutter::LayerType type)
+static GraphicsLayerActor* graphicsLayerActorNew(GraphicsLayerClutter::LayerType type)
{
GraphicsLayerActor* layer = GRAPHICS_LAYER_ACTOR(g_object_new(GRAPHICS_LAYER_TYPE_ACTOR, 0));
GraphicsLayerActorPrivate* priv = layer->priv;
@@ -317,20 +308,6 @@
return layer->priv->layerClient;
}
-void graphicsLayerActorRemoveAll(GraphicsLayerActor* layer)
-{
- g_return_if_fail(GRAPHICS_LAYER_IS_ACTOR(layer));
-
- clutter_actor_remove_all_children(CLUTTER_ACTOR(layer));
-}
-
-cairo_surface_t* graphicsLayerActorGetSurface(GraphicsLayerActor* layer)
-{
- GraphicsLayerActorPrivate* priv = layer->priv;
- ASSERT(priv->surface);
- return priv->surface.get();
-}
-
void graphicsLayerActorSetSurface(GraphicsLayerActor* layer, cairo_surface_t* surface)
{
GraphicsLayerActorPrivate* priv = layer->priv;
@@ -355,16 +332,6 @@
clutter_actor_set_pivot_point_z(actor, z);
}
-void graphicsLayerActorGetAnchorPoint(GraphicsLayerActor* layer, float* x, float* y, float* z)
-{
- ASSERT(x && y);
-
- ClutterActor* actor = CLUTTER_ACTOR(layer);
- clutter_actor_get_pivot_point(actor, x, y);
- if (z)
- *z = clutter_actor_get_pivot_point_z(actor);
-}
-
void graphicsLayerActorSetScrollPosition(GraphicsLayerActor* layer, float x, float y)
{
if (x > 0 || y > 0)
@@ -377,34 +344,10 @@
clutter_actor_queue_redraw(CLUTTER_ACTOR(layer));
}
-gint graphicsLayerActorGetnChildren(GraphicsLayerActor* layer)
-{
- ASSERT(GRAPHICS_LAYER_IS_ACTOR(layer));
-
- return clutter_actor_get_n_children(CLUTTER_ACTOR(layer));
-}
-
-void graphicsLayerActorReplaceSublayer(GraphicsLayerActor* layer, ClutterActor* oldChildLayer, ClutterActor* newChildLayer)
-{
- ASSERT(GRAPHICS_LAYER_IS_ACTOR(layer));
- ASSERT(CLUTTER_IS_ACTOR(oldChildLayer));
- ASSERT(CLUTTER_IS_ACTOR(newChildLayer));
-
- clutter_actor_replace_child(CLUTTER_ACTOR(layer), oldChildLayer, newChildLayer);
-}
-
-void graphicsLayerActorInsertSublayer(GraphicsLayerActor* layer, ClutterActor* childLayer, gint index)
-{
- ASSERT(GRAPHICS_LAYER_IS_ACTOR(layer));
- ASSERT(CLUTTER_IS_ACTOR(childLayer));
-
- clutter_actor_insert_child_at_index(CLUTTER_ACTOR(layer), childLayer, index);
-}
-
void graphicsLayerActorSetSublayers(GraphicsLayerActor* layer, GraphicsLayerActorList& subLayers)
{
- if (!subLayers.size()) {
- graphicsLayerActorRemoveAll(layer);
+ if (subLayers.isEmpty()) {
+ clutter_actor_remove_all_children(CLUTTER_ACTOR(layer));
return;
}
@@ -481,11 +424,6 @@
graphicsLayerActorUpdateTexture(layer);
}
-gboolean graphicsLayerActorGetDrawsContent(GraphicsLayerActor* layer)
-{
- return layer->priv->drawsContent;
-}
-
void graphicsLayerActorSetFlatten(GraphicsLayerActor* layer, bool flatten)
{
GraphicsLayerActorPrivate* priv = layer->priv;
Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.h (149280 => 149281)
--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.h 2013-04-29 14:26:09 UTC (rev 149280)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerActor.h 2013-04-29 14:36:31 UTC (rev 149281)
@@ -17,8 +17,8 @@
*
*/
-#ifndef GraphicsLayerActor_h
-#define GraphicsLayerActor_h
+#ifndef GraphicsLayerActor_h
+#define GraphicsLayerActor_h
#if USE(ACCELERATED_COMPOSITING)
@@ -72,31 +72,29 @@
GType graphics_layer_actor_get_type(void) G_GNUC_CONST;
-GraphicsLayerActor* graphicsLayerActorNew(WebCore::GraphicsLayerClutter::LayerType);
GraphicsLayerActor* graphicsLayerActorNewWithClient(WebCore::GraphicsLayerClutter::LayerType, WebCore::PlatformClutterLayerClient*);
-void graphicsLayerActorSetClient(GraphicsLayerActor*, WebCore::PlatformClutterLayerClient*);
+
+WebCore::GraphicsLayerClutter::LayerType graphicsLayerActorGetLayerType(GraphicsLayerActor*);
+void graphicsLayerActorSetLayerType(GraphicsLayerActor*, WebCore::GraphicsLayerClutter::LayerType);
+
WebCore::PlatformClutterLayerClient* graphicsLayerActorGetClient(GraphicsLayerActor*);
-void graphicsLayerActorRemoveAll(GraphicsLayerActor*);
-cairo_surface_t* graphicsLayerActorGetSurface(GraphicsLayerActor*);
-void graphicsLayerActorSetSurface(GraphicsLayerActor*, cairo_surface_t*);
+void graphicsLayerActorSetClient(GraphicsLayerActor*, WebCore::PlatformClutterLayerClient*);
+
void graphicsLayerActorInvalidateRectangle(GraphicsLayerActor*, const WebCore::FloatRect&);
-void graphicsLayerActorSetAnchorPoint(GraphicsLayerActor*, float, float, float);
-void graphicsLayerActorGetAnchorPoint(GraphicsLayerActor*, float*, float*, float*);
void graphicsLayerActorSetScrollPosition(GraphicsLayerActor*, float, float);
void graphicsLayerActorSetTranslateX(GraphicsLayerActor*, float);
float graphicsLayerActorGetTranslateX(GraphicsLayerActor*);
void graphicsLayerActorSetTranslateY(GraphicsLayerActor*, float);
float graphicsLayerActorGetTranslateY(GraphicsLayerActor*);
-gint graphicsLayerActorGetnChildren(GraphicsLayerActor*);
+
void graphicsLayerActorRemoveFromSuperLayer(GraphicsLayerActor*);
-WebCore::GraphicsLayerClutter::LayerType graphicsLayerActorGetLayerType(GraphicsLayerActor*);
-void graphicsLayerActorSetLayerType(GraphicsLayerActor*, WebCore::GraphicsLayerClutter::LayerType);
-void graphicsLayerActorReplaceSublayer(GraphicsLayerActor*, ClutterActor*, ClutterActor*);
-void graphicsLayerActorSetSublayers(GraphicsLayerActor*, WebCore::GraphicsLayerActorList&);
-gboolean graphicsLayerActorGetDrawsContent(GraphicsLayerActor*);
+
+void graphicsLayerActorSetAnchorPoint(GraphicsLayerActor*, float, float, float);
void graphicsLayerActorSetDrawsContent(GraphicsLayerActor*, bool drawsContent);
void graphicsLayerActorSetFlatten(GraphicsLayerActor*, bool flatten);
void graphicsLayerActorSetMasksToBounds(GraphicsLayerActor*, bool masksToBounds);
+void graphicsLayerActorSetSublayers(GraphicsLayerActor*, WebCore::GraphicsLayerActorList&);
+void graphicsLayerActorSetSurface(GraphicsLayerActor*, cairo_surface_t*);
WebCore::PlatformClutterAnimation* graphicsLayerActorGetAnimationForKey(GraphicsLayerActor*, const String);
Modified: trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp (149280 => 149281)
--- trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp 2013-04-29 14:26:09 UTC (rev 149280)
+++ trunk/Source/WebCore/platform/graphics/clutter/GraphicsLayerClutter.cpp 2013-04-29 14:36:31 UTC (rev 149281)
@@ -22,7 +22,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
@@ -264,10 +264,10 @@
GRefPtr<ClutterActor> actor = adoptGRef(CLUTTER_ACTOR(data));
ClutterActor* parent = clutter_actor_get_parent(actor.get());
- // We should remove child actors manually because the container of Clutter
- // seems to have a bug to remove its child actors when it is removed.
+ // We should remove child actors manually because the container of Clutter
+ // seems to have a bug to remove its child actors when it is removed.
if (GRAPHICS_LAYER_IS_ACTOR(GRAPHICS_LAYER_ACTOR(actor.get())))
- graphicsLayerActorRemoveAll(GRAPHICS_LAYER_ACTOR(actor.get()));
+ clutter_actor_remove_all_children(actor.get());
if (parent)
clutter_actor_remove_child(parent, actor.get());
@@ -902,7 +902,7 @@
// is likely hosted by something that is not expecting to be changed
ClutterActor* parentActor = clutter_actor_get_parent(CLUTTER_ACTOR(m_structuralLayer.get()));
ASSERT(parentActor);
- graphicsLayerActorReplaceSublayer(GRAPHICS_LAYER_ACTOR(parentActor), CLUTTER_ACTOR(m_structuralLayer.get()), CLUTTER_ACTOR(m_layer.get()));
+ clutter_actor_replace_child(parentActor, CLUTTER_ACTOR(m_structuralLayer.get()), CLUTTER_ACTOR(m_layer.get()));
moveOrCopyAnimations(Move, m_structuralLayer.get(), m_layer.get());
@@ -966,13 +966,12 @@
void GraphicsLayerClutter::updateLayerDrawsContent(float pageScaleFactor, const FloatPoint& positionRelativeToBase)
{
- if (m_drawsContent) {
- graphicsLayerActorSetDrawsContent(m_layer.get(), TRUE);
+ graphicsLayerActorSetDrawsContent(m_layer.get(), m_drawsContent);
+
+ if (m_drawsContent)
setNeedsDisplay();
- } else {
- graphicsLayerActorSetDrawsContent(m_layer.get(), FALSE);
+ else
graphicsLayerActorSetSurface(m_layer.get(), 0);
- }
updateDebugIndicators();
}