#define ENABLE_TIZEN_WEBKIT2_DEBUG_BORDERS 1 /* Hyowon Kim(hw1008.kim@samsung.com) : Renders a border around composited Render Layers to help debug and study layer compositing. */
#define ENABLE_TIZEN_WEBKIT2_TILED_AC 1 /* Youngtaeck Song(youngtaeck.song@samsung.com) : Tiling with Acceletated compositing for Tizen */
#define ENABLE_TIZEN_WEBKIT2_TILED_AC_UPDATE_ONLY_VIEWPORT_AFTER_ZOOM 1 /* JungJik Lee(jungjik.lee@samsung.com) : WK2 Update the viewport area after zooming. */
+#define ENABLE_TIZEN_WEBKIT2_TILED_AC_LIMIT_COMPOSITING 1 /* Seojin Kim(seojin.kim@samsung.com) : limit compositing */
#define ENABLE_TIZEN_WEB_LAYER_TREE_RENDERER_FUNCTION_NAME_BUG_FIX 1 /* YongGeol Jung(yg48.jung@samsung.com) : Fix wrong function name of WebLayerTreeRenderer */
#define ENABLE_TIZEN_ONESHOT_DRAWING_SYNCHRONIZATION 1 /* Hyowon Kim(hw1008.kim@samsung.com) : Fix layer flickering */
#define ENABLE_TIZEN_DONT_USE_TEXTURE_MAPPER_TEXTURE_POOL 1 /* Seojin Kim(seojin.kim@samsung.com) : TextureMapper texture pool has no shrink mechanism currently, and leads to OOM finally */
, m_obligatoryBackingAreaMegaPixels(0)
, m_secondaryBackingAreaMegaPixels(0)
#endif
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_LIMIT_COMPOSITING)
+ , m_compositingAllowed(true)
+#endif
{
}
return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0);
}
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_LIMIT_COMPOSITING)
+void RenderLayerCompositor::countLayersWhichWillBeComposited(RenderLayer* layer, int& count)
+{
+ if (!layer)
+ return;
+
+ if (needsToBeComposited(layer))
+ count++;
+
+ for (RenderLayer* currLayer = layer->firstChild(); currLayer; currLayer = currLayer->nextSibling())
+ countLayersWhichWillBeComposited(currLayer, count);
+}
+
+void RenderLayerCompositor::disallowCompositingIfNeeded()
+{
+ m_compositingAllowed = true;
+
+ int willBeCompositedLayersCount = 0;
+ countLayersWhichWillBeComposited(rootRenderLayer(), willBeCompositedLayersCount);
+ if (willBeCompositedLayersCount > 100)
+ m_compositingAllowed = false;
+}
+#endif
+
void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot)
{
m_updateCompositingLayersTimer.stop();
if (!m_reevaluateCompositingAfterLayout && !m_compositing)
return;
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_LIMIT_COMPOSITING)
+ disallowCompositingIfNeeded();
+#endif
+
AnimationUpdateBlock animationUpdateBlock(m_renderView->frameView()->frame()->animation());
bool checkForHierarchyUpdate = m_reevaluateCompositingAfterLayout;
// Host the document layer in the RenderView's root layer.
if (isFullUpdate) {
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_LIMIT_COMPOSITING)
+ ensureRootLayer();
+#endif
// Even when childList is empty, don't drop out of compositing mode if there are
// composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(updateRoot))
// most of the time, geometry is updated via RenderLayer::styleChanged().
updateLayerTreeGeometry(updateRoot, 0);
}
-
+
#if !LOG_DISABLED
if (compositingLogEnabled() && isFullUpdate && (needHierarchyUpdate || needGeometryUpdate)) {
double endTime = currentTime();
bool RenderLayerCompositor::canBeComposited(const RenderLayer* layer) const
{
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_LIMIT_COMPOSITING)
+ if (!m_compositingAllowed) return false;
+#endif
// FIXME: We disable accelerated compositing for elements in a RenderFlowThread as it doesn't work properly.
// See http://webkit.org/b/84900 to re-enable it.
return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && !layer->renderer()->inRenderFlowThread();
void unregisterAllScrollingLayers();
#endif
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_LIMIT_COMPOSITING)
+ void countLayersWhichWillBeComposited(RenderLayer* layer, int& count);
+ void disallowCompositingIfNeeded();
+#endif
+
private:
class OverlapMap;
bool m_compositingLayersNeedRebuild;
bool m_flushingLayers;
bool m_forceCompositingMode;
+#if ENABLE(TIZEN_WEBKIT2_TILED_AC_LIMIT_COMPOSITING)
+ bool m_compositingAllowed;
+#endif
RootLayerAttachment m_rootLayerAttachment;