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

.menu-bar styles may be inefficient for embedded platforms

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 9
    • 8
    • javafx
    • None

      caspian has
           -fx-background-color: linear-gradient(to bottom, derive(-fx-color,50%), derive(-fx-color,-30%)), -fx-body-color
      and modena has
         -fx-background-color:
             linear-gradient(to bottom, derive(-fx-base,75%) 0%, -fx-outer-border 90%),
             linear-gradient(to bottom, derive(-fx-base,46.9%) 2%, derive(-fx-base,-2.1%) 95%);

      Is there a point to overlaying one gradient with the other? The only thing you'll see of the underlying gradient is 1px on the top and bottom (-fx-background-insets: 0 0 0 0, 1 0 1 0; )

      Jasper replies:

      options were to have 3 background colors , using one for top line, one for bottom line and one for center
      or have 2 layers and gradient to get different top line and bottom
      I made trade off that 2 paints of gradients is less cost than 3 paints with 2 being solid
      also with retina we will have 2px top and bottom so gradient gives us chance to have differnt colors in those top and bottom 2px
      though not sure I have taken advantage of this here as menu bar is not used on Mac and Mac is only retina platform so far. But have definattly tuned other controls in this way for retina

      I think overdraw(drawing same pixel many times) on embedded is more of a cost than gradient but I might be wrong
      top and bottom borders would be fastest for embedded so maybe worth making the switch
      if borders are drawn on single sides we optimize to filled rectangles so that would work nicly here

            jgiles Jonathan Giles
            dgrieve David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: