modules/graphics/src/main/java/com/sun/glass/ui/monocle/MonoclePixels.java

Print this page




  24  */
  25 
  26 package com.sun.glass.ui.monocle;
  27 
  28 import com.sun.glass.ui.Pixels;
  29 
  30 import java.nio.Buffer;
  31 import java.nio.ByteBuffer;
  32 import java.nio.IntBuffer;
  33 
  34 final class MonoclePixels extends Pixels {
  35 
  36     MonoclePixels(int width, int height, ByteBuffer data) {
  37         super(width, height, data);
  38     }
  39 
  40     MonoclePixels(int width, int height, IntBuffer data) {
  41         super(width, height, data);
  42     }
  43 
  44     MonoclePixels(int width, int height, IntBuffer data, float scale) {
  45         super(width, height, data, scale);
  46     }
  47 
  48 
  49     private void _copyPixels(Buffer dst, Buffer src, int size) {
  50         throw new UnsupportedOperationException("not implemented");
  51     }
  52 
  53     @Override protected void _fillDirectByteBuffer(ByteBuffer bb) {
  54         if (this.bytes != null) {
  55             this.bytes.rewind();
  56             if (this.bytes.isDirect()) {
  57                 _copyPixels(bb, this.bytes, getWidth() * getHeight());
  58             } else {
  59                 bb.put(this.bytes);
  60             }
  61             this.bytes.rewind();
  62         } else {
  63             this.ints.rewind();
  64             if (this.ints.isDirect()) {
  65                 _copyPixels(bb, this.ints, getWidth() * getHeight());




  24  */
  25 
  26 package com.sun.glass.ui.monocle;
  27 
  28 import com.sun.glass.ui.Pixels;
  29 
  30 import java.nio.Buffer;
  31 import java.nio.ByteBuffer;
  32 import java.nio.IntBuffer;
  33 
  34 final class MonoclePixels extends Pixels {
  35 
  36     MonoclePixels(int width, int height, ByteBuffer data) {
  37         super(width, height, data);
  38     }
  39 
  40     MonoclePixels(int width, int height, IntBuffer data) {
  41         super(width, height, data);
  42     }
  43 
  44     MonoclePixels(int width, int height, IntBuffer data, float scalex, float scaley) {
  45         super(width, height, data, scalex, scaley);
  46     }
  47 
  48 
  49     private void _copyPixels(Buffer dst, Buffer src, int size) {
  50         throw new UnsupportedOperationException("not implemented");
  51     }
  52 
  53     @Override protected void _fillDirectByteBuffer(ByteBuffer bb) {
  54         if (this.bytes != null) {
  55             this.bytes.rewind();
  56             if (this.bytes.isDirect()) {
  57                 _copyPixels(bb, this.bytes, getWidth() * getHeight());
  58             } else {
  59                 bb.put(this.bytes);
  60             }
  61             this.bytes.rewind();
  62         } else {
  63             this.ints.rewind();
  64             if (this.ints.isDirect()) {
  65                 _copyPixels(bb, this.ints, getWidth() * getHeight());