src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MetalRenderQueue.m
author aghaisas
Wed, 20 Feb 2019 17:00:40 +0530
branchmetal-prototype-branch
changeset 57196 a95707a39ff5
permissions -rw-r--r--
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering Contributed-by: jdv, aghaisas
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57196
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
     1
/*
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
     2
 * Copyright (c) 2019, 2019, Oracle and/or its affiliates. All rights reserved.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
     4
 *
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    10
 *
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    15
 * accompanied this code).
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    16
 *
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    20
 *
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    23
 * questions.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    24
 */
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    25
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    26
#ifndef HEADLESS
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    27
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    28
#include <stdlib.h>
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    29
#include <Foundation/NSObjCRuntime.h>
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    30
#include "sun_java2d_pipe_BufferedOpCodes.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    31
#include "jlong.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    32
//#include "OGLBlitLoops.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    33
//#include "OGLBufImgOps.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    34
//#include "OGLContext.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    35
//#include "OGLMaskBlit.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    36
//#include "OGLMaskFill.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    37
//#include "OGLPaints.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    38
//#include "OGLRenderQueue.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    39
//#include "OGLRenderer.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    40
//#include "OGLSurfaceData.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    41
//#include "OGLTextRenderer.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    42
//#include "OGLVertexCache.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    43
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    44
#include "MetalRenderer.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    45
#include "MetalRenderQueue.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    46
#include "Trace.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    47
#include "MetalSurfaceData.h"
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    48
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    49
/**
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    50
 * Used to track whether we are in a series of a simple primitive operations
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    51
 * or texturing operations.  This variable should be controlled only via
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    52
 * the INIT/CHECK/RESET_PREVIOUS_OP() macros.  See the
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    53
 * OGLRenderQueue_CheckPreviousOp() method below for more information.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    54
 */
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    55
//jint previousOp;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    56
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    57
/**
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    58
 * References to the "current" context and destination surface.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    59
 */
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    60
//static MetalContext *mtlc = NULL;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    61
static MetalSDOps *dstOps = NULL;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    62
static MetalContext *mtlc = NULL;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    63
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    64
/**
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    65
 * The following methods are implemented in the windowing system (i.e. GLX
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    66
 * and WGL) source files.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    67
 */
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    68
//extern OGLContext *OGLSD_SetScratchSurface(JNIEnv *env, jlong pConfigInfo);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    69
//extern void OGLGC_DestroyOGLGraphicsConfig(jlong pConfigInfo);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    70
//extern void OGLSD_SwapBuffers(JNIEnv *env, jlong window);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    71
//extern void OGLSD_Flush(JNIEnv *env);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    72
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    73
JNIEXPORT jlong JNICALL
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    74
Java_sun_java2d_metal_MetalRenderQueue_flushBuffer(JNIEnv *env, jobject mtlrq, jlong buf, jint limit)
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    75
{
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    76
    jboolean sync = JNI_FALSE;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    77
    unsigned char *b, *end;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    78
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    79
    J2dTraceLn1(J2D_TRACE_INFO,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    80
                "MetalRenderQueue_flushBuffer: limit=%d", limit);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    81
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    82
    NSLog(@"Java_sun_java2d_metal_MetalRenderQueue_flushBuffer :");
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    83
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    84
    b = (unsigned char *)jlong_to_ptr(buf);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    85
    if (b == NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    86
        /*J2dRlsTraceLn(J2D_TRACE_ERROR,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    87
            "MetalRenderQueue_flushBuffer: cannot get direct buffer address");*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    88
        return 0;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    89
    }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    90
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    91
    //INIT_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    92
    end = b + limit;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    93
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    94
    while (b < end) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    95
        jint opcode = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    96
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    97
        fprintf(stdout, "MetalRenderQueue_flushBuffer_opcode : %d\n", opcode);fflush(stdout);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    98
        switch (opcode) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
    99
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   100
        // draw ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   101
        case sun_java2d_pipe_BufferedOpCodes_DRAW_LINE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   102
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   103
                jint x1 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   104
                jint y1 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   105
                jint x2 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   106
                jint y2 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   107
                MetalRenderer_DrawLine(mtlc, x1, y1, x2, y2);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   108
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   109
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   110
        case sun_java2d_pipe_BufferedOpCodes_DRAW_RECT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   111
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   112
                jint x = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   113
                jint y = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   114
                jint w = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   115
                jint h = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   116
                MetalRenderer_DrawRect(mtlc, x, y, w, h);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   117
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   118
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   119
        case sun_java2d_pipe_BufferedOpCodes_DRAW_POLY:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   120
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   121
                jint nPoints      = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   122
                jboolean isClosed = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   123
                jint transX       = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   124
                jint transY       = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   125
                /*jint *xPoints = (jint *)b;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   126
                jint *yPoints = ((jint *)b) + nPoints;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   127
                OGLRenderer_DrawPoly(oglc, nPoints, isClosed,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   128
                                     transX, transY,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   129
                                     xPoints, yPoints);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   130
                SKIP_BYTES(b, nPoints * BYTES_PER_POLY_POINT);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   131
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   132
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   133
        case sun_java2d_pipe_BufferedOpCodes_DRAW_PIXEL:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   134
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   135
                jint x = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   136
                jint y = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   137
                // Note that we could use GL_POINTS here, but the common
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   138
                // use case for DRAW_PIXEL is when rendering a Path2D,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   139
                // which will consist of a mix of DRAW_PIXEL and DRAW_LINE
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   140
                // calls.  So to improve batching we use GL_LINES here,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   141
                // even though it requires an extra vertex per pixel.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   142
                /*CONTINUE_IF_NULL(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   143
                CHECK_PREVIOUS_OP(GL_LINES);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   144
                j2d_glVertex2i(x, y);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   145
                j2d_glVertex2i(x+1, y+1);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   146
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   147
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   148
        case sun_java2d_pipe_BufferedOpCodes_DRAW_SCANLINES:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   149
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   150
                jint count = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   151
                //OGLRenderer_DrawScanlines(oglc, count, (jint *)b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   152
                SKIP_BYTES(b, count * BYTES_PER_SCANLINE);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   153
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   154
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   155
        case sun_java2d_pipe_BufferedOpCodes_DRAW_PARALLELOGRAM:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   156
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   157
                jfloat x11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   158
                jfloat y11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   159
                jfloat dx21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   160
                jfloat dy21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   161
                jfloat dx12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   162
                jfloat dy12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   163
                jfloat lwr21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   164
                jfloat lwr12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   165
                MetalRenderer_DrawParallelogram(mtlc,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   166
                                              x11, y11,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   167
                                              dx21, dy21,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   168
                                              dx12, dy12,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   169
                                              lwr21, lwr12);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   170
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   171
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   172
        case sun_java2d_pipe_BufferedOpCodes_DRAW_AAPARALLELOGRAM:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   173
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   174
                jfloat x11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   175
                jfloat y11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   176
                jfloat dx21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   177
                jfloat dy21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   178
                jfloat dx12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   179
                jfloat dy12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   180
                jfloat lwr21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   181
                jfloat lwr12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   182
                /*OGLRenderer_DrawAAParallelogram(oglc, dstOps,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   183
                                                x11, y11,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   184
                                                dx21, dy21,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   185
                                                dx12, dy12,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   186
                                                lwr21, lwr12);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   187
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   188
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   189
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   190
        // fill ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   191
        case sun_java2d_pipe_BufferedOpCodes_FILL_RECT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   192
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   193
                jint x = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   194
                jint y = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   195
                jint w = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   196
                jint h = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   197
                MetalRenderer_FillRect(mtlc, x, y, w, h);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   198
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   199
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   200
        case sun_java2d_pipe_BufferedOpCodes_FILL_SPANS:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   201
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   202
                jint count = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   203
                //OGLRenderer_FillSpans(oglc, count, (jint *)b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   204
                SKIP_BYTES(b, count * BYTES_PER_SPAN);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   205
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   206
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   207
        case sun_java2d_pipe_BufferedOpCodes_FILL_PARALLELOGRAM:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   208
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   209
                jfloat x11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   210
                jfloat y11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   211
                jfloat dx21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   212
                jfloat dy21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   213
                jfloat dx12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   214
                jfloat dy12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   215
                MetalRenderer_FillParallelogram(mtlc,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   216
                                              x11, y11,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   217
                                              dx21, dy21,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   218
                                              dx12, dy12);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   219
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   220
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   221
        case sun_java2d_pipe_BufferedOpCodes_FILL_AAPARALLELOGRAM:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   222
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   223
                jfloat x11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   224
                jfloat y11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   225
                jfloat dx21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   226
                jfloat dy21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   227
                jfloat dx12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   228
                jfloat dy12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   229
                /*OGLRenderer_FillAAParallelogram(oglc, dstOps,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   230
                                                x11, y11,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   231
                                                dx21, dy21,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   232
                                                dx12, dy12);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   233
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   234
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   235
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   236
        // text-related ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   237
        case sun_java2d_pipe_BufferedOpCodes_DRAW_GLYPH_LIST:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   238
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   239
                jint numGlyphs        = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   240
                jint packedParams     = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   241
                jfloat glyphListOrigX = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   242
                jfloat glyphListOrigY = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   243
                /*jboolean usePositions = EXTRACT_BOOLEAN(packedParams,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   244
                                                        OFFSET_POSITIONS);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   245
                jboolean subPixPos    = EXTRACT_BOOLEAN(packedParams,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   246
                                                        OFFSET_SUBPIXPOS);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   247
                jboolean rgbOrder     = EXTRACT_BOOLEAN(packedParams,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   248
                                                        OFFSET_RGBORDER);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   249
                jint lcdContrast      = EXTRACT_BYTE(packedParams,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   250
                                                     OFFSET_CONTRAST);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   251
                unsigned char *images = b;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   252
                unsigned char *positions;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   253
                jint bytesPerGlyph;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   254
                if (usePositions) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   255
                    positions = (b + numGlyphs * BYTES_PER_GLYPH_IMAGE);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   256
                    bytesPerGlyph = BYTES_PER_POSITIONED_GLYPH;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   257
                } else {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   258
                    positions = NULL;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   259
                    bytesPerGlyph = BYTES_PER_GLYPH_IMAGE;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   260
                }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   261
                OGLTR_DrawGlyphList(env, oglc, dstOps,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   262
                                    numGlyphs, usePositions,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   263
                                    subPixPos, rgbOrder, lcdContrast,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   264
                                    glyphListOrigX, glyphListOrigY,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   265
                                    images, positions);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   266
                SKIP_BYTES(b, numGlyphs * bytesPerGlyph);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   267
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   268
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   269
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   270
        // copy-related ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   271
        case sun_java2d_pipe_BufferedOpCodes_COPY_AREA:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   272
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   273
                jint x  = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   274
                jint y  = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   275
                jint w  = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   276
                jint h  = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   277
                jint dx = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   278
                jint dy = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   279
                /*OGLBlitLoops_CopyArea(env, oglc, dstOps,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   280
                                      x, y, w, h, dx, dy);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   281
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   282
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   283
        case sun_java2d_pipe_BufferedOpCodes_BLIT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   284
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   285
                jint packedParams = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   286
                jint sx1          = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   287
                jint sy1          = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   288
                jint sx2          = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   289
                jint sy2          = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   290
                jdouble dx1       = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   291
                jdouble dy1       = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   292
                jdouble dx2       = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   293
                jdouble dy2       = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   294
                jlong pSrc        = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   295
                jlong pDst        = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   296
                /*jint hint         = EXTRACT_BYTE(packedParams, OFFSET_HINT);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   297
                jboolean texture  = EXTRACT_BOOLEAN(packedParams,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   298
                                                    OFFSET_TEXTURE);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   299
                jboolean rtt      = EXTRACT_BOOLEAN(packedParams,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   300
                                                    OFFSET_RTT);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   301
                jboolean xform    = EXTRACT_BOOLEAN(packedParams,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   302
                                                    OFFSET_XFORM);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   303
                jboolean isoblit  = EXTRACT_BOOLEAN(packedParams,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   304
                                                    OFFSET_ISOBLIT);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   305
                if (isoblit) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   306
                    OGLBlitLoops_IsoBlit(env, oglc, pSrc, pDst,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   307
                                         xform, hint, texture, rtt,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   308
                                         sx1, sy1, sx2, sy2,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   309
                                         dx1, dy1, dx2, dy2);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   310
                } else {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   311
                    jint srctype = EXTRACT_BYTE(packedParams, OFFSET_SRCTYPE);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   312
                    OGLBlitLoops_Blit(env, oglc, pSrc, pDst,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   313
                                      xform, hint, srctype, texture,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   314
                                      sx1, sy1, sx2, sy2,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   315
                                      dx1, dy1, dx2, dy2);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   316
                }*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   317
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   318
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   319
        case sun_java2d_pipe_BufferedOpCodes_SURFACE_TO_SW_BLIT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   320
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   321
                jint sx      = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   322
                jint sy      = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   323
                jint dx      = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   324
                jint dy      = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   325
                jint w       = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   326
                jint h       = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   327
                jint dsttype = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   328
                jlong pSrc   = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   329
                jlong pDst   = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   330
                /*OGLBlitLoops_SurfaceToSwBlit(env, oglc,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   331
                                             pSrc, pDst, dsttype,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   332
                                             sx, sy, dx, dy, w, h);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   333
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   334
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   335
        case sun_java2d_pipe_BufferedOpCodes_MASK_FILL:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   336
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   337
                jint x        = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   338
                jint y        = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   339
                jint w        = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   340
                jint h        = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   341
                jint maskoff  = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   342
                jint maskscan = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   343
                jint masklen  = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   344
                unsigned char *pMask = (masklen > 0) ? b : NULL;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   345
                /*OGLMaskFill_MaskFill(oglc, x, y, w, h,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   346
                                     maskoff, maskscan, masklen, pMask);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   347
                SKIP_BYTES(b, masklen);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   348
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   349
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   350
        case sun_java2d_pipe_BufferedOpCodes_MASK_BLIT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   351
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   352
                jint dstx     = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   353
                jint dsty     = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   354
                jint width    = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   355
                jint height   = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   356
                jint masklen  = width * height * sizeof(jint);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   357
                /*OGLMaskBlit_MaskBlit(env, oglc,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   358
                                     dstx, dsty, width, height, b);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   359
                SKIP_BYTES(b, masklen);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   360
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   361
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   362
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   363
        // state-related ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   364
        case sun_java2d_pipe_BufferedOpCodes_SET_RECT_CLIP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   365
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   366
                jint x1 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   367
                jint y1 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   368
                jint x2 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   369
                jint y2 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   370
                //OGLContext_SetRectClip(oglc, dstOps, x1, y1, x2, y2);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   371
                MetalRenderer_SetRectClip(mtlc, x1, y1, x2, y2);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   372
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   373
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   374
        case sun_java2d_pipe_BufferedOpCodes_BEGIN_SHAPE_CLIP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   375
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   376
                //OGLContext_BeginShapeClip(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   377
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   378
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   379
        case sun_java2d_pipe_BufferedOpCodes_SET_SHAPE_CLIP_SPANS:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   380
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   381
                jint count = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   382
                //OGLRenderer_FillSpans(oglc, count, (jint *)b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   383
                SKIP_BYTES(b, count * BYTES_PER_SPAN);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   384
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   385
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   386
        case sun_java2d_pipe_BufferedOpCodes_END_SHAPE_CLIP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   387
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   388
                //OGLContext_EndShapeClip(oglc, dstOps);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   389
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   390
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   391
        case sun_java2d_pipe_BufferedOpCodes_RESET_CLIP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   392
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   393
                //OGLContext_ResetClip(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   394
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   395
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   396
        case sun_java2d_pipe_BufferedOpCodes_SET_ALPHA_COMPOSITE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   397
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   398
                jint rule         = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   399
                jfloat extraAlpha = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   400
                jint flags        = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   401
                //OGLContext_SetAlphaComposite(oglc, rule, extraAlpha, flags);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   402
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   403
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   404
        case sun_java2d_pipe_BufferedOpCodes_SET_XOR_COMPOSITE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   405
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   406
                jint xorPixel = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   407
                //OGLContext_SetXorComposite(oglc, xorPixel);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   408
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   409
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   410
        case sun_java2d_pipe_BufferedOpCodes_RESET_COMPOSITE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   411
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   412
                //OGLContext_ResetComposite(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   413
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   414
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   415
        case sun_java2d_pipe_BufferedOpCodes_SET_TRANSFORM:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   416
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   417
                jdouble m00 = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   418
                jdouble m10 = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   419
                jdouble m01 = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   420
                jdouble m11 = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   421
                jdouble m02 = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   422
                jdouble m12 = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   423
                //OGLContext_SetTransform(oglc, m00, m10, m01, m11, m02, m12);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   424
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   425
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   426
        case sun_java2d_pipe_BufferedOpCodes_RESET_TRANSFORM:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   427
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   428
                //OGLContext_ResetTransform(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   429
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   430
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   431
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   432
        // context-related ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   433
        case sun_java2d_pipe_BufferedOpCodes_SET_SURFACES:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   434
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   435
                //fprintf(stdout, "MetalRenderQueue_flushBuffer_SetSurfaces\n");fflush(stdout);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   436
                jlong pSrc = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   437
                jlong pDst = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   438
                /*if (oglc != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   439
                    RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   440
                }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   441
                oglc = OGLContext_SetSurfaces(env, pSrc, pDst);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   442
                dstOps = (MetalSDOps *)jlong_to_ptr(pDst);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   443
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   444
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   445
        case sun_java2d_pipe_BufferedOpCodes_SET_SCRATCH_SURFACE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   446
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   447
                jlong pConfigInfo = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   448
                /*if (oglc != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   449
                    RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   450
                }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   451
                oglc = OGLSD_SetScratchSurface(env, pConfigInfo);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   452
                dstOps = NULL;*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   453
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   454
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   455
        case sun_java2d_pipe_BufferedOpCodes_FLUSH_SURFACE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   456
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   457
                jlong pData = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   458
                /*OGLSDOps *oglsdo = (OGLSDOps *)jlong_to_ptr(pData);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   459
                if (oglsdo != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   460
                    CONTINUE_IF_NULL(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   461
                    RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   462
                    OGLSD_Delete(env, oglsdo);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   463
                }*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   464
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   465
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   466
        case sun_java2d_pipe_BufferedOpCodes_DISPOSE_SURFACE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   467
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   468
                jlong pData = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   469
                /*OGLSDOps *oglsdo = (OGLSDOps *)jlong_to_ptr(pData);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   470
                if (oglsdo != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   471
                    CONTINUE_IF_NULL(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   472
                    RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   473
                    OGLSD_Delete(env, oglsdo);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   474
                    if (oglsdo->privOps != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   475
                        free(oglsdo->privOps);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   476
                    }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   477
                }*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   478
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   479
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   480
        case sun_java2d_pipe_BufferedOpCodes_DISPOSE_CONFIG:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   481
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   482
                jlong pConfigInfo = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   483
                /*CONTINUE_IF_NULL(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   484
                RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   485
                OGLGC_DestroyOGLGraphicsConfig(pConfigInfo);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   486
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   487
                // the previous method will call glX/wglMakeCurrent(None),
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   488
                // so we should nullify the current oglc and dstOps to avoid
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   489
                // calling glFlush() (or similar) while no context is current
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   490
                oglc = NULL;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   491
                dstOps = NULL;*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   492
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   493
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   494
        case sun_java2d_pipe_BufferedOpCodes_INVALIDATE_CONTEXT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   495
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   496
                // flush just in case there are any pending operations in
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   497
                // the hardware pipe
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   498
                /*if (oglc != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   499
                    RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   500
                    j2d_glFlush();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   501
                }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   502
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   503
                // invalidate the references to the current context and
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   504
                // destination surface that are maintained at the native level
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   505
                oglc = NULL;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   506
                dstOps = NULL;*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   507
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   508
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   509
        case sun_java2d_pipe_BufferedOpCodes_SAVE_STATE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   510
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   511
                /*j2d_glPushAttrib(GL_ALL_ATTRIB_BITS);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   512
                j2d_glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   513
                j2d_glMatrixMode(GL_MODELVIEW);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   514
                j2d_glPushMatrix();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   515
                j2d_glMatrixMode(GL_PROJECTION);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   516
                j2d_glPushMatrix();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   517
                j2d_glMatrixMode(GL_TEXTURE);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   518
                j2d_glPushMatrix();*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   519
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   520
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   521
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   522
        case sun_java2d_pipe_BufferedOpCodes_RESTORE_STATE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   523
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   524
                /*j2d_glPopAttrib();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   525
                j2d_glPopClientAttrib();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   526
                j2d_glMatrixMode(GL_MODELVIEW);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   527
                j2d_glPopMatrix();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   528
                j2d_glMatrixMode(GL_PROJECTION);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   529
                j2d_glPopMatrix();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   530
                j2d_glMatrixMode(GL_TEXTURE);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   531
                j2d_glPopMatrix();*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   532
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   533
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   534
        case sun_java2d_pipe_BufferedOpCodes_SYNC:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   535
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   536
                //sync = JNI_TRUE;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   537
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   538
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   539
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   540
        // multibuffering ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   541
        case sun_java2d_pipe_BufferedOpCodes_SWAP_BUFFERS:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   542
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   543
                jlong window = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   544
                /*if (oglc != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   545
                    RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   546
                }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   547
                OGLSD_SwapBuffers(env, window);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   548
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   549
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   550
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   551
        // special no-op (mainly used for achieving 8-byte alignment)
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   552
        case sun_java2d_pipe_BufferedOpCodes_NOOP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   553
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   554
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   555
        // paint-related ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   556
        case sun_java2d_pipe_BufferedOpCodes_RESET_PAINT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   557
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   558
                //OGLPaints_ResetPaint(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   559
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   560
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   561
        case sun_java2d_pipe_BufferedOpCodes_SET_COLOR:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   562
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   563
                fprintf(stdout, "MetalRenderQueue_flushBuffer_SetColor\n");fflush(stdout);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   564
                jint color = NEXT_INT(b);       
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   565
                MetalRenderer_SetColor(mtlc, color);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   566
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   567
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   568
        case sun_java2d_pipe_BufferedOpCodes_SET_GRADIENT_PAINT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   569
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   570
                jboolean useMask= NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   571
                jboolean cyclic = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   572
                jdouble p0      = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   573
                jdouble p1      = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   574
                jdouble p3      = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   575
                jint pixel1     = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   576
                jint pixel2     = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   577
                /*OGLPaints_SetGradientPaint(oglc, useMask, cyclic,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   578
                                           p0, p1, p3,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   579
                                           pixel1, pixel2);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   580
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   581
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   582
        case sun_java2d_pipe_BufferedOpCodes_SET_LINEAR_GRADIENT_PAINT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   583
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   584
                jboolean useMask = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   585
                jboolean linear  = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   586
                jint cycleMethod = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   587
                jint numStops    = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   588
                jfloat p0        = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   589
                jfloat p1        = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   590
                jfloat p3        = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   591
                void *fractions, *pixels;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   592
                fractions = b; SKIP_BYTES(b, numStops * sizeof(jfloat));
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   593
                pixels    = b; SKIP_BYTES(b, numStops * sizeof(jint));
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   594
                /*OGLPaints_SetLinearGradientPaint(oglc, dstOps,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   595
                                                 useMask, linear,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   596
                                                 cycleMethod, numStops,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   597
                                                 p0, p1, p3,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   598
                                                 fractions, pixels);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   599
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   600
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   601
        case sun_java2d_pipe_BufferedOpCodes_SET_RADIAL_GRADIENT_PAINT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   602
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   603
                jboolean useMask = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   604
                jboolean linear  = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   605
                jint numStops    = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   606
                jint cycleMethod = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   607
                jfloat m00       = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   608
                jfloat m01       = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   609
                jfloat m02       = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   610
                jfloat m10       = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   611
                jfloat m11       = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   612
                jfloat m12       = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   613
                jfloat focusX    = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   614
                void *fractions, *pixels;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   615
                fractions = b; SKIP_BYTES(b, numStops * sizeof(jfloat));
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   616
                pixels    = b; SKIP_BYTES(b, numStops * sizeof(jint));
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   617
                /*OGLPaints_SetRadialGradientPaint(oglc, dstOps,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   618
                                                 useMask, linear,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   619
                                                 cycleMethod, numStops,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   620
                                                 m00, m01, m02,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   621
                                                 m10, m11, m12,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   622
                                                 focusX,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   623
                                                 fractions, pixels);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   624
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   625
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   626
        case sun_java2d_pipe_BufferedOpCodes_SET_TEXTURE_PAINT:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   627
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   628
                jboolean useMask= NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   629
                jboolean filter = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   630
                jlong pSrc      = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   631
                jdouble xp0     = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   632
                jdouble xp1     = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   633
                jdouble xp3     = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   634
                jdouble yp0     = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   635
                jdouble yp1     = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   636
                jdouble yp3     = NEXT_DOUBLE(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   637
                /*OGLPaints_SetTexturePaint(oglc, useMask, pSrc, filter,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   638
                                          xp0, xp1, xp3,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   639
                                          yp0, yp1, yp3);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   640
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   641
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   642
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   643
        // BufferedImageOp-related ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   644
        case sun_java2d_pipe_BufferedOpCodes_ENABLE_CONVOLVE_OP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   645
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   646
                jlong pSrc        = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   647
                jboolean edgeZero = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   648
                jint kernelWidth  = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   649
                jint kernelHeight = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   650
                /*OGLBufImgOps_EnableConvolveOp(oglc, pSrc, edgeZero,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   651
                                              kernelWidth, kernelHeight, b);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   652
                SKIP_BYTES(b, kernelWidth * kernelHeight * sizeof(jfloat));
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   653
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   654
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   655
        case sun_java2d_pipe_BufferedOpCodes_DISABLE_CONVOLVE_OP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   656
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   657
                //OGLBufImgOps_DisableConvolveOp(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   658
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   659
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   660
        case sun_java2d_pipe_BufferedOpCodes_ENABLE_RESCALE_OP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   661
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   662
                jlong pSrc          = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   663
                jboolean nonPremult = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   664
                jint numFactors     = 4;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   665
                unsigned char *scaleFactors = b;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   666
                unsigned char *offsets = (b + numFactors * sizeof(jfloat));
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   667
                /*OGLBufImgOps_EnableRescaleOp(oglc, pSrc, nonPremult,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   668
                                             scaleFactors, offsets);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   669
                SKIP_BYTES(b, numFactors * sizeof(jfloat) * 2);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   670
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   671
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   672
        case sun_java2d_pipe_BufferedOpCodes_DISABLE_RESCALE_OP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   673
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   674
                //OGLBufImgOps_DisableRescaleOp(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   675
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   676
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   677
        case sun_java2d_pipe_BufferedOpCodes_ENABLE_LOOKUP_OP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   678
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   679
                jlong pSrc          = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   680
                jboolean nonPremult = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   681
                jboolean shortData  = NEXT_BOOLEAN(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   682
                jint numBands       = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   683
                jint bandLength     = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   684
                jint offset         = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   685
                jint bytesPerElem = shortData ? sizeof(jshort):sizeof(jbyte);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   686
                void *tableValues = b;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   687
                /*OGLBufImgOps_EnableLookupOp(oglc, pSrc, nonPremult, shortData,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   688
                                            numBands, bandLength, offset,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   689
                                            tableValues);*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   690
                SKIP_BYTES(b, numBands * bandLength * bytesPerElem);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   691
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   692
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   693
        case sun_java2d_pipe_BufferedOpCodes_DISABLE_LOOKUP_OP:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   694
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   695
                //OGLBufImgOps_DisableLookupOp(oglc);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   696
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   697
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   698
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   699
        default:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   700
            J2dRlsTraceLn1(J2D_TRACE_ERROR,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   701
                "OGLRenderQueue_flushBuffer: invalid opcode=%d", opcode);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   702
            /*if (oglc != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   703
                RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   704
            }*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   705
            return 0;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   706
        }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   707
        // TODO : Below logic need to be refined more if any more opcodes
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   708
        // we need to consider
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   709
        /*if ((opcode != sun_java2d_pipe_BufferedOpCodes_DRAW_LINE) && 
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   710
            (opcode != sun_java2d_pipe_BufferedOpCodes_SET_COLOR) &&
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   711
            //(opcode != sun_java2d_pipe_BufferedOpCodes_FILL_PARALLELOGRAM) &&
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   712
            //(opcode != sun_java2d_pipe_BufferedOpCodes_DRAW_PARALLELOGRAM) &&
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   713
            (opcode != sun_java2d_pipe_BufferedOpCodes_SET_SURFACES)) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   714
            // We should not read int as it can cause under/overflow if
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   715
            // coming data is not int
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   716
            //jint x = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   717
            continue;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   718
        }*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   719
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   720
        /*J2dTraceLn2(J2D_TRACE_VERBOSE,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   721
                    "MetalRenderQueue_flushBuffer: opcode=%d, rem=%d",
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   722
                    opcode, (end-b));*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   723
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   724
        /*switch (opcode) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   725
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   726
        // draw ops
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   727
        case sun_java2d_pipe_BufferedOpCodes_DRAW_LINE:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   728
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   729
                //fprintf(stdout, "MetalRenderQueue_flushBuffer_DrawLine\n");fflush(stdout);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   730
                jint x1 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   731
                jint y1 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   732
                jint x2 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   733
                jint y2 = NEXT_INT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   734
                MetalRenderer_DrawLine(mtlc, x1, y1, x2, y2);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   735
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   736
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   737
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   738
        case sun_java2d_pipe_BufferedOpCodes_SET_COLOR:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   739
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   740
                //fprintf(stdout, "MetalRenderQueue_flushBuffer_SetColor\n");fflush(stdout);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   741
                jint color = NEXT_INT(b);       
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   742
                MetalRenderer_SetColor(mtlc, color);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   743
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   744
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   745
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   746
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   747
        case sun_java2d_pipe_BufferedOpCodes_DRAW_PARALLELOGRAM:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   748
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   749
                jfloat x11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   750
                jfloat y11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   751
                jfloat dx21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   752
                jfloat dy21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   753
                jfloat dx12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   754
                jfloat dy12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   755
                jfloat lwr21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   756
                jfloat lwr12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   757
                MetalRenderer_DrawParallelogram(mtlc,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   758
                                              x11, y11,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   759
                                              dx21, dy21,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   760
                                              dx12, dy12,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   761
                                              lwr21, lwr12);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   762
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   763
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   764
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   765
        case sun_java2d_pipe_BufferedOpCodes_FILL_PARALLELOGRAM:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   766
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   767
                jfloat x11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   768
                jfloat y11 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   769
                jfloat dx21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   770
                jfloat dy21 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   771
                jfloat dx12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   772
                jfloat dy12 = NEXT_FLOAT(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   773
                MetalRenderer_FillParallelogram(mtlc,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   774
                                              x11, y11,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   775
                                              dx21, dy21,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   776
                                              dx12, dy12);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   777
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   778
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   779
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   780
        case sun_java2d_pipe_BufferedOpCodes_SET_SURFACES:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   781
            {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   782
                //fprintf(stdout, "MetalRenderQueue_flushBuffer_SetSurfaces\n");fflush(stdout);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   783
                jlong pSrc = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   784
                jlong pDst = NEXT_LONG(b);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   785
                if (oglc != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   786
                    RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   787
                }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   788
                oglc = OGLContext_SetSurfaces(env, pSrc, pDst);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   789
                dstOps = (MetalSDOps *)jlong_to_ptr(pDst);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   790
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   791
            break;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   792
        
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   793
        default:
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   794
            J2dRlsTraceLn1(J2D_TRACE_ERROR,
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   795
                "MetalRenderQueue_flushBuffer: invalid opcode=%d", opcode);
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   796
            if (oglc != NULL) {
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   797
                RESET_PREVIOUS_OP();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   798
            }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   799
            return 0;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   800
        }*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   801
    }
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   802
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   803
    // Render everything to offscreen surface data
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   804
    MetalRenderer_Flush();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   805
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   806
    // Render to on-screen
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   807
    MetalRenderer_blitToScreenDrawable();
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   808
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   809
    return 1;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   810
}
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   811
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   812
/**
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   813
 * Returns a pointer to the "current" context, as set by the last SET_SURFACES
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   814
 * or SET_SCRATCH_SURFACE operation.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   815
 */
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   816
/*MetalContext *
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   817
MetalRenderQueue_GetCurrentContext()
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   818
{
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   819
    return mtlc;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   820
}*/
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   821
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   822
/**
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   823
 * Returns a pointer to the "current" destination surface, as set by the last
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   824
 * SET_SURFACES operation.
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   825
 */
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   826
MetalSDOps*
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   827
MetalRenderQueue_GetCurrentDestination()
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   828
{
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   829
    return dstOps;
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   830
}
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   831
a95707a39ff5 Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff changeset
   832
#endif /* !HEADLESS */