void WebRenderBridgeParent::ProcessWebRenderCommands(const gfx::IntSize &aSize, InfallibleTArray<WebRenderParentCommand>& aCommands, const wr::Epoch& aEpoch, const wr::LayoutSize& aContentSize, const wr::ByteBuffer& dl, const wr::BuiltDisplayListDescriptor& dlDesc, const wr::IdNamespace& aIdNamespace) { mAsyncImageManager->SetCompositionTime(TimeStamp::Now()); ProcessWebRenderParentCommands(aCommands); // The command is obsoleted. // Do not set the command to webrender since it causes crash in webrender. if (mIdNamespace != aIdNamespace) { return; } if (mWidget) { LayoutDeviceIntSize size = mWidget->GetClientSize(); mApi->SetWindowParameters(size); } gfx::Color color = mWidget ? gfx::Color(0.3f, 0.f, 0.f, 1.f) : gfx::Color(0.f, 0.f, 0.f, 0.f); mApi->SetRootDisplayList(color, aEpoch, LayerSize(aSize.width, aSize.height), mPipelineId, aContentSize, dlDesc, dl.mData, dl.mLength); ScheduleComposition(); DeleteOldImages(); if (ShouldParentObserveEpoch()) { mCompositorBridge->ObserveLayerUpdate(GetLayersId(), GetChildLayerObserverEpoch(), true); } }
// ----------------------------------------------------------------------------- // CAknsAlEffectContext::CreateIfNeededL // ----------------------------------------------------------------------------- // void CAknsAlEffectContext::CreateIfNeededL( const TInt aLayerIndex, const TInt aLayerStatus, const TBool aInitialize ) { if( ( aLayerIndex < 0 ) || ( aLayerIndex >= KAknsAlEffectContextLayerN ) ) { User::Leave( KAknsRlErrBadLayerIndex ); } /*lint -save -e661 */ // Index is boundary checked above if( iLayers[aLayerIndex].iRGBBitmap && iLayers[aLayerIndex].iAlphaBitmap ) return; if( iLayers[aLayerIndex].iRGBBitmap || iLayers[aLayerIndex].iAlphaBitmap ) User::Leave( KAknsRlErrInternalState ); TSize size = LayerSize(); CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); CleanupStack::PushL( bitmap ); User::LeaveIfError( bitmap->Create( size, iRgbMode ) ); CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL( bitmap ); CleanupStack::PushL( dev ); CFbsBitGc* gc = CFbsBitGc::NewL(); CleanupStack::PushL( gc ); gc->Activate( dev ); iLayers[aLayerIndex].iRGBBitmap = bitmap; iLayers[aLayerIndex].iRGBDevice = dev; iLayers[aLayerIndex].iRGBGc = gc; CleanupStack::Pop(3); // gc, dev, bitmap bitmap = new (ELeave) CFbsBitmap(); CleanupStack::PushL( bitmap ); User::LeaveIfError( bitmap->Create( size, EGray256 ) ); dev = CFbsBitmapDevice::NewL( bitmap ); CleanupStack::PushL( dev ); gc = CFbsBitGc::NewL(); CleanupStack::PushL( gc ); gc->Activate( dev ); iLayers[aLayerIndex].iAlphaBitmap = bitmap; iLayers[aLayerIndex].iAlphaDevice = dev; iLayers[aLayerIndex].iAlphaGc = gc; CleanupStack::Pop(3); // gc, dev, bitmap if( aInitialize ) { switch( aLayerStatus ) { case KAknsRlLayerRGBOnly: iLayers[aLayerIndex].iRGBGc->SetBrushColor( KRgbBlack ); iLayers[aLayerIndex].iRGBGc->Clear(); iLayers[aLayerIndex].iAlphaGc->SetBrushColor( KRgbWhite ); iLayers[aLayerIndex].iAlphaGc->Clear(); break; default: iLayers[aLayerIndex].iRGBGc->SetBrushColor( KRgbBlack ); iLayers[aLayerIndex].iRGBGc->Clear(); iLayers[aLayerIndex].iAlphaGc->SetBrushColor( KRgbBlack ); iLayers[aLayerIndex].iAlphaGc->Clear(); break; } } /*lint -restore */ }//lint !e661 Layer index is boundary checked
typename std::enable_if<I < sizeof...(Tp), size_t>::type NetworkSize(std::tuple<Tp...>& network) { return LayerSize(std::get<I>(network), std::get<I>( network).OutputParameter()) + NetworkSize<I + 1, Tp...>(network); }