javauis/lcdui_akn/lcdgr/src/CMIDGraphics.cpp
branchRCL_3
changeset 83 26b2b12093af
parent 77 7cee158cb8cd
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
   132     {
   132     {
   133         // Egl is available so bounding boxes of 2D primitives
   133         // Egl is available so bounding boxes of 2D primitives
   134         // need to be calculated.
   134         // need to be calculated.
   135         eglAvailable = ETrue;
   135         eglAvailable = ETrue;
   136     }
   136     }
   137     
       
   138     // Use premultiplied colors in target bitmap if
       
   139     // EGL surface is in use or Canvas has video overlay active.
       
   140     TBool premultiplied = eglAvailable || 
       
   141             (iCanvasTarget && iCanvasTarget->IsVideoOverlayActive());
       
   142             
       
   143 #else // !RD_JAVA_NGA_ENABLED
   137 #else // !RD_JAVA_NGA_ENABLED
   144 TBool CMIDGraphics::ProcessL(
   138 TBool CMIDGraphics::ProcessL(
   145     const TMIDBufferOp*& aRead, const TMIDBufferOp* aEnd,
   139     const TMIDBufferOp*& aRead, const TMIDBufferOp* aEnd,
   146     TInt& /*aCycles*/, TRequestStatus* /*aStatus*/)
   140     TInt& /*aCycles*/, TRequestStatus* /*aStatus*/)
   147 {
   141 {
   354                 static_cast<const CMIDImage&>(*static_cast<MMIDImage*>(component));
   348                 static_cast<const CMIDImage&>(*static_cast<MMIDImage*>(component));
   355             const CLcdImage& image = proxy.Image();
   349             const CLcdImage& image = proxy.Image();
   356 #ifndef RD_JAVA_NGA_ENABLED
   350 #ifndef RD_JAVA_NGA_ENABLED
   357             graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor);
   351             graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor);
   358 #else // RD_JAVA_NGA_ENABLED
   352 #else // RD_JAVA_NGA_ENABLED
   359             graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor, premultiplied);
   353             graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor, eglAvailable);
   360             if (eglAvailable)
   354             if (eglAvailable)
   361             {
   355             {
   362                 UpdateRect(CalcDstRect(
   356                 UpdateRect(CalcDstRect(
   363                                drawImage->iPoint, image.Size(), ETransNone,
   357                                drawImage->iPoint, image.Size(), ETransNone,
   364                                (::TAnchor)drawImage->iAnchor));
   358                                (::TAnchor)drawImage->iAnchor));
   382                 drawRegion->iAnchor);
   376                 drawRegion->iAnchor);
   383 #else // RD_JAVA_NGA_ENABLED
   377 #else // RD_JAVA_NGA_ENABLED
   384             graphics.DrawRegion(
   378             graphics.DrawRegion(
   385                 image, drawRegion->iSrcPosition, drawRegion->iSrcSize,
   379                 image, drawRegion->iSrcPosition, drawRegion->iSrcSize,
   386                 drawRegion->iTransform, drawRegion->iDstPoint,
   380                 drawRegion->iTransform, drawRegion->iDstPoint,
   387                 drawRegion->iAnchor, premultiplied);
   381                 drawRegion->iAnchor, eglAvailable);
   388             if (eglAvailable)
   382             if (eglAvailable)
   389             {
   383             {
   390                 UpdateRect(CalcDstRect(drawRegion->iDstPoint, drawRegion->iSrcSize,
   384                 UpdateRect(CalcDstRect(drawRegion->iDstPoint, drawRegion->iSrcSize,
   391                                        (TTransformType)drawRegion->iTransform,
   385                                        (TTransformType)drawRegion->iTransform,
   392                                        (::TAnchor)drawRegion->iAnchor));
   386                                        (::TAnchor)drawRegion->iAnchor));
   499     if (IsEglAvailable())
   493     if (IsEglAvailable())
   500     {
   494     {
   501         premultiplied = ETrue;
   495         premultiplied = ETrue;
   502         UpdateRect(aRect);
   496         UpdateRect(aRect);
   503     }
   497     }
   504     
       
   505     // Video overlay support
       
   506     if (iCanvasTarget && iCanvasTarget->IsVideoOverlayActive())
       
   507     {
       
   508         premultiplied = ETrue;
       
   509     }
       
   510 #endif
   498 #endif
   511 
   499 
   512     err = iGraphics->DrawPixels(aType, aAddress, aLength, aScanLength,
   500     err = iGraphics->DrawPixels(aType, aAddress, aLength, aScanLength,
   513                                 aAlpha, aRect.iTl, size, aTransform, premultiplied);
   501                                 aAlpha, aRect.iTl, size, aTransform, premultiplied);
   514     iGraphics->End();
   502     iGraphics->End();