modules/graphics/src/main/java/com/sun/prism/sw/SWPresentable.java
Print this page
*** 23,33 ****
* questions.
*/
package com.sun.prism.sw;
- import com.sun.glass.ui.Application;
import com.sun.glass.ui.Pixels;
import com.sun.javafx.geom.Rectangle;
import com.sun.prism.Presentable;
import com.sun.prism.PresentableState;
import com.sun.prism.impl.QueuedPixelSource;
--- 23,32 ----
*** 35,45 ****
final class SWPresentable extends SWRTTexture implements Presentable {
private final PresentableState pState;
private Pixels pixels;
! private QueuedPixelSource pixelSource = new QueuedPixelSource();
public SWPresentable(PresentableState pState, SWResourceFactory factory) {
super(factory, pState.getWidth(), pState.getHeight());
this.pState = pState;
}
--- 34,44 ----
final class SWPresentable extends SWRTTexture implements Presentable {
private final PresentableState pState;
private Pixels pixels;
! private QueuedPixelSource pixelSource = new QueuedPixelSource(false);
public SWPresentable(PresentableState pState, SWResourceFactory factory) {
super(factory, pState.getWidth(), pState.getHeight());
this.pState = pState;
}
*** 56,74 ****
* TODO: make sure the imgrep matches the Pixels.getNativeFormat()
* TODO: dirty region support
*/
int w = getPhysicalWidth();
int h = getPhysicalHeight();
! pixelSource.validate(w, h, 1.0f);
! pixels = pixelSource.getUnusedPixels();
! IntBuffer pixBuf;
! if (pixels != null) {
! pixBuf = (IntBuffer) pixels.getPixels();
! } else {
! pixBuf = IntBuffer.allocate(w*h);
! pixels = Application.GetApplication().createPixels(w, h, pixBuf);
! }
IntBuffer buf = getSurface().getDataIntBuffer();
assert buf.hasArray();
System.arraycopy(buf.array(), 0, pixBuf.array(), 0, w*h);
return true;
} else {
--- 55,66 ----
* TODO: make sure the imgrep matches the Pixels.getNativeFormat()
* TODO: dirty region support
*/
int w = getPhysicalWidth();
int h = getPhysicalHeight();
! pixels = pixelSource.getUnusedPixels(w, h, 1.0f);
! IntBuffer pixBuf = (IntBuffer) pixels.getPixels();
IntBuffer buf = getSurface().getDataIntBuffer();
assert buf.hasArray();
System.arraycopy(buf.array(), 0, pixBuf.array(), 0, w*h);
return true;
} else {