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