javauis/lcdui_akn/lcdgr/src/CMIDGraphics.cpp
branchRCL_3
changeset 77 7cee158cb8cd
parent 66 2455ef1f5bbc
child 83 26b2b12093af
equal deleted inserted replaced
71:d5e927d5853b 77:7cee158cb8cd
   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             
   137 #else // !RD_JAVA_NGA_ENABLED
   143 #else // !RD_JAVA_NGA_ENABLED
   138 TBool CMIDGraphics::ProcessL(
   144 TBool CMIDGraphics::ProcessL(
   139     const TMIDBufferOp*& aRead, const TMIDBufferOp* aEnd,
   145     const TMIDBufferOp*& aRead, const TMIDBufferOp* aEnd,
   140     TInt& /*aCycles*/, TRequestStatus* /*aStatus*/)
   146     TInt& /*aCycles*/, TRequestStatus* /*aStatus*/)
   141 {
   147 {
   348                 static_cast<const CMIDImage&>(*static_cast<MMIDImage*>(component));
   354                 static_cast<const CMIDImage&>(*static_cast<MMIDImage*>(component));
   349             const CLcdImage& image = proxy.Image();
   355             const CLcdImage& image = proxy.Image();
   350 #ifndef RD_JAVA_NGA_ENABLED
   356 #ifndef RD_JAVA_NGA_ENABLED
   351             graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor);
   357             graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor);
   352 #else // RD_JAVA_NGA_ENABLED
   358 #else // RD_JAVA_NGA_ENABLED
   353             graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor, eglAvailable);
   359             graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor, premultiplied);
   354             if (eglAvailable)
   360             if (eglAvailable)
   355             {
   361             {
   356                 UpdateRect(CalcDstRect(
   362                 UpdateRect(CalcDstRect(
   357                                drawImage->iPoint, image.Size(), ETransNone,
   363                                drawImage->iPoint, image.Size(), ETransNone,
   358                                (::TAnchor)drawImage->iAnchor));
   364                                (::TAnchor)drawImage->iAnchor));
   376                 drawRegion->iAnchor);
   382                 drawRegion->iAnchor);
   377 #else // RD_JAVA_NGA_ENABLED
   383 #else // RD_JAVA_NGA_ENABLED
   378             graphics.DrawRegion(
   384             graphics.DrawRegion(
   379                 image, drawRegion->iSrcPosition, drawRegion->iSrcSize,
   385                 image, drawRegion->iSrcPosition, drawRegion->iSrcSize,
   380                 drawRegion->iTransform, drawRegion->iDstPoint,
   386                 drawRegion->iTransform, drawRegion->iDstPoint,
   381                 drawRegion->iAnchor, eglAvailable);
   387                 drawRegion->iAnchor, premultiplied);
   382             if (eglAvailable)
   388             if (eglAvailable)
   383             {
   389             {
   384                 UpdateRect(CalcDstRect(drawRegion->iDstPoint, drawRegion->iSrcSize,
   390                 UpdateRect(CalcDstRect(drawRegion->iDstPoint, drawRegion->iSrcSize,
   385                                        (TTransformType)drawRegion->iTransform,
   391                                        (TTransformType)drawRegion->iTransform,
   386                                        (::TAnchor)drawRegion->iAnchor));
   392                                        (::TAnchor)drawRegion->iAnchor));
   493     if (IsEglAvailable())
   499     if (IsEglAvailable())
   494     {
   500     {
   495         premultiplied = ETrue;
   501         premultiplied = ETrue;
   496         UpdateRect(aRect);
   502         UpdateRect(aRect);
   497     }
   503     }
       
   504     
       
   505     // Video overlay support
       
   506     if (iCanvasTarget && iCanvasTarget->IsVideoOverlayActive())
       
   507     {
       
   508         premultiplied = ETrue;
       
   509     }
   498 #endif
   510 #endif
   499 
   511 
   500     err = iGraphics->DrawPixels(aType, aAddress, aLength, aScanLength,
   512     err = iGraphics->DrawPixels(aType, aAddress, aLength, aScanLength,
   501                                 aAlpha, aRect.iTl, size, aTransform, premultiplied);
   513                                 aAlpha, aRect.iTl, size, aTransform, premultiplied);
   502     iGraphics->End();
   514     iGraphics->End();