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