644 OGLBlitSwToTexture(&srcInfo, &pf, dstOps,
645 (jint)dx1, (jint)dy1, (jint)dx2, (jint)dy2);
646 } else {
647 jboolean viaTexture;
648 if (xform) {
649 // we must use the via-texture codepath when there
650 // is a xform
651 viaTexture = JNI_TRUE;
652 } else {
653 // look at the vendor to see which codepath is faster
654 // (this has been empirically determined; see 5020009)
655 switch (OGLC_GET_VENDOR(oglc)) {
656 case OGLC_VENDOR_NVIDIA:
657 // the via-texture codepath tends to be faster when
658 // there is either a simple scale OR an extra alpha
659 viaTexture =
660 (sx2-sx1) != (jint)(dx2-dx1) ||
661 (sy2-sy1) != (jint)(dy2-dy1) ||
662 oglc->extraAlpha != 1.0f;
663 break;
664
665 default:
666 // just use the glDrawPixels() codepath
667 viaTexture = JNI_FALSE;
668 break;
669 }
670 }
671
672 if (viaTexture) {
673 OGLBlitToSurfaceViaTexture(oglc, &srcInfo, &pf, NULL,
674 JNI_TRUE, hint,
675 sx1, sy1, sx2, sy2,
676 dx1, dy1, dx2, dy2);
677 } else {
678 OGLBlitSwToSurface(oglc, &srcInfo, &pf,
679 sx1, sy1, sx2, sy2,
680 dx1, dy1, dx2, dy2);
681 }
682 }
683
684 j2d_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
644 OGLBlitSwToTexture(&srcInfo, &pf, dstOps,
645 (jint)dx1, (jint)dy1, (jint)dx2, (jint)dy2);
646 } else {
647 jboolean viaTexture;
648 if (xform) {
649 // we must use the via-texture codepath when there
650 // is a xform
651 viaTexture = JNI_TRUE;
652 } else {
653 // look at the vendor to see which codepath is faster
654 // (this has been empirically determined; see 5020009)
655 switch (OGLC_GET_VENDOR(oglc)) {
656 case OGLC_VENDOR_NVIDIA:
657 // the via-texture codepath tends to be faster when
658 // there is either a simple scale OR an extra alpha
659 viaTexture =
660 (sx2-sx1) != (jint)(dx2-dx1) ||
661 (sy2-sy1) != (jint)(dy2-dy1) ||
662 oglc->extraAlpha != 1.0f;
663 break;
664 #ifdef MACOSX
665 case OGLC_VENDOR_ATI:
666 // see 8024461
667 viaTexture = JNI_TRUE;
668 break;
669 #endif
670 default:
671 // just use the glDrawPixels() codepath
672 viaTexture = JNI_FALSE;
673 break;
674 }
675 }
676
677 if (viaTexture) {
678 OGLBlitToSurfaceViaTexture(oglc, &srcInfo, &pf, NULL,
679 JNI_TRUE, hint,
680 sx1, sy1, sx2, sy2,
681 dx1, dy1, dx2, dy2);
682 } else {
683 OGLBlitSwToSurface(oglc, &srcInfo, &pf,
684 sx1, sy1, sx2, sy2,
685 dx1, dy1, dx2, dy2);
686 }
687 }
688
689 j2d_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|