Posted by Clemens Eisserer on Sat 3 Jan 09:55
report abuse | download | new post
- XRRenderQueue queue = new XRRenderQueue(false);
- queue.socketTaken = true;
- while (true) {
- for (int i = 0; i < 1000000; i++) {
- // SunToolkit.awtLock();
- try {
- queue.XRenderRectangle((int) start, XRUtils.PictOpAdd, XRColor.FULL_ALPHA, i, i, i, i);
- } finally {
- // SunToolkit.awtUnlock();
- }
- }
- }
- }
- public final void XRenderRectangle(int dst, byte op, XRColor color, int x, int y, int width, int height) {
- prepareRequest(28);
- putRequestHeader(MAJOR_RENDER, FILL_RECTANGLES, 7);
- buf.putByte(op);
- buf.skip(3);
- buf.putInt(dst);
- color.writeToBuffer(buf);
- buf.putShort((short) x);
- buf.putShort((short) (y));
- buf.putShort((short) (width));
- buf.putShort((short) (height));
- }
- public final RenderBuffer putByte(byte x) {
- unsafe.putByte(curAddress, x);
- curAddress += SIZEOF_BYTE;
- return this;
- }
- public final void prepareRequest(int opsize) {
- if (buf.remaining() < opsize) {
- flush(false);
- }
- checkSocketAccess();
- requestCount++;
- }
- protected void checkSocketAccess() {
- if (!socketTaken) {
- flushThread.takeSocket();
- socketTaken = true;
- }
- }
- public void flush(boolean sync) {
- buf.clear();
- requestCount = 0;
- }
- public final void clear() {
- curAddress = baseAddress;
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.