void TreeManager::updateScrollableLayerInTree(Layer* tree, int layerId, int x, int y) { LayerAndroid* layer; if (tree && tree->countChildren()) { layer = static_cast<LayerAndroid*>(tree->getChild(0))->findById(layerId); if (layer && layer->contentIsScrollable()) static_cast<ScrollableLayerAndroid*>(layer)->scrollTo(x, y); } }
void PaintedSurface::computeTexturesAmount(TexturesResult* result) { if (!m_tiledTexture) return; // for now, always done on drawinglayer LayerAndroid* layer = m_drawingLayer; if (!layer) return; IntRect unclippedArea = layer->unclippedArea(); IntRect clippedVisibleArea = layer->visibleArea(); // get two numbers here: // - textures needed for a clipped area // - textures needed for an un-clipped area int nbTexturesUnclipped = m_tiledTexture->nbTextures(unclippedArea, m_scale); int nbTexturesClipped = m_tiledTexture->nbTextures(clippedVisibleArea, m_scale); // Set kFixedLayers level if (layer->isFixed()) result->fixed += nbTexturesClipped; // Set kScrollableAndFixedLayers level if (layer->contentIsScrollable() || layer->isFixed()) result->scrollable += nbTexturesClipped; // Set kClippedTextures level result->clipped += nbTexturesClipped; // Set kAllTextures level if (layer->contentIsScrollable()) result->full += nbTexturesClipped; else result->full += nbTexturesUnclipped; }
void SurfaceCollection::updateScrollableLayer(int layerId, int x, int y) { LayerAndroid* layer = m_compositedRoot->findById(layerId); if (layer && layer->contentIsScrollable()) static_cast<ScrollableLayerAndroid*>(layer)->scrollTo(x, y); }