Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7172187

[macosx] JAWT native CALayer not positioned over Canvas

    XMLWordPrintable

Details

    • b55
    • x86
    • os_x
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        java version "1.7.0_06-ea"
        Java(TM) SE Runtime Environment (build 1.7.0_06-ea-b10)
        Java HotSpot(TM) 64-Bit Server VM (build 23.2-b01, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        10.7.4

        A DESCRIPTION OF THE PROBLEM :
        When a CALayer is attached to an AWT Canvas via

        id <JAWT_SurfaceLayers> surfaceLayers = (id <JAWT_SurfaceLayers>) dsi->platformInfo;
        CALayer *layer = [[CALayer alloc] init];
        CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB ();
        CGFloat rgba[4] = {1.0, 0.0, 0.0, 0.5};
        CGColorRef color = CGColorCreate (colorspace, rgba);
        layer.backgroundColor = color;
        surfaceLayers.layer = layer;

        That CALayer is not positioned over the Canvas. It is instead positioned in the lower-left corner of the window. With the layer created in the above code fragment, we will see a red semi-transparent rectangle the size of the Canvas but positioned in the lower-left corner of the window. With Apple's Java 6, we see a red semi-transparent rectangle both the size of the canvas and positioned over the Canvas.

        REGRESSION. Last worked in version 6u31

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Attach a CALayer to a Canvas using the code fragment given in the description.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        A red semi-transparent rectangle the size of the canvas rendered over the Canvas in the window.
        ACTUAL -
        A red semi-transparent rectangle the size of the canvas rendered in the lower-left corner of the window.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        This modified version of Apple's JAWT example code demonstrates the issue:
        http://www.jeffsplace.net/JAWTExample.tar.gz

          To build, run build.sh.
          To run on Java 6, run run-java6.sh, for Java 7, run-java7.sh

        JAVA_HOME may need modification in build.sh and run-java7.sh to point to the appropriate Java 7 home.
        ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

                serb Sergey Bylokhov
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: