Search in sources :

Example 1 with SceneOverlayLayer

use of org.chromium.chrome.browser.compositor.scene_layer.SceneOverlayLayer in project AndroidChromium by JackyAndroid.

the class Layout method getUpdatedSceneLayer.

/**
     * Build a {@link SceneLayer} if it hasn't already been built, and update it and return it.
     *
     * @param viewport          A viewport in which to display content.
     * @param contentViewport   The visible section of the viewport.
     * @param layerTitleCache   A layer title cache.
     * @param tabContentManager A tab content manager.
     * @param resourceManager   A resource manager.
     * @param fullscreenManager A fullscreen manager.
     * @return                  A {@link SceneLayer} that represents the content for this
     *                          {@link Layout}.
     */
public final SceneLayer getUpdatedSceneLayer(Rect viewport, Rect contentViewport, LayerTitleCache layerTitleCache, TabContentManager tabContentManager, ResourceManager resourceManager, ChromeFullscreenManager fullscreenManager) {
    updateSceneLayer(viewport, contentViewport, layerTitleCache, tabContentManager, resourceManager, fullscreenManager);
    float offsetPx = fullscreenManager != null ? fullscreenManager.getControlOffset() : 0.f;
    float dpToPx = getContext().getResources().getDisplayMetrics().density;
    float offsetDp = offsetPx / dpToPx;
    SceneLayer content = getSceneLayer();
    for (int i = 0; i < mSceneOverlays.size(); i++) {
        // If the SceneOverlay is not showing, don't bother adding it to the tree.
        if (!mSceneOverlays.get(i).isSceneOverlayTreeShowing())
            continue;
        SceneOverlayLayer overlayLayer = mSceneOverlays.get(i).getUpdatedSceneOverlayTree(layerTitleCache, resourceManager, offsetDp);
        overlayLayer.setContentTree(content);
        content = overlayLayer;
    }
    return content;
}
Also used : SceneOverlayLayer(org.chromium.chrome.browser.compositor.scene_layer.SceneOverlayLayer) SceneLayer(org.chromium.chrome.browser.compositor.scene_layer.SceneLayer) Point(android.graphics.Point)

Aggregations

Point (android.graphics.Point)1 SceneLayer (org.chromium.chrome.browser.compositor.scene_layer.SceneLayer)1 SceneOverlayLayer (org.chromium.chrome.browser.compositor.scene_layer.SceneOverlayLayer)1