I wonder how it compiles?
I tried a small program
------------------
public class Test {
        AccelSurface b = new AccelSurface();
        SurfaceData c = (SurfaceData)b;
}

class SurfaceData extends Surface {}
class Surface {}
class AccelSurface extends Surface {}
---------
and it fails to compile
Test.java:3: error: incompatible types: AccelSurface cannot be converted to SurfaceData
    SurfaceData c = (SurfaceData)b;

ANyways, did you check with opengl pipeline? It seems getDefaultScaleX/Y is not present in OGLSurfaceData which will result in falling back to SurfaceData in which case the scale will be 1.

Regards
Prasanta
On 8/18/2016 3:12 PM, Prem Balakrishnan wrote:

Added “2d-dev” team for review

Regards,

Prem

*From:*Alexandr Scherbatiy
*Sent:* Thursday, August 18, 2016 2:57 PM
*To:* Prem Balakrishnan; Rajeev Chamyal; awt-...@openjdk.java.net; Sergey Bylokhov *Subject:* Re: Review Request: JDK-8144735 [hidpi] javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java fails

Could you also send the review to the 2d-dev alias?

Thanks,
Alexandr.

On 8/18/2016 9:59 AM, Prem Balakrishnan wrote:

    Hi Alexandr,

    AccelSurface is implemented by *ONLY* D3DSurfaceData and
    OGLSurfaceData classes,

    Both of these classes extend SurfaceData as well.

    Hence, casting of 'as' variable which is of type AccelSurface
    object to SurfaceData is always VALID.

    Regards,
    Prem

    *From:*Alexandr Scherbatiy
    *Sent:* Wednesday, August 17, 2016 4:42 PM
    *To:* Prem Balakrishnan; Rajeev Chamyal; awt-...@openjdk.java.net
    <mailto:awt-...@openjdk.java.net>; Sergey Bylokhov
    *Subject:* Re: Review Request: JDK-8144735 [hidpi]
    
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java
    fails

    On 8/17/2016 11:30 AM, Prem Balakrishnan wrote:


    Hi Alexandr,

    Thankyou for the review.

    YES scaled SurfaceData returns proper scale values from
    getDefaultScaleX()/getDefaultScaleY(), which I have used in the
    current patch.

    Please review the updated patch

    http://cr.openjdk.java.net/~pkbalakr/8144735/webrev.02/
    <http://cr.openjdk.java.net/%7Epkbalakr/8144735/webrev.02/>

      Is it always true that the 'as' variable which has type
    AccelSurface in the fix is always instance of SurfaceData?

      Thanks,
      Alexandr.


    Regards,
    Prem

    *From:*Alexandr Scherbatiy
    *Sent:* Tuesday, August 16, 2016 10:06 PM
    *To:* Prem Balakrishnan; Rajeev Chamyal; awt-...@openjdk.java.net
    <mailto:awt-...@openjdk.java.net>; Sergey Bylokhov
    *Subject:* Re: Review Request: JDK-8144735 [hidpi]
    
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java
    fails

    On 8/16/2016 7:35 AM, Prem Balakrishnan wrote:



    Reminder

    *From:*Prem Balakrishnan
    *Sent:* Friday, August 12, 2016 6:36 PM
    *To:* Alexander Scherbatiy; Rajeev Chamyal;
    awt-...@openjdk.java.net <mailto:awt-...@openjdk.java.net>; Sergey
    Bylokhov
    *Subject:* RE: Review Request: JDK-8144735 [hidpi]
    
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java
    fails

    Hi Alexandr and Sergey,

    Please review the updated patch.

    http://cr.openjdk.java.net/~pkbalakr/8144735/webrev.01/
    <http://cr.openjdk.java.net/%7Epkbalakr/8144735/webrev.01/>

    >>“It is a little bit strange bug, because VolatileImage should
    handle this scale internally, and create double sized surface when
    necessary”.-Sergey

    Yes as you mentioned Volatile Image is getting scaled internally.
    Thanks for the feedback.

    *Cause:*In VIOptWindowPainter::updateWindowAccel(psdops, w, h)
    call, width and height were passed without scaling,

    which was creating a bitmap of specified width and height, hence
    the output was clipped.


      I just have two general questions.
      - The scaled SurfaceData should return proper scales from
    getDefaultScaleX()/getDefaultScaleY() methods. Do these methods
    return right values after setting the scaled image sizes in the fix?
      - Region.clipScale() which is used in many places rounds values.
    The usual rule is to use Math.floor() for image coordinates
    rounding and Math.ceil() for sizes.
        Should the same rule be applicable here?

      Thanks,
      Alexandr.





    Regards,

    Prem

    *From:*Alexandr Scherbatiy
    *Sent:* Thursday, August 04, 2016 6:23 PM
    *To:* Prem Balakrishnan; Rajeev Chamyal; awt-...@openjdk.java.net
    <mailto:awt-...@openjdk.java.net>; Sergey Bylokhov
    *Subject:* Re: Review Request: JDK-8144735 [hidpi]
    
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java
    fails

    On 8/3/2016 10:04 AM, Prem Balakrishnan wrote:

    Hi,

    Please review fix for JDK9,

    *Bug:*https://bugs.openjdk.java.net/browse/JDK-8144735

    *Webrev:*http://cr.openjdk.java.net/~pkbalakr/8144735/webrev.00/
    <http://cr.openjdk.java.net/%7Epkbalakr/8144735/webrev.00/>

    *Issue:*

    
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java
    fails

    *Cause:*

    While creating Transparent VolatileImage, width and height was NOT
    hidpi scaled.

    *Fix: *VolatileImage width and height are scaled.


       I believe this is an issue in AWT and needs to be discussed on
    awt-dev alias.

       Should the backbuffer width and height be also scaled for the
    BIWindowPainter?

      Thanks,
      Alexandr.

    Thanks,

    Prem


Reply via email to