Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-84

The opacity of a shape is not applied when using vglite with NXP MIMXRT1170-EVK

    XMLWordPrintable

Details

    • 2bcabe5d
    • Platform Sprint 4.5/2021

    Description

      When drawing a Shape the ShapeNode::render calls blendPath with the opacity of the shapeNode as sourceOpacity parameter (const int sourceOpacity = qRound(opacity * 256)

      The VGLiteDrawingEngine calls then VGLite::blendPath function. Inside this function in vglitesupport.cpp opacity is not used anymore. This means that opacity does not apply for the Shape.

      Comparing this with similar function of cypress board (cygfxbackend.cpp):
      if (fillBrush && fillBrush->pattern() == Qul::PlatformInterface::Brush::SolidPattern)

      { auto color = fillBrush->color(); color.setAlpha(color.alpha() * (sourceOpacity * (1 / 256.f))); drawPathData(ctx, path->fillPathData(), transform.translation(), path->fillRule, color); }

      makes me to believe that the same should be done in vglitesupport.cpp as well.

      For example:

       if (fillBrush) { 
      PlatformInterface::Rgba32 fillColor = fillBrush->color();
      fillColor.setAlpha(fillColor.alpha() * (sourceOpacity * (1 / 256.f)));
      destinationPath->processFillPath();

      and similarly for the strokeBrush.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kamil.bielarczyk Kamil Bielarczyk
            foxxx Tuukka Kettunen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes