public void finalizeLayers(final LayoutProvider provider,boolean forRotation,final DrawingInfo progressBarDrawingInfo){
  TraceEvent.begin("CompositorView:finalizeLayers");
  Layout layout=provider.getActiveLayout();
  if (layout == null || mNativeCompositorView == 0) {
    TraceEvent.end("CompositorView:finalizeLayers");
    return;
  }
  if (!mPreloadedResources) {
    mResourceManager.preloadResources(AndroidResourceType.STATIC,StaticResourcePreloads.getSynchronousResources(getContext()),StaticResourcePreloads.getAsynchronousResources(getContext()));
    mPreloadedResources=true;
  }
  mRenderHost.getVisibleViewport(mCacheVisibleViewport);
  provider.getViewportPixel(mCacheViewport);
  nativeSetLayoutViewport(mNativeCompositorView,mCacheViewport.left,mCacheViewport.top,mCacheViewport.width(),mCacheViewport.height(),mCacheVisibleViewport.left,mCacheVisibleViewport.top,mRenderHost.getCurrentOverdrawBottomHeight(),1.0f);
  mCacheVisibleViewport.right=mCacheVisibleViewport.left + mSurfaceWidth;
  mCacheVisibleViewport.bottom=mCacheVisibleViewport.top + Math.max(mSurfaceHeight - mRenderHost.getCurrentOverdrawBottomHeight(),0);
  updateToolbarLayer(provider,forRotation,progressBarDrawingInfo);
  SceneLayer sceneLayer=provider.getUpdatedActiveSceneLayer(mCacheViewport,mCacheVisibleViewport,mLayerTitleCache,mTabContentManager,mResourceManager,provider.getFullscreenManager());
  nativeSetSceneLayer(mNativeCompositorView,sceneLayer);
  final LayoutTab[] tabs=layout.getLayoutTabsToRender();
  final int tabsCount=tabs != null ? tabs.length : 0;
  mLastLayerCount=tabsCount;
  TabModelImpl.flushActualTabSwitchLatencyMetric();
  nativeFinalizeLayers(mNativeCompositorView);
  TraceEvent.end("CompositorView:finalizeLayers");
}

public void finalizeLayers ( final LayoutProvider provider , boolean forRotation , final DrawingInfo progressBarDrawingInfo ) { TraceEvent . begin ( "CompositorView:finalizeLayers" ) ; Layout layout = provider . getActiveLayout ( ) ; if ( layout == null || mNativeCompositorView == 0 ) { TraceEvent . end ( "CompositorView:finalizeLayers" ) ; return ; } if ( ! mPreloadedResources ) { mResourceManager . preloadResources ( AndroidResourceType . STATIC , StaticResourcePreloads . getSynchronousResources ( getContext ( ) ) , StaticResourcePreloads . getAsynchronousResources ( getContext ( ) ) ) ; mPreloadedResources = true ; } mRenderHost . getVisibleViewport ( mCacheVisibleViewport ) ; provider . getViewportPixel ( mCacheViewport ) ; nativeSetLayoutViewport ( mNativeCompositorView , mCacheViewport . left , mCacheViewport . top , mCacheViewport . width ( ) , mCacheViewport . height ( ) , mCacheVisibleViewport . left , mCacheVisibleViewport . top , mRenderHost . getCurrentOverdrawBottomHeight ( ) , 1.0f ) ; mCacheVisibleViewport . right = mCacheVisibleViewport . left + mSurfaceWidth ; mCacheVisibleViewport . bottom = mCacheVisibleViewport . top + Math . max ( mSurfaceHeight - mRenderHost . getCurrentOverdrawBottomHeight ( ) , 0 ) ; updateToolbarLayer ( provider , forRotation , progressBarDrawingInfo ) ; SceneLayer sceneLayer = provider . getUpdatedActiveSceneLayer ( mCacheViewport , mCacheVisibleViewport , mLayerTitleCache , mTabContentManager , mResourceManager , provider . getFullscreenManager ( ) ) ; nativeSetSceneLayer ( mNativeCompositorView , sceneLayer ) ; final LayoutTab [ ] tabs = layout . getLayoutTabsToRender ( ) ; final int tabsCount = tabs != null ? tabs . length : 0 ; mLastLayerCount = tabsCount ; TabModelImpl . flushActualTabSwitchLatencyMetric ( ) ; nativeFinalizeLayers ( mNativeCompositorView ) ; TraceEvent . end ( "CompositorView:finalizeLayers" ) ; }
converts the layout into compositor layers . this is to be called on every frame the layout is changing .
