2 Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
22 #if USE(UI_SIDE_COMPOSITING)
24 #include "WebLayerTreeRenderer.h"
26 #include "GraphicsLayerTextureMapper.h"
27 #include "LayerBackingStore.h"
28 #include "LayerTreeCoordinatorProxy.h"
29 #include "MessageID.h"
30 #include "ShareableBitmap.h"
31 #include "TextureMapper.h"
32 #include "TextureMapperBackingStore.h"
33 #include "TextureMapperGL.h"
34 #include "TextureMapperLayer.h"
35 #include "UpdateInfo.h"
36 #if !ENABLE(TIZEN_WEBKIT2_TILED_AC)
37 #include <OpenGLShims.h>
39 #include <WebCore/Logging.h>
40 #include <wtf/Atomics.h>
41 #include <wtf/MainThread.h>
43 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
44 #include "LayerTreeCoordinatorMessages.h"
45 #include "TextureMapperGL.h"
46 #include "WebPageProxy.h"
47 #include "WebProcessProxy.h"
52 using namespace WebCore;
54 template<class T> class MainThreadGuardedInvoker {
56 static void call(PassRefPtr<T> objectToGuard, const Function<void()>& function)
58 MainThreadGuardedInvoker<T>* invoker = new MainThreadGuardedInvoker<T>(objectToGuard, function);
59 callOnMainThread(invoke, invoker);
63 MainThreadGuardedInvoker(PassRefPtr<T> object, const Function<void()>& newFunction)
64 : objectToGuard(object)
65 , function(newFunction)
69 RefPtr<T> objectToGuard;
70 Function<void()> function;
71 static void invoke(void* data)
73 MainThreadGuardedInvoker<T>* invoker = static_cast<MainThreadGuardedInvoker<T>*>(data);
79 void WebLayerTreeRenderer::callOnMainThread(const Function<void()>& function)
84 MainThreadGuardedInvoker<WebLayerTreeRenderer>::call(this, function);
87 static FloatPoint boundedScrollPosition(const FloatPoint& scrollPosition, const FloatRect& visibleContentRect, const FloatSize& contentSize)
89 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
90 float scrollPositionX = std::max(scrollPosition.x(), 0.0f);
91 scrollPositionX = std::min(scrollPositionX, contentSize.width());
93 float scrollPositionY = std::max(scrollPosition.y(), 0.0f);
94 scrollPositionY = std::min(scrollPositionY, contentSize.height());
96 // Prevent negative scroll position.
97 scrollPositionX = std::max(scrollPositionX, 0.0f);
98 scrollPositionY = std::max(scrollPositionY, 0.0f);
100 float scrollPositionX = std::max(scrollPosition.x(), 0.0f);
101 scrollPositionX = std::min(scrollPositionX, contentSize.width() - visibleContentRect.width());
103 float scrollPositionY = std::max(scrollPosition.y(), 0.0f);
104 scrollPositionY = std::min(scrollPositionY, contentSize.height() - visibleContentRect.height());
107 return FloatPoint(scrollPositionX, scrollPositionY);
110 WebLayerTreeRenderer::WebLayerTreeRenderer(LayerTreeCoordinatorProxy* layerTreeCoordinatorProxy)
112 , m_layerTreeCoordinatorProxy(layerTreeCoordinatorProxy)
113 , m_rootLayerID(InvalidWebLayerID)
115 , m_animationsLocked(false)
116 #if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
120 , m_updateViewportTimer(RunLoop::current(), this, &WebLayerTreeRenderer::updateViewportFired)
125 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
126 WebLayerTreeRenderer::WebLayerTreeRenderer(LayerTreeCoordinatorProxy* layerTreeCoordinatorProxy, DrawingAreaProxy* drawingAreaProxy, bool isGLMode)
128 , m_layerTreeCoordinatorProxy(layerTreeCoordinatorProxy)
129 , m_rootLayerID(InvalidWebLayerID)
131 , m_animationsLocked(false)
132 #if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
135 , m_drawingAreaProxy(drawingAreaProxy)
136 , m_isGLMode(isGLMode)
138 , m_updateViewportTimer(RunLoop::current(), this, &WebLayerTreeRenderer::updateViewportFired)
144 WebLayerTreeRenderer::~WebLayerTreeRenderer()
146 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE_BACKUP_IMAGE)
147 if (m_backupTexture && m_backupTexture->isValid()) {
148 m_backupTexture.release();
154 PassOwnPtr<GraphicsLayer> WebLayerTreeRenderer::createLayer(WebLayerID layerID)
156 GraphicsLayer* newLayer = new GraphicsLayerTextureMapper(this);
157 TextureMapperLayer* layer = toTextureMapperLayer(newLayer);
158 layer->setShouldUpdateBackingStoreFromLayer(false);
160 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
161 LOG(AcceleratedCompositing, "[UI ] create layer %u @WebLayerTreeRenderer::createLayer \n", layerID);
164 return adoptPtr(newLayer);
167 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE_BACKUP_IMAGE)
168 void WebLayerTreeRenderer::paintToBackupTexture(const TransformationMatrix& matrix, float opacity, const FloatRect& clipRect, const WebCore::Color& bgColor)
170 if (!m_textureMapper)
171 m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
172 ASSERT(m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode);
174 adjustPositionForFixedLayers();
175 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
176 adjustPositionForOverflowLayers();
179 GraphicsLayer* currentRootLayer = rootLayer();
180 if (!currentRootLayer)
183 TextureMapperLayer* layer = toTextureMapperLayer(currentRootLayer);
187 #if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
188 static_cast<TextureMapperGL*>(m_textureMapper.get())->setAngle(m_angle);
191 if (!m_backupTexture || m_backupTexture->size() != IntSize(clipRect.width(), clipRect.height()))
192 m_backupTexture = m_textureMapper->acquireTextureFromPool(IntSize(clipRect.width(), clipRect.height()));
194 layer->setTextureMapper(m_textureMapper.get());
195 if (!m_animationsLocked)
196 layer->applyAnimationsRecursively();
197 m_textureMapper->bindSurface(m_backupTexture.get());
198 m_textureMapper->beginPainting(0);
199 m_textureMapper->beginClip(TransformationMatrix(), clipRect);
201 if (currentRootLayer->opacity() != opacity || currentRootLayer->transform() != matrix) {
202 currentRootLayer->setOpacity(opacity);
203 currentRootLayer->setTransform(matrix);
204 currentRootLayer->syncCompositingStateForThisLayerOnly();
207 glClearColor(bgColor.red(), bgColor.green(), bgColor.blue(), bgColor.alpha());
208 glClear(GL_COLOR_BUFFER_BIT);
210 #if ENABLE(TIZEN_TEXTURE_MAPPER_CULLER)
211 layer->paintWithCuller(clipRect);
216 m_textureMapper->endClip();
217 m_textureMapper->endPainting();
218 m_textureMapper->unbindSurface();
220 if (layer->descendantsOrSelfHaveRunningAnimations()) {
222 m_updateViewportTimer.startOneShot(0);
224 callOnMainThread(bind(&WebLayerTreeRenderer::updateViewport, this));
230 void WebLayerTreeRenderer::paintToCurrentGLContext(const TransformationMatrix& matrix, float opacity, const FloatRect& clipRect, const WebCore::Color& backgroundColor, TextureMapper::PaintFlags PaintFlags)
232 if (!m_textureMapper)
233 m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
234 ASSERT(m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode);
236 adjustPositionForFixedLayers();
237 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
238 adjustPositionForOverflowLayers();
240 GraphicsLayer* currentRootLayer = rootLayer();
241 if (!currentRootLayer) {
242 #if ENABLE(TIZEN_SET_INITIAL_COLOR_OF_WEBVIEW_EVAS_IMAGE)
243 glClearColor(1, 1, 1, 1);
244 glClear(GL_COLOR_BUFFER_BIT);
249 TextureMapperLayer* layer = toTextureMapperLayer(currentRootLayer);
252 #if ENABLE(TIZEN_SET_INITIAL_COLOR_OF_WEBVIEW_EVAS_IMAGE)
253 glClearColor(1, 1, 1, 1);
254 glClear(GL_COLOR_BUFFER_BIT);
259 #if ENABLE(TIZEN_WEBKIT2_DIRECT_RENDERING)
260 static_cast<TextureMapperGL*>(m_textureMapper.get())->setAngle(m_angle);
263 layer->setTextureMapper(m_textureMapper.get());
264 if (!m_animationsLocked)
265 layer->applyAnimationsRecursively();
266 m_textureMapper->beginPainting(PaintFlags);
267 m_textureMapper->beginClip(TransformationMatrix(), clipRect);
269 m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), backgroundColor);
271 if (currentRootLayer->opacity() != opacity || currentRootLayer->transform() != matrix) {
272 currentRootLayer->setOpacity(opacity);
273 currentRootLayer->setTransform(matrix);
274 currentRootLayer->syncCompositingStateForThisLayerOnly();
277 #if ENABLE(TIZEN_TEXTURE_MAPPER_CULLER)
278 layer->paintWithCuller(clipRect);
283 m_textureMapper->endClip();
284 m_textureMapper->endPainting();
285 if (layer->descendantsOrSelfHaveRunningAnimations()) {
287 m_updateViewportTimer.startOneShot(0);
289 callOnMainThread(bind(&WebLayerTreeRenderer::updateViewport, this));
294 #if PLATFORM(QT) || PLATFORM(EFL)
295 void WebLayerTreeRenderer::paintToGraphicsContext(BackingStore::PlatformGraphicsContext painter)
297 if (!m_textureMapper)
298 m_textureMapper = TextureMapper::create();
299 ASSERT(m_textureMapper->accelerationMode() == TextureMapper::SoftwareMode);
301 TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());
306 GraphicsContext graphicsContext(painter);
307 m_textureMapper->setGraphicsContext(&graphicsContext);
308 m_textureMapper->beginPainting();
310 m_textureMapper->endPainting();
311 m_textureMapper->setGraphicsContext(0);
315 void WebLayerTreeRenderer::setContentsSize(const WebCore::FloatSize& contentsSize)
317 m_contentsSize = contentsSize;
320 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
321 void WebLayerTreeRenderer::setAccurateVisibleContentsPosition(const WebCore::FloatPoint& accurateVisibleContentsPosition)
323 m_accurateVisibleContentsPosition = accurateVisibleContentsPosition;
327 void WebLayerTreeRenderer::setVisibleContentsRect(const IntRect& rect, float scale, const WebCore::FloatPoint& accurateVisibleContentsPosition)
329 m_visibleContentsRect = rect;
330 m_contentsScale = scale;
331 m_accurateVisibleContentsPosition = accurateVisibleContentsPosition;
335 void WebLayerTreeRenderer::updateViewportFired()
337 callOnMainThread(bind(&WebLayerTreeRenderer::updateViewport, this));
341 void WebLayerTreeRenderer::updateViewport()
343 if (m_layerTreeCoordinatorProxy)
344 m_layerTreeCoordinatorProxy->updateViewport();
347 void WebLayerTreeRenderer::adjustPositionForFixedLayers()
349 if (m_fixedLayers.isEmpty())
352 // Fixed layer positions are updated by the web process when we update the visible contents rect / scroll position.
353 // If we want those layers to follow accurately the viewport when we move between the web process updates, we have to offset
354 // them by the delta between the current position and the position of the viewport used for the last layout.
355 FloatPoint scrollPosition = boundedScrollPosition(FloatPoint(m_accurateVisibleContentsPosition.x() / m_contentsScale, m_accurateVisibleContentsPosition.y() / m_contentsScale), m_visibleContentsRect, m_contentsSize);
356 FloatPoint renderedScrollPosition = boundedScrollPosition(m_renderedContentsScrollPosition, m_visibleContentsRect, m_contentsSize);
357 FloatSize delta = scrollPosition - renderedScrollPosition;
359 LayerMap::iterator end = m_fixedLayers.end();
360 for (LayerMap::iterator it = m_fixedLayers.begin(); it != end; ++it)
361 toTextureMapperLayer(it->second)->setScrollPositionDeltaIfNeeded(delta);
364 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
365 void WebLayerTreeRenderer::adjustPositionForOverflowLayers()
367 LayerMap::iterator end = m_scrollingContentsLayers.end();
368 for (LayerMap::iterator it = m_scrollingContentsLayers.begin(); it != end; ++it) {
369 GraphicsLayer* contentsLayer = it->second;
370 TextureMapperLayer* textureMapperLayer = contentsLayer ? toTextureMapperLayer(contentsLayer) : 0;
371 if (!textureMapperLayer)
374 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_SCROLLBAR)
375 const Vector<GraphicsLayer*>& childLayers = contentsLayer->children();
376 for (size_t i = 0; i < childLayers.size(); ++i)
377 if (childLayers[i]->isScrollbar())
378 toTextureMapperLayer(childLayers[i])->setScrollPositionDeltaIfNeeded(FloatSize(contentsLayer->boundsOrigin().x(), contentsLayer->boundsOrigin().y()));
380 textureMapperLayer->setScrollPositionDeltaIfNeeded(FloatSize(-contentsLayer->boundsOrigin().x(), -contentsLayer->boundsOrigin().y()));
384 bool WebLayerTreeRenderer::setOffset(const WebLayerID id, const FloatPoint& offset)
386 LayerMap::iterator it = m_scrollingContentsLayers.find(id);
387 if (it == m_scrollingContentsLayers.end())
390 GraphicsLayer* contentsLayer = it->second;
391 GraphicsLayer* scrollingLayer = contentsLayer ? contentsLayer->parent() : 0;
395 const IntSize contentLayerSize(contentsLayer->size().width(), contentsLayer->size().height());
396 const IntRect boundaryRect(FloatRect(scrollingLayer->position(), scrollingLayer->size()));
397 const IntRect visibleRect(FloatRect(contentsLayer->boundsOrigin(), scrollingLayer->size()));
399 IntRect newVisibleRect = visibleRect;
400 newVisibleRect.moveBy(flooredIntPoint(offset));
402 if (newVisibleRect.x() < boundaryRect.x())
403 newVisibleRect.setX(boundaryRect.x());
404 if (contentLayerSize.width() - newVisibleRect.x() < boundaryRect.maxX())
405 newVisibleRect.setX(contentLayerSize.width() - boundaryRect.width());
406 if (newVisibleRect.y() < boundaryRect.y())
407 newVisibleRect.setY(boundaryRect.y());
408 if (contentLayerSize.height() - newVisibleRect.y() < boundaryRect.maxY())
409 newVisibleRect.setY(contentLayerSize.height() - boundaryRect.height());
411 if (visibleRect == newVisibleRect)
414 contentsLayer->setBoundsOrigin(newVisibleRect.location());
416 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::SetVisibleContentsRectAndTrajectoryVectorForLayer(id, visibleRect, offset), m_drawingAreaProxy->page()->pageID());
421 void WebLayerTreeRenderer::setVisibleContentsRectForScrollingContentsLayers(const WebCore::IntRect& visibleRect)
423 LayerMap::iterator end = m_scrollingContentsLayers.end();
424 for (LayerMap::iterator it = m_scrollingContentsLayers.begin(); it != end; ++it) {
425 GraphicsLayer* contentsLayer = it->second;
426 GraphicsLayer* scrollingLayer = contentsLayer ? contentsLayer->parent() : 0;
430 // FIXME: We might need to check if the each content layer is in viewport.
431 // Simply, we should find out a intersected rect between visibleRect and each scrollingLayer here.
432 const IntRect newVisibleRect(FloatRect(contentsLayer->boundsOrigin(), scrollingLayer->size()));
434 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::SetVisibleContentsRectAndTrajectoryVectorForLayer(it->first, newVisibleRect, WebCore::FloatPoint()), m_drawingAreaProxy->page()->pageID());
439 void WebLayerTreeRenderer::didChangeScrollPosition(const IntPoint& position)
441 m_pendingRenderedContentsScrollPosition = position;
444 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
445 void WebLayerTreeRenderer::syncCanvas(WebLayerID id, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer, int flags)
447 void WebLayerTreeRenderer::syncCanvas(WebLayerID id, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer)
450 if (canvasSize.isEmpty() || !m_textureMapper)
453 #if USE(GRAPHICS_SURFACE) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
455 GraphicsLayer* layer = layerByID(id);
457 RefPtr<TextureMapperSurfaceBackingStore> canvasBackingStore;
458 SurfaceBackingStoreMap::iterator it = m_surfaceBackingStores.find(id);
459 if (it == m_surfaceBackingStores.end()) {
460 canvasBackingStore = TextureMapperSurfaceBackingStore::create();
461 m_surfaceBackingStores.set(id, canvasBackingStore);
463 canvasBackingStore = it->second;
465 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
466 canvasBackingStore->setGraphicsSurface(graphicsSurfaceToken, canvasSize, frontBuffer, flags);
468 canvasBackingStore->setGraphicsSurface(graphicsSurfaceToken, canvasSize, frontBuffer);
470 layer->setContentsToMedia(canvasBackingStore.get());
474 void WebLayerTreeRenderer::setLayerChildren(WebLayerID id, const Vector<WebLayerID>& childIDs)
477 LayerMap::iterator it = m_layers.find(id);
478 GraphicsLayer* layer = it->second;
479 Vector<GraphicsLayer*> children;
481 for (size_t i = 0; i < childIDs.size(); ++i) {
482 WebLayerID childID = childIDs[i];
483 GraphicsLayer* child = layerByID(childID);
485 child = createLayer(childID).leakPtr();
486 m_layers.add(childID, child);
488 children.append(child);
490 layer->setChildren(children);
493 #if ENABLE(CSS_FILTERS)
494 void WebLayerTreeRenderer::setLayerFilters(WebLayerID id, const FilterOperations& filters)
497 LayerMap::iterator it = m_layers.find(id);
498 ASSERT(it != m_layers.end());
500 GraphicsLayer* layer = it->second;
501 layer->setFilters(filters);
505 void WebLayerTreeRenderer::setLayerState(WebLayerID id, const WebLayerInfo& layerInfo)
508 LayerMap::iterator it = m_layers.find(id);
509 ASSERT(it != m_layers.end());
511 GraphicsLayer* layer = it->second;
513 layer->setReplicatedByLayer(layerByID(layerInfo.replica));
514 layer->setMaskLayer(layerByID(layerInfo.mask));
516 layer->setPosition(layerInfo.pos);
517 layer->setSize(layerInfo.size);
518 layer->setTransform(layerInfo.transform);
519 layer->setAnchorPoint(layerInfo.anchorPoint);
520 layer->setChildrenTransform(layerInfo.childrenTransform);
521 layer->setBackfaceVisibility(layerInfo.backfaceVisible);
522 layer->setContentsOpaque(layerInfo.contentsOpaque);
523 layer->setContentsRect(layerInfo.contentsRect);
524 layer->setDrawsContent(layerInfo.drawsContent);
525 layer->setContentsVisible(layerInfo.contentsVisible);
526 toGraphicsLayerTextureMapper(layer)->setFixedToViewport(layerInfo.fixedToViewport);
528 if (layerInfo.fixedToViewport)
529 m_fixedLayers.add(id, layer);
531 m_fixedLayers.remove(id);
533 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
534 if (layerInfo.isScrollingContentsLayer) {
535 LayerMap::iterator it = m_scrollingContentsLayers.find(id);
536 if (it == m_scrollingContentsLayers.end() || (layer->boundsOrigin() != layerInfo.boundsOrigin)) {
537 layer->setBoundsOrigin(layerInfo.boundsOrigin);
538 GraphicsLayer* scrollingLayer = layerByID(layerInfo.parent);
539 if (scrollingLayer) {
540 const IntRect newVisibleRect(FloatRect(layer->boundsOrigin(), scrollingLayer->size()));
541 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::SetVisibleContentsRectAndTrajectoryVectorForLayer(id, newVisibleRect, WebCore::FloatPoint()), m_drawingAreaProxy->page()->pageID());
544 m_scrollingContentsLayers.add(id, layer);
547 m_scrollingContentsLayers.remove(id);
549 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_SCROLLBAR)
550 layer->setIsScrollbar(layerInfo.isScrollbar);
553 assignImageToLayer(layer, layerInfo.imageBackingStoreID);
555 // Never make the root layer clip.
556 layer->setMasksToBounds(layerInfo.isRootLayer ? false : layerInfo.masksToBounds);
557 layer->setOpacity(layerInfo.opacity);
558 layer->setPreserves3D(layerInfo.preserves3D);
559 if (layerInfo.isRootLayer && m_rootLayerID != id)
563 void WebLayerTreeRenderer::deleteLayer(WebLayerID layerID)
565 GraphicsLayer* layer = layerByID(layerID);
569 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
570 LOG(AcceleratedCompositing, "[UI ] delete layer %u @WebLayerTreeRenderer::deleteLayer \n", layerID);
573 layer->removeFromParent();
574 m_layers.remove(layerID);
575 m_fixedLayers.remove(layerID);
576 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
577 m_scrollingContentsLayers.remove(layerID);
579 #if USE(GRAPHICS_SURFACE) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
580 m_surfaceBackingStores.remove(layerID);
586 void WebLayerTreeRenderer::ensureLayer(WebLayerID id)
588 // We have to leak the new layer's pointer and manage it ourselves,
589 // because OwnPtr is not copyable.
590 if (m_layers.find(id) == m_layers.end())
591 m_layers.add(id, createLayer(id).leakPtr());
594 void WebLayerTreeRenderer::setRootLayerID(WebLayerID layerID)
596 if (layerID == m_rootLayerID)
599 m_rootLayerID = layerID;
601 m_rootLayer->removeAllChildren();
606 GraphicsLayer* layer = layerByID(layerID);
610 m_rootLayer->addChild(layer);
613 PassRefPtr<LayerBackingStore> WebLayerTreeRenderer::getBackingStore(WebLayerID id)
615 TextureMapperLayer* layer = toTextureMapperLayer(layerByID(id));
617 RefPtr<LayerBackingStore> backingStore = static_cast<LayerBackingStore*>(layer->backingStore().get());
619 backingStore = LayerBackingStore::create();
620 layer->setBackingStore(backingStore.get());
622 ASSERT(backingStore);
626 void WebLayerTreeRenderer::createTile(WebLayerID layerID, int tileID, float scale)
629 if (!layerByID(layerID))
633 getBackingStore(layerID)->createTile(tileID, scale);
636 void WebLayerTreeRenderer::removeBackingStoreIfNeeded(WebLayerID layerID)
638 TextureMapperLayer* layer = toTextureMapperLayer(layerByID(layerID));
640 RefPtr<LayerBackingStore> backingStore = static_cast<LayerBackingStore*>(layer->backingStore().get());
641 ASSERT(backingStore);
642 if (backingStore->isEmpty())
643 layer->setBackingStore(0);
646 void WebLayerTreeRenderer::removeTile(WebLayerID layerID, int tileID)
649 // Check whether composited graphics layer already been detached
650 GraphicsLayer* pGraphicsLayer = layerByID(layerID);
654 getBackingStore(layerID)->removeTile(tileID);
655 removeBackingStoreIfNeeded(layerID);
658 #if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
659 void WebLayerTreeRenderer::updateTileWithUpdateInfo(WebLayerID layerID, int tileID, const TileUpdate& update)
661 updateTile(layerID, tileID, update);
665 void WebLayerTreeRenderer::updateTile(WebLayerID layerID, int tileID, const TileUpdate& update)
668 if (!layerByID(layerID))
672 RefPtr<LayerBackingStore> backingStore = getBackingStore(layerID);
673 backingStore->updateTile(tileID, update.sourceRect, update.targetRect, update.surface, update.offset);
674 m_backingStoresWithPendingBuffers.add(backingStore);
677 void WebLayerTreeRenderer::createImage(int64_t imageID, PassRefPtr<ShareableBitmap> weakBitmap)
679 RefPtr<ShareableBitmap> bitmap = weakBitmap;
680 RefPtr<TextureMapperTiledBackingStore> backingStore = TextureMapperTiledBackingStore::create();
681 m_directlyCompositedImages.set(imageID, backingStore);
682 backingStore->updateContents(m_textureMapper.get(), bitmap->createImage().get());
685 void WebLayerTreeRenderer::destroyImage(int64_t imageID)
687 m_directlyCompositedImages.remove(imageID);
690 void WebLayerTreeRenderer::assignImageToLayer(GraphicsLayer* layer, int64_t imageID)
693 layer->setContentsToMedia(0);
697 HashMap<int64_t, RefPtr<TextureMapperBackingStore> >::iterator it = m_directlyCompositedImages.find(imageID);
698 ASSERT(it != m_directlyCompositedImages.end());
699 layer->setContentsToMedia(it->second.get());
702 void WebLayerTreeRenderer::commitTileOperations()
704 HashSet<RefPtr<LayerBackingStore> >::iterator end = m_backingStoresWithPendingBuffers.end();
705 for (HashSet<RefPtr<LayerBackingStore> >::iterator it = m_backingStoresWithPendingBuffers.begin(); it != end; ++it)
706 (*it)->commitTileOperations(m_textureMapper.get());
708 m_backingStoresWithPendingBuffers.clear();
711 void WebLayerTreeRenderer::flushLayerChanges()
713 m_renderedContentsScrollPosition = m_pendingRenderedContentsScrollPosition;
715 // Since the frame has now been rendered, we can safely unlock the animations until the next layout.
716 setAnimationsLocked(false);
718 m_rootLayer->syncCompositingState(FloatRect());
720 commitTileOperations();
722 // The pending tiles state is on its way for the screen, tell the web process to render the next one.
723 callOnMainThread(bind(&WebLayerTreeRenderer::renderNextFrame, this));
726 void WebLayerTreeRenderer::renderNextFrame()
728 if (m_layerTreeCoordinatorProxy)
729 m_layerTreeCoordinatorProxy->renderNextFrame();
732 void WebLayerTreeRenderer::ensureRootLayer()
737 #if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
738 createTextureMapper();
740 if (!m_textureMapper) {
741 m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
742 static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
746 m_rootLayer = createLayer(InvalidWebLayerID);
747 m_rootLayer->setMasksToBounds(false);
748 m_rootLayer->setDrawsContent(false);
749 m_rootLayer->setAnchorPoint(FloatPoint3D(0, 0, 0));
751 // The root layer should not have zero size, or it would be optimized out.
752 m_rootLayer->setSize(FloatSize(1.0, 1.0));
753 toTextureMapperLayer(m_rootLayer.get())->setTextureMapper(m_textureMapper.get());
756 void WebLayerTreeRenderer::syncRemoteContent()
758 // We enqueue messages and execute them during paint, as they require an active GL context.
761 for (size_t i = 0; i < m_renderQueue.size(); ++i)
764 m_renderQueue.clear();
767 void WebLayerTreeRenderer::purgeGLResources()
769 TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());
772 layer->clearBackingStoresRecursive();
774 m_directlyCompositedImages.clear();
775 #if USE(GRAPHICS_SURFACE) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
776 m_surfaceBackingStores.clear();
779 m_rootLayer->removeAllChildren();
781 m_rootLayerID = InvalidWebLayerID;
783 m_fixedLayers.clear();
784 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
785 m_scrollingContentsLayers.clear();
787 m_textureMapper.clear();
788 m_backingStoresWithPendingBuffers.clear();
792 callOnMainThread(bind(&WebLayerTreeRenderer::purgeBackingStores, this));
795 void WebLayerTreeRenderer::setLayerAnimations(WebLayerID id, const GraphicsLayerAnimations& animations)
797 GraphicsLayerTextureMapper* layer = toGraphicsLayerTextureMapper(layerByID(id));
800 layer->setAnimations(animations);
803 void WebLayerTreeRenderer::setAnimationsLocked(bool locked)
805 m_animationsLocked = locked;
808 void WebLayerTreeRenderer::purgeBackingStores()
810 if (m_layerTreeCoordinatorProxy)
811 m_layerTreeCoordinatorProxy->purgeBackingStores();
814 void WebLayerTreeRenderer::detach()
816 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
817 m_renderQueue.clear();
819 m_layerTreeCoordinatorProxy = 0;
822 void WebLayerTreeRenderer::appendUpdate(const Function<void()>& function)
827 m_renderQueue.append(function);
830 void WebLayerTreeRenderer::setActive(bool active)
832 if (m_isActive == active)
835 // Have to clear render queue in both cases.
836 // If there are some updates in queue during activation then those updates are from previous instance of paint node
837 // and cannot be applied to the newly created instance.
838 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
841 m_renderQueue.clear();
845 #if ENABLE(TIZEN_WEBKIT2_TILED_AC)
846 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
847 void WebLayerTreeRenderer::platformLayerChanged(WebCore::GraphicsLayer*, WebCore::PlatformLayer* oldPlatformLayer, WebCore::PlatformLayer* newPlatformLayer)
854 void WebLayerTreeRenderer::clearBackingStores()
856 LayerMap::iterator end = m_layers.end();
857 for(LayerMap::iterator it = m_layers.begin(); it != end; ++it)
858 toTextureMapperLayer(it->second)->clearBackingStore();
860 m_directlyCompositedImages.clear();
861 m_backingStoresWithPendingBuffers.clear();
863 #endif // ENABLE(TIZEN_WEBKIT2_TILED_AC)
865 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE_BACKUP_IMAGE)
866 void WebLayerTreeRenderer::showBackupTexture(const TransformationMatrix& matrix, float opacity, const FloatRect& clipRect)
868 if (!m_textureMapper)
869 m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
870 ASSERT(m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode);
873 || !(m_backupTexture->isValid())
874 || m_backupTexture->size().width() != clipRect.width()
875 || m_backupTexture->size().height() != clipRect.height())
878 m_textureMapper->beginPainting(1);
879 m_textureMapper->beginClip(TransformationMatrix(), clipRect);
881 IntSize viewportSize(clipRect.width(), clipRect.height());
882 const BitmapTextureGL* textureGL = static_cast<const BitmapTextureGL*>(m_backupTexture.get());
883 m_textureMapper->drawTexture(textureGL->id(), 0, viewportSize, clipRect, matrix, 1.0, 0, viewportSize, false);
885 m_textureMapper->endClip();
886 m_textureMapper->endPainting();
890 #if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
891 void WebLayerTreeRenderer::createTextureMapper()
893 if (!m_textureMapper)
894 m_textureMapper = m_isGLMode ? TextureMapper::create(TextureMapper::OpenGLMode) : TextureMapper::create();
897 ASSERT(m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode);
899 ASSERT(m_textureMapper->accelerationMode() == TextureMapper::SoftwareMode);
903 #if ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
904 WebLayerTreeRendererTizen::WebLayerTreeRendererTizen(LayerTreeCoordinatorProxy* layerTreeCoordinatorProxy, DrawingAreaProxy* drawingAreaProxy)
905 : WebLayerTreeRenderer(layerTreeCoordinatorProxy, drawingAreaProxy)
909 void WebLayerTreeRendererTizen::purgeGLResources()
911 TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());
914 layer->clearBackingStoresRecursive();
916 clearPlatformLayerPlatformSurfaces();
918 m_directlyCompositedImages.clear();
919 #if USE(GRAPHICS_SURFACE)
920 m_surfaceBackingStores.clear();
923 m_rootLayer->removeAllChildren();
925 m_rootLayerID = InvalidWebLayerID;
927 m_fixedLayers.clear();
928 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
929 m_scrollingContentsLayers.clear();
931 m_textureMapper.clear();
932 m_backingStoresWithPendingBuffers.clear();
936 callOnMainThread(bind(&WebLayerTreeRendererTizen::purgeBackingStores, this));
939 void WebLayerTreeRendererTizen::syncCanvas(WebLayerID id, const WebCore::IntSize& canvasSize, uint64_t graphicsSurfaceToken, uint32_t frontBuffer, int flags)
941 if (canvasSize.isEmpty() || !m_textureMapper)
944 #if USE(GRAPHICS_SURFACE) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
946 GraphicsLayer* layer = layerByID(id);
948 RefPtr<TextureMapperSurfaceBackingStore> canvasBackingStore;
949 SurfaceBackingStoreMap::iterator it = m_surfaceBackingStores.find(id);
950 if (it == m_surfaceBackingStores.end()) {
951 canvasBackingStore = TextureMapperSurfaceBackingStore::create();
952 m_surfaceBackingStores.set(id, canvasBackingStore);
954 canvasBackingStore = it->second;
956 if ((canvasBackingStore->graphicsSurfaceFrontBuffer() > 0 && canvasBackingStore->graphicsSurfaceFrontBuffer() != frontBuffer) || flags & GraphicsSurface::Is2D) {
957 FreePlatformSurfaceData data;
958 data.platformSurfaceId = canvasBackingStore->graphicsSurfaceFrontBuffer();
960 m_freePlatformSurfaces.append(data);
963 m_platformLayerPlatformSurfaces.set(frontBuffer, id);
964 canvasBackingStore->setGraphicsSurface(graphicsSurfaceToken, canvasSize, frontBuffer, flags);
965 layer->setContentsOpaque(!(flags & GraphicsSurface::Alpha));
966 layer->setContentsToMedia(canvasBackingStore.get());
970 void WebLayerTreeRendererTizen::detach()
972 clearBackingStores();
973 WebLayerTreeRenderer::detach();
976 void WebLayerTreeRendererTizen::appendUpdate(const Function<void()>& function)
978 m_renderQueue.append(function);
981 void WebLayerTreeRendererTizen::setActive(bool active)
983 if (m_isActive == active)
986 // Have to clear render queue in both cases.
987 // If there are some updates in queue during activation then those updates are from previous instance of paint node
988 // and cannot be applied to the newly created instance.
990 m_renderQueue.clear();
994 void WebLayerTreeRendererTizen::deleteLayer(WebLayerID layerID)
996 GraphicsLayer* layer = layerByID(layerID);
1000 LOG(AcceleratedCompositing, "[UI ] delete layer %u @WebLayerTreeRenderer::deleteLayer \n", layerID);
1001 layer->removeFromParent();
1002 m_layers.remove(layerID);
1003 m_fixedLayers.remove(layerID);
1004 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
1005 m_scrollingContentsLayers.remove(layerID);
1008 #if USE(GRAPHICS_SURFACE) || ENABLE(TIZEN_CANVAS_GRAPHICS_SURFACE)
1009 SurfaceBackingStoreMap::iterator it = m_surfaceBackingStores.find(layerID);
1010 if (it != m_surfaceBackingStores.end())
1011 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::FreePlatformSurface(layerID, it->second->graphicsSurfaceFrontBuffer()), m_drawingAreaProxy->page()->pageID());
1013 m_surfaceBackingStores.remove(layerID);
1018 void WebLayerTreeRendererTizen::setLayerState(WebLayerID id, const WebLayerInfo& layerInfo)
1021 LayerMap::iterator it = m_layers.find(id);
1022 ASSERT(it != m_layers.end());
1024 GraphicsLayer* layer = it->second;
1026 layer->setReplicatedByLayer(layerByID(layerInfo.replica));
1027 layer->setMaskLayer(layerByID(layerInfo.mask));
1029 layer->setPosition(layerInfo.pos);
1030 layer->setSize(layerInfo.size);
1031 layer->setTransform(layerInfo.transform);
1032 layer->setAnchorPoint(layerInfo.anchorPoint);
1033 layer->setChildrenTransform(layerInfo.childrenTransform);
1034 layer->setBackfaceVisibility(layerInfo.backfaceVisible);
1035 layer->setContentsOpaque(layerInfo.contentsOpaque);
1036 layer->setContentsRect(layerInfo.contentsRect);
1037 layer->setDrawsContent(layerInfo.drawsContent);
1038 layer->setContentsVisible(layerInfo.contentsVisible);
1039 toGraphicsLayerTextureMapper(layer)->setFixedToViewport(layerInfo.fixedToViewport);
1041 if (layerInfo.fixedToViewport)
1042 m_fixedLayers.add(id, layer);
1044 m_fixedLayers.remove(id);
1046 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION_ON_UI_SIDE)
1047 if (layerInfo.isScrollingContentsLayer) {
1048 LayerMap::iterator it = m_scrollingContentsLayers.find(id);
1049 if (it == m_scrollingContentsLayers.end() || (layer->boundsOrigin() != layerInfo.boundsOrigin)) {
1050 layer->setBoundsOrigin(layerInfo.boundsOrigin);
1051 GraphicsLayer* scrollingLayer = layerByID(layerInfo.parent);
1052 if (scrollingLayer) {
1053 const IntRect newVisibleRect(FloatRect(layer->boundsOrigin(), scrollingLayer->size()));
1054 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::SetVisibleContentsRectAndTrajectoryVectorForLayer(id, newVisibleRect, WebCore::FloatPoint()), m_drawingAreaProxy->page()->pageID());
1057 m_scrollingContentsLayers.add(id, layer);
1060 m_scrollingContentsLayers.remove(id);
1062 #if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_SCROLLBAR)
1063 layer->setIsScrollbar(layerInfo.isScrollbar);
1066 assignImageToLayer(layer, layerInfo.imageBackingStoreID);
1068 // Never make the root layer clip.
1069 layer->setMasksToBounds(layerInfo.isRootLayer ? false : layerInfo.masksToBounds);
1070 layer->setOpacity(layerInfo.opacity);
1071 layer->setPreserves3D(layerInfo.preserves3D);
1072 if (layerInfo.isRootLayer && m_rootLayerID != id)
1076 void WebLayerTreeRendererTizen::removeTile(WebLayerID layerID, int tileID)
1079 // Check whether composited graphics layer already been detached
1080 GraphicsLayer* pGraphicsLayer = layerByID(layerID);
1081 if (!pGraphicsLayer) {
1082 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::FreePlatformSurfaceByTileID(tileID), m_drawingAreaProxy->page()->pageID());
1083 LOG(TiledAC, "layerID %d already has been deleted.", layerID);
1088 LayerBackingStoreTizen* backingStore = static_cast<LayerBackingStoreTizen*>(getBackingStore(layerID).get());
1092 if (backingStore->tilePlatformSurfaceId(tileID) > 0)
1093 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::FreePlatformSurface(layerID, backingStore->tilePlatformSurfaceId(tileID)), m_drawingAreaProxy->page()->pageID());
1095 backingStore->removeTile(tileID);
1098 #if ENABLE(TIZEN_RUNTIME_BACKEND_SELECTION)
1099 void WebLayerTreeRendererTizen::createTextureMapper()
1101 if (!m_textureMapper)
1102 m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
1103 ASSERT(m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode);
1106 void WebLayerTreeRendererTizen::updateTileWithUpdateInfo(WebLayerID layerID, int tileID, const TileUpdate& updateInfo)
1108 updatePlatformSurfaceTile(layerID, tileID, updateInfo.sourceRect, updateInfo.platformSurfaceID, updateInfo.platformSurfaceSize);
1112 void WebLayerTreeRendererTizen::flushLayerChanges()
1114 m_renderedContentsScrollPosition = m_pendingRenderedContentsScrollPosition;
1116 // Since the frame has now been rendered, we can safely unlock the animations until the next layout.
1117 setAnimationsLocked(false);
1119 m_rootLayer->syncCompositingState(FloatRect());
1121 freePlatformSurface();
1122 commitTileOperations();
1124 // The pending tiles state is on its way for the screen, tell the web process to render the next one.
1125 callOnMainThread(bind(&WebLayerTreeRendererTizen::renderNextFrame, this));
1128 void WebLayerTreeRendererTizen::clearBackingStores()
1130 LayerMap::iterator end = m_layers.end();
1131 for(LayerMap::iterator it = m_layers.begin(); it != end; ++it)
1132 toTextureMapperLayer(it->second)->clearBackingStore();
1134 clearPlatformLayerPlatformSurfaces();
1136 m_directlyCompositedImages.clear();
1137 m_backingStoresWithPendingBuffers.clear();
1139 freePlatformSurfacesAfterClearingBackingStores();
1142 PassRefPtr<LayerBackingStore> WebLayerTreeRendererTizen::getBackingStore(WebLayerID id)
1144 TextureMapperLayer* layer = toTextureMapperLayer(layerByID(id));
1146 RefPtr<LayerBackingStoreTizen> backingStore = static_cast<LayerBackingStoreTizen*>(layer->backingStore().get());
1147 if (!backingStore) {
1148 backingStore = LayerBackingStoreTizen::create();
1149 layer->setBackingStore(backingStore.get());
1150 backingStore->setPlatformSurfaceTexturePool(m_drawingAreaProxy);
1152 ASSERT(backingStore);
1153 return backingStore;
1156 void WebLayerTreeRendererTizen::freePlatformSurface()
1158 if (!hasPlatformSurfaceToFree())
1161 HashSet<RefPtr<LayerBackingStore> >::iterator end = m_backingStoresWithPendingBuffers.end();
1162 for (HashSet<RefPtr<LayerBackingStore> >::iterator it = m_backingStoresWithPendingBuffers.begin(); it != end; ++it) {
1163 LayerBackingStoreTizen* backingStore = static_cast<LayerBackingStoreTizen*>((*it).get());
1164 int layerId = backingStore->layerId();
1165 Vector<int> freePlatformSurface = *(backingStore->freePlatformSurfaceTiles());
1167 for (unsigned n = 0; n < backingStore->freePlatformSurfaceTiles()->size(); ++n)
1168 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::FreePlatformSurface(layerId, freePlatformSurface[n]), m_drawingAreaProxy->page()->pageID());
1169 backingStore->clearFreePlatformSurfaceTiles();
1171 m_backingStoresWithPendingBuffers.clear();
1173 // m_freePlatformSurfaces is for platformSurfaces which are not corresponding to platformSurface tiles, like TextureMapperPlatformLayer's.
1174 for (unsigned n = 0; n < m_freePlatformSurfaces.size(); ++n)
1175 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::FreePlatformSurface(m_freePlatformSurfaces[n].layerID, m_freePlatformSurfaces[n].platformSurfaceId), m_drawingAreaProxy->page()->pageID());
1177 m_freePlatformSurfaces.clear();
1180 bool WebLayerTreeRendererTizen::hasPlatformSurfaceToFree()
1182 if (m_backingStoresWithPendingBuffers.size() > 0)
1185 if (m_freePlatformSurfaces.isEmpty())
1191 void WebLayerTreeRendererTizen::updatePlatformSurfaceTile(WebLayerID layerID, int tileID, const IntRect& sourceRect, int platformSurfaceId, const IntSize& platformSurfaceSize)
1193 if (!platformSurfaceId)
1196 m_drawingAreaProxy->page()->makeContextCurrent();
1198 RefPtr<LayerBackingStoreTizen> backingStore = static_cast<LayerBackingStoreTizen*>(getBackingStore(layerID).get());
1199 backingStore->updatePlatformSurfaceTile(tileID, sourceRect, sourceRect, layerID, platformSurfaceId, platformSurfaceSize, m_textureMapper.get());
1200 if (!m_backingStoresWithPendingBuffers.contains(backingStore))
1201 m_backingStoresWithPendingBuffers.add(backingStore);
1204 void WebLayerTreeRendererTizen::freePlatformSurfacesAfterClearingBackingStores()
1206 // Before calling this function, destroying BackingStores should be done,
1207 // because platformSurfacesToFree is filled in ~LayerBackingStore().
1209 RefPtr<PlatformSurfaceTexturePool> platformSurfaceTexturePool = m_drawingAreaProxy->page()->process()->platformSurfaceTexturePool();
1210 Vector<int> platformSurfacesToFree = platformSurfaceTexturePool->platformSurfacesToFree();
1212 for (unsigned n = 0; n < platformSurfacesToFree.size(); ++n)
1213 // Actually, m_rootLayerID is not correct for all platformSurfaces.
1214 // But LayerTreeCoordinator::freePlatformSurface() doesn't care layerID for HTML contents layers
1215 // so any dummy layerID is okay for now.
1216 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::FreePlatformSurface(m_rootLayerID, platformSurfacesToFree[n]), m_drawingAreaProxy->page()->pageID());
1218 platformSurfaceTexturePool->clearPlatformSurfacesToFree();
1221 void WebLayerTreeRendererTizen::clearPlatformLayerPlatformSurfaces()
1223 PlatformLayerPlatformSurfaceMap::iterator end = m_platformLayerPlatformSurfaces.end();
1224 for (PlatformLayerPlatformSurfaceMap::iterator it = m_platformLayerPlatformSurfaces.begin(); it != end; ++it)
1225 m_drawingAreaProxy->page()->process()->send(Messages::LayerTreeCoordinator::RemovePlatformSurface(it->second, it->first), m_drawingAreaProxy->page()->pageID());
1227 m_platformLayerPlatformSurfaces.clear();
1230 void WebLayerTreeRendererTizen::renderNextFrame()
1232 WebLayerTreeRenderer::renderNextFrame();
1235 void WebLayerTreeRendererTizen::purgeBackingStores()
1237 WebLayerTreeRenderer::purgeBackingStores();
1239 #endif // ENABLE(TIZEN_WEBKIT2_TILED_AC_SHARED_PLATFORM_SURFACE)
1241 } // namespace WebKit
1243 #endif // USE(UI_SIDE_COMPOSITING)