tagging audio streams and changing audio sink to pulseaudio
[profile/ivi/webkit-efl.git] / Source / WebCore / platform / graphics / GraphicsLayer.cpp
1 /*
2  * Copyright (C) 2009 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24  */
25
26 #include "config.h"
27
28 #if USE(ACCELERATED_COMPOSITING)
29
30 #include "GraphicsLayer.h"
31
32 #include "FloatPoint.h"
33 #include "GraphicsContext.h"
34 #include "LayoutTypes.h"
35 #include "RotateTransformOperation.h"
36 #include "TextStream.h"
37 #include <wtf/text/CString.h>
38 #include <wtf/text/WTFString.h>
39
40 #ifndef NDEBUG
41 #include <stdio.h>
42 #endif
43
44 namespace WebCore {
45
46 void KeyframeValueList::insert(const AnimationValue* value)
47 {
48     for (size_t i = 0; i < m_values.size(); ++i) {
49         const AnimationValue* curValue = m_values[i];
50         if (curValue->keyTime() == value->keyTime()) {
51             ASSERT_NOT_REACHED();
52             // insert after
53             m_values.insert(i + 1, value);
54             return;
55         }
56         if (curValue->keyTime() > value->keyTime()) {
57             // insert before
58             m_values.insert(i, value);
59             return;
60         }
61     }
62     
63     m_values.append(value);
64 }
65
66 GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
67     : m_client(client)
68     , m_anchorPoint(0.5f, 0.5f, 0)
69     , m_opacity(1)
70     , m_zPosition(0)
71     , m_backgroundColorSet(false)
72     , m_contentsOpaque(false)
73     , m_preserves3D(false)
74     , m_backfaceVisibility(true)
75     , m_usingTiledLayer(false)
76     , m_masksToBounds(false)
77     , m_drawsContent(false)
78     , m_contentsVisible(true)
79     , m_acceleratesDrawing(false)
80     , m_maintainsPixelAlignment(false)
81     , m_appliesPageScale(false)
82     , m_usingTileCache(false)
83     , m_paintingPhase(GraphicsLayerPaintAll)
84     , m_contentsOrientation(CompositingCoordinatesTopDown)
85     , m_parent(0)
86     , m_maskLayer(0)
87     , m_replicaLayer(0)
88     , m_replicatedLayer(0)
89     , m_repaintCount(0)
90 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_SCROLLBAR)
91     , m_isScrollbar(false)
92 #endif
93 {
94 #ifndef NDEBUG
95     if (m_client)
96         m_client->verifyNotPainting();
97 #endif
98 }
99
100 GraphicsLayer::~GraphicsLayer()
101 {
102     ASSERT(!m_parent); // willBeDestroyed should have been called already.
103 }
104
105 void GraphicsLayer::willBeDestroyed()
106 {
107 #ifndef NDEBUG
108     if (m_client)
109         m_client->verifyNotPainting();
110 #endif
111
112     if (m_replicaLayer)
113         m_replicaLayer->setReplicatedLayer(0);
114
115     if (m_replicatedLayer)
116         m_replicatedLayer->setReplicatedByLayer(0);
117
118     removeAllChildren();
119     removeFromParent();
120 }
121
122 void GraphicsLayer::setParent(GraphicsLayer* layer)
123 {
124     ASSERT(!layer || !layer->hasAncestor(this));
125     m_parent = layer;
126 }
127
128 bool GraphicsLayer::hasAncestor(GraphicsLayer* ancestor) const
129 {
130     for (GraphicsLayer* curr = parent(); curr; curr = curr->parent()) {
131         if (curr == ancestor)
132             return true;
133     }
134     
135     return false;
136 }
137
138 bool GraphicsLayer::setChildren(const Vector<GraphicsLayer*>& newChildren)
139 {
140     // If the contents of the arrays are the same, nothing to do.
141     if (newChildren == m_children)
142         return false;
143
144     removeAllChildren();
145     
146     size_t listSize = newChildren.size();
147     for (size_t i = 0; i < listSize; ++i)
148         addChild(newChildren[i]);
149     
150     return true;
151 }
152
153 void GraphicsLayer::addChild(GraphicsLayer* childLayer)
154 {
155     ASSERT(childLayer != this);
156     
157     if (childLayer->parent())
158         childLayer->removeFromParent();
159
160     childLayer->setParent(this);
161     m_children.append(childLayer);
162 }
163
164 void GraphicsLayer::addChildAtIndex(GraphicsLayer* childLayer, int index)
165 {
166     ASSERT(childLayer != this);
167
168     if (childLayer->parent())
169         childLayer->removeFromParent();
170
171     childLayer->setParent(this);
172     m_children.insert(index, childLayer);
173 }
174
175 void GraphicsLayer::addChildBelow(GraphicsLayer* childLayer, GraphicsLayer* sibling)
176 {
177     ASSERT(childLayer != this);
178     childLayer->removeFromParent();
179
180     bool found = false;
181     for (unsigned i = 0; i < m_children.size(); i++) {
182         if (sibling == m_children[i]) {
183             m_children.insert(i, childLayer);
184             found = true;
185             break;
186         }
187     }
188
189     childLayer->setParent(this);
190
191     if (!found)
192         m_children.append(childLayer);
193 }
194
195 void GraphicsLayer::addChildAbove(GraphicsLayer* childLayer, GraphicsLayer* sibling)
196 {
197     childLayer->removeFromParent();
198     ASSERT(childLayer != this);
199
200     bool found = false;
201     for (unsigned i = 0; i < m_children.size(); i++) {
202         if (sibling == m_children[i]) {
203             m_children.insert(i+1, childLayer);
204             found = true;
205             break;
206         }
207     }
208
209     childLayer->setParent(this);
210
211     if (!found)
212         m_children.append(childLayer);
213 }
214
215 bool GraphicsLayer::replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild)
216 {
217     ASSERT(!newChild->parent());
218     bool found = false;
219     for (unsigned i = 0; i < m_children.size(); i++) {
220         if (oldChild == m_children[i]) {
221             m_children[i] = newChild;
222             found = true;
223             break;
224         }
225     }
226     if (found) {
227         oldChild->setParent(0);
228
229         newChild->removeFromParent();
230         newChild->setParent(this);
231         return true;
232     }
233     return false;
234 }
235
236 void GraphicsLayer::removeAllChildren()
237 {
238     while (m_children.size()) {
239         GraphicsLayer* curLayer = m_children[0];
240         ASSERT(curLayer->parent());
241         curLayer->removeFromParent();
242     }
243 }
244
245 void GraphicsLayer::removeFromParent()
246 {
247     if (m_parent) {
248         unsigned i;
249         for (i = 0; i < m_parent->m_children.size(); i++) {
250             if (this == m_parent->m_children[i]) {
251                 m_parent->m_children.remove(i);
252                 break;
253             }
254         }
255
256         setParent(0);
257     }
258 }
259
260 void GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants()
261 {
262     deviceOrPageScaleFactorChanged();
263
264     if (m_maskLayer)
265         m_maskLayer->deviceOrPageScaleFactorChanged();
266
267     if (m_replicaLayer)
268         m_replicaLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
269
270     const Vector<GraphicsLayer*>& childLayers = children();
271     size_t numChildren = childLayers.size();
272     for (size_t i = 0; i < numChildren; ++i)
273         childLayers[i]->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
274 }
275
276 void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer)
277 {
278     if (m_replicaLayer == layer)
279         return;
280
281     if (m_replicaLayer)
282         m_replicaLayer->setReplicatedLayer(0);
283
284     if (layer)
285         layer->setReplicatedLayer(this);
286
287     m_replicaLayer = layer;
288 }
289
290 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
291 void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset, const bool needToDisplay)
292 #else
293 void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset)
294 #endif
295 {
296     if (offset == m_offsetFromRenderer)
297         return;
298
299     m_offsetFromRenderer = offset;
300
301 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
302     if (needToDisplay)
303 #endif
304     // If the compositing layer offset changes, we need to repaint.
305     setNeedsDisplay();
306 }
307
308 void GraphicsLayer::setBackgroundColor(const Color& color)
309 {
310     m_backgroundColor = color;
311     m_backgroundColorSet = true;
312 }
313
314 void GraphicsLayer::clearBackgroundColor()
315 {
316     m_backgroundColor = Color();
317     m_backgroundColorSet = false;
318 }
319
320 void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const IntRect& clip)
321 {
322     if (m_client) {
323         LayoutSize offset = offsetFromRenderer();
324         context.translate(-offset);
325
326         LayoutRect clipRect(clip);
327         clipRect.move(offset);
328
329         m_client->paintContents(this, context, m_paintingPhase, pixelSnappedIntRect(clipRect));
330     }
331 }
332
333 String GraphicsLayer::animationNameForTransition(AnimatedPropertyID property)
334 {
335     // | is not a valid identifier character in CSS, so this can never conflict with a keyframe identifier.
336     String id = "-|transition";
337     id.append(static_cast<char>(property));
338     id.append('-');
339     return id;
340 }
341
342 void GraphicsLayer::suspendAnimations(double)
343 {
344 }
345
346 void GraphicsLayer::resumeAnimations()
347 {
348 }
349
350 void GraphicsLayer::updateDebugIndicators()
351 {
352     if (GraphicsLayer::showDebugBorders()) {
353         if (drawsContent()) {
354             if (m_usingTileCache) // tile cache layer: dark blue
355                 setDebugBorder(Color(0, 0, 128, 128), 0.5);
356             else if (m_usingTiledLayer)
357                 setDebugBorder(Color(255, 128, 0, 128), 2); // tiled layer: orange
358             else
359                 setDebugBorder(Color(0, 128, 32, 128), 2); // normal layer: green
360         } else if (masksToBounds()) {
361             setDebugBorder(Color(128, 255, 255, 48), 20); // masking layer: pale blue
362         } else
363             setDebugBorder(Color(255, 255, 0, 192), 2); // container: yellow
364     }
365 }
366
367 void GraphicsLayer::setZPosition(float position)
368 {
369     m_zPosition = position;
370 }
371
372 float GraphicsLayer::accumulatedOpacity() const
373 {
374     if (!preserves3D())
375         return 1;
376         
377     return m_opacity * (parent() ? parent()->accumulatedOpacity() : 1);
378 }
379
380 void GraphicsLayer::distributeOpacity(float accumulatedOpacity)
381 {
382     // If this is a transform layer we need to distribute our opacity to all our children
383     
384     // Incoming accumulatedOpacity is the contribution from our parent(s). We mutiply this by our own
385     // opacity to get the total contribution
386     accumulatedOpacity *= m_opacity;
387     
388     setOpacityInternal(accumulatedOpacity);
389     
390     if (preserves3D()) {
391         size_t numChildren = children().size();
392         for (size_t i = 0; i < numChildren; ++i)
393             children()[i]->distributeOpacity(accumulatedOpacity);
394     }
395 }
396
397 #if PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
398 GraphicsLayer::GraphicsLayerFactory* GraphicsLayer::s_graphicsLayerFactory = 0;
399
400 void GraphicsLayer::setGraphicsLayerFactory(GraphicsLayer::GraphicsLayerFactory factory)
401 {
402     s_graphicsLayerFactory = factory;
403 }
404 #endif
405
406 #if ENABLE(CSS_FILTERS)
407 static inline const FilterOperations* filterOperationsAt(const KeyframeValueList& valueList, size_t index)
408 {
409     return static_cast<const FilterAnimationValue*>(valueList.at(index))->value();
410 }
411
412 int GraphicsLayer::validateFilterOperations(const KeyframeValueList& valueList)
413 {
414     ASSERT(valueList.property() == AnimatedPropertyWebkitFilter);
415
416     if (valueList.size() < 2)
417         return -1;
418
419     // Empty filters match anything, so find the first non-empty entry as the reference
420     size_t firstIndex = 0;
421     for ( ; firstIndex < valueList.size(); ++firstIndex) {
422         if (filterOperationsAt(valueList, firstIndex)->operations().size() > 0)
423             break;
424     }
425
426     if (firstIndex >= valueList.size())
427         return -1;
428
429     const FilterOperations* firstVal = filterOperationsAt(valueList, firstIndex);
430     
431     for (size_t i = firstIndex + 1; i < valueList.size(); ++i) {
432         const FilterOperations* val = filterOperationsAt(valueList, i);
433         
434         // An emtpy filter list matches anything.
435         if (val->operations().isEmpty())
436             continue;
437         
438         if (!firstVal->operationsMatch(*val))
439             return -1;
440     }
441     
442     return firstIndex;
443 }
444 #endif
445
446 // An "invalid" list is one whose functions don't match, and therefore has to be animated as a Matrix
447 // The hasBigRotation flag will always return false if isValid is false. Otherwise hasBigRotation is 
448 // true if the rotation between any two keyframes is >= 180 degrees.
449
450 static inline const TransformOperations* operationsAt(const KeyframeValueList& valueList, size_t index)
451 {
452     return static_cast<const TransformAnimationValue*>(valueList.at(index))->value();
453 }
454
455 int GraphicsLayer::validateTransformOperations(const KeyframeValueList& valueList, bool& hasBigRotation)
456 {
457     ASSERT(valueList.property() == AnimatedPropertyWebkitTransform);
458
459     hasBigRotation = false;
460     
461     if (valueList.size() < 2)
462         return -1;
463     
464     // Empty transforms match anything, so find the first non-empty entry as the reference.
465     size_t firstIndex = 0;
466     for ( ; firstIndex < valueList.size(); ++firstIndex) {
467         if (operationsAt(valueList, firstIndex)->operations().size() > 0)
468             break;
469     }
470     
471     if (firstIndex >= valueList.size())
472         return -1;
473         
474     const TransformOperations* firstVal = operationsAt(valueList, firstIndex);
475     
476     // See if the keyframes are valid.
477     for (size_t i = firstIndex + 1; i < valueList.size(); ++i) {
478         const TransformOperations* val = operationsAt(valueList, i);
479         
480         // An emtpy transform list matches anything.
481         if (val->operations().isEmpty())
482             continue;
483             
484         if (!firstVal->operationsMatch(*val))
485             return -1;
486     }
487
488     // Keyframes are valid, check for big rotations.    
489     double lastRotAngle = 0.0;
490     double maxRotAngle = -1.0;
491         
492     for (size_t j = 0; j < firstVal->operations().size(); ++j) {
493         TransformOperation::OperationType type = firstVal->operations().at(j)->getOperationType();
494         
495         // if this is a rotation entry, we need to see if any angle differences are >= 180 deg
496         if (type == TransformOperation::ROTATE_X ||
497             type == TransformOperation::ROTATE_Y ||
498             type == TransformOperation::ROTATE_Z ||
499             type == TransformOperation::ROTATE_3D) {
500             lastRotAngle = static_cast<RotateTransformOperation*>(firstVal->operations().at(j).get())->angle();
501             
502             if (maxRotAngle < 0)
503                 maxRotAngle = fabs(lastRotAngle);
504             
505             for (size_t i = firstIndex + 1; i < valueList.size(); ++i) {
506                 const TransformOperations* val = operationsAt(valueList, i);
507                 double rotAngle = val->operations().isEmpty() ? 0 : (static_cast<RotateTransformOperation*>(val->operations().at(j).get())->angle());
508                 double diffAngle = fabs(rotAngle - lastRotAngle);
509                 if (diffAngle > maxRotAngle)
510                     maxRotAngle = diffAngle;
511                 lastRotAngle = rotAngle;
512             }
513         }
514     }
515     
516     hasBigRotation = maxRotAngle >= 180.0;
517     
518     return firstIndex;
519 }
520
521 double GraphicsLayer::backingStoreMemoryEstimate() const
522 {
523     if (!drawsContent())
524         return 0;
525     
526     // Effects of page and device scale are ignored; subclasses should override to take these into account.
527     return static_cast<double>(4 * size().width()) * size().height();
528 }
529
530 static void writeIndent(TextStream& ts, int indent)
531 {
532     for (int i = 0; i != indent; ++i)
533         ts << "  ";
534 }
535
536 void GraphicsLayer::dumpLayer(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const
537 {
538     writeIndent(ts, indent);
539     ts << "(" << "GraphicsLayer";
540
541     if (behavior & LayerTreeAsTextDebug) {
542         ts << " " << static_cast<void*>(const_cast<GraphicsLayer*>(this));
543         ts << " \"" << m_name << "\"";
544     }
545
546     ts << "\n";
547     dumpProperties(ts, indent, behavior);
548     writeIndent(ts, indent);
549     ts << ")\n";
550 }
551
552 void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBehavior behavior) const
553 {
554     if (m_position != FloatPoint()) {
555         writeIndent(ts, indent + 1);
556         ts << "(position " << m_position.x() << " " << m_position.y() << ")\n";
557     }
558
559     if (m_boundsOrigin != FloatPoint()) {
560         writeIndent(ts, indent + 1);
561         ts << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")\n";
562     }
563
564     if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) {
565         writeIndent(ts, indent + 1);
566         ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")\n";
567     }
568
569     if (m_size != IntSize()) {
570         writeIndent(ts, indent + 1);
571         ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n";
572     }
573
574     if (m_opacity != 1) {
575         writeIndent(ts, indent + 1);
576         ts << "(opacity " << m_opacity << ")\n";
577     }
578     
579     if (m_usingTiledLayer) {
580         writeIndent(ts, indent + 1);
581         ts << "(usingTiledLayer " << m_usingTiledLayer << ")\n";
582     }
583
584     if (m_preserves3D) {
585         writeIndent(ts, indent + 1);
586         ts << "(preserves3D " << m_preserves3D << ")\n";
587     }
588
589     if (m_drawsContent) {
590         writeIndent(ts, indent + 1);
591         ts << "(drawsContent " << m_drawsContent << ")\n";
592     }
593
594     if (!m_contentsVisible) {
595         writeIndent(ts, indent + 1);
596         ts << "(contentsVisible " << m_contentsVisible << ")\n";
597     }
598
599     if (!m_backfaceVisibility) {
600         writeIndent(ts, indent + 1);
601         ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n";
602     }
603
604     if (behavior & LayerTreeAsTextDebug) {
605         writeIndent(ts, indent + 1);
606         ts << "(";
607         if (m_client)
608             ts << "client " << static_cast<void*>(m_client);
609         else
610             ts << "no client";
611         ts << ")\n";
612     }
613
614     if (m_backgroundColorSet) {
615         writeIndent(ts, indent + 1);
616         ts << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n";
617     }
618
619     if (!m_transform.isIdentity()) {
620         writeIndent(ts, indent + 1);
621         ts << "(transform ";
622         ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] ";
623         ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] ";
624         ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] ";
625         ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "])\n";
626     }
627
628     // Avoid dumping the sublayer transform on the root layer, because it's used for geometry flipping, whose behavior
629     // differs between platforms.
630     if (parent() && !m_childrenTransform.isIdentity()) {
631         writeIndent(ts, indent + 1);
632         ts << "(childrenTransform ";
633         ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] ";
634         ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] ";
635         ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] ";
636         ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "])\n";
637     }
638
639     if (m_replicaLayer) {
640         writeIndent(ts, indent + 1);
641         ts << "(replica layer";
642         if (behavior & LayerTreeAsTextDebug)
643             ts << " " << m_replicaLayer;
644         ts << ")\n";
645         m_replicaLayer->dumpLayer(ts, indent + 2, behavior);
646     }
647
648     if (m_replicatedLayer) {
649         writeIndent(ts, indent + 1);
650         ts << "(replicated layer";
651         if (behavior & LayerTreeAsTextDebug)
652             ts << " " << m_replicatedLayer;;
653         ts << ")\n";
654     }
655     
656     if (m_children.size()) {
657         writeIndent(ts, indent + 1);
658         ts << "(children " << m_children.size() << "\n";
659         
660         unsigned i;
661         for (i = 0; i < m_children.size(); i++)
662             m_children[i]->dumpLayer(ts, indent + 2, behavior);
663         writeIndent(ts, indent + 1);
664         ts << ")\n";
665     }
666 }
667
668 String GraphicsLayer::layerTreeAsText(LayerTreeAsTextBehavior behavior) const
669 {
670     TextStream ts;
671
672     dumpLayer(ts, 0, behavior);
673     return ts.release();
674 }
675
676 } // namespace WebCore
677
678 #ifndef NDEBUG
679 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
680 {
681     if (!layer)
682         return;
683
684     WTF::String output = layer->layerTreeAsText(LayerTreeAsTextDebug);
685     fprintf(stderr, "%s\n", output.utf8().data());
686 }
687 #endif
688
689 #endif // USE(ACCELERATED_COMPOSITING)