jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java
changeset 11080 7e18e343964e
parent 7668 d4a77089c587
child 22584 eed64ee05369
equal deleted inserted replaced
11059:b5060eae3b32 11080:7e18e343964e
   293         return X11SurfaceDataProxy.createProxy(srcData, graphicsConfig);
   293         return X11SurfaceDataProxy.createProxy(srcData, graphicsConfig);
   294     }
   294     }
   295 
   295 
   296     public void validatePipe(SunGraphics2D sg2d) {
   296     public void validatePipe(SunGraphics2D sg2d) {
   297         if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON &&
   297         if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON &&
   298             sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&
   298             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
   299             (sg2d.compositeState <= sg2d.COMP_ISCOPY ||
   299             (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY ||
   300              sg2d.compositeState == sg2d.COMP_XOR))
   300              sg2d.compositeState == SunGraphics2D.COMP_XOR))
   301         {
   301         {
   302             if (x11txpipe == null) {
   302             if (x11txpipe == null) {
   303                 /*
   303                 /*
   304                  * Note: this is thread-safe since x11txpipe is the
   304                  * Note: this is thread-safe since x11txpipe is the
   305                  * second of the two pipes constructed in makePipes().
   305                  * second of the two pipes constructed in makePipes().
   313                 sg2d.imagepipe = lazypipe;
   313                 sg2d.imagepipe = lazypipe;
   314                 sg2d.textpipe = lazypipe;
   314                 sg2d.textpipe = lazypipe;
   315                 return;
   315                 return;
   316             }
   316             }
   317 
   317 
   318             if (sg2d.clipState == sg2d.CLIP_SHAPE) {
   318             if (sg2d.clipState == SunGraphics2D.CLIP_SHAPE) {
   319                 // Do this to init textpipe correctly; we will override the
   319                 // Do this to init textpipe correctly; we will override the
   320                 // other non-text pipes below
   320                 // other non-text pipes below
   321                 // REMIND: we should clean this up eventually instead of
   321                 // REMIND: we should clean this up eventually instead of
   322                 // having this work duplicated.
   322                 // having this work duplicated.
   323                 super.validatePipe(sg2d);
   323                 super.validatePipe(sg2d);
   327                 case SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT:
   327                 case SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT:
   328                     /* equating to OFF which it is for us */
   328                     /* equating to OFF which it is for us */
   329                 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
   329                 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
   330                     // Use X11 pipe even if DGA is available since DGA
   330                     // Use X11 pipe even if DGA is available since DGA
   331                     // text slows everything down when mixed with X11 calls
   331                     // text slows everything down when mixed with X11 calls
   332                     if (sg2d.compositeState == sg2d.COMP_ISCOPY) {
   332                     if (sg2d.compositeState == SunGraphics2D.COMP_ISCOPY) {
   333                         sg2d.textpipe = x11textpipe;
   333                         sg2d.textpipe = x11textpipe;
   334                     } else {
   334                     } else {
   335                         sg2d.textpipe = solidTextRenderer;
   335                         sg2d.textpipe = solidTextRenderer;
   336                     }
   336                     }
   337                     break;
   337                     break;
   351                         break;
   351                         break;
   352 
   352 
   353                     case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
   353                     case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
   354                     // Use X11 pipe even if DGA is available since DGA
   354                     // Use X11 pipe even if DGA is available since DGA
   355                     // text slows everything down when mixed with X11 calls
   355                     // text slows everything down when mixed with X11 calls
   356                     if (sg2d.compositeState == sg2d.COMP_ISCOPY) {
   356                     if (sg2d.compositeState == SunGraphics2D.COMP_ISCOPY) {
   357                         sg2d.textpipe = x11textpipe;
   357                         sg2d.textpipe = x11textpipe;
   358                     } else {
   358                     } else {
   359                         sg2d.textpipe = solidTextRenderer;
   359                         sg2d.textpipe = solidTextRenderer;
   360                     }
   360                     }
   361                     break;
   361                     break;
   368                         sg2d.textpipe = solidTextRenderer;
   368                         sg2d.textpipe = solidTextRenderer;
   369                     }
   369                     }
   370                 }
   370                 }
   371             }
   371             }
   372 
   372 
   373             if (sg2d.transformState >= sg2d.TRANSFORM_TRANSLATESCALE) {
   373             if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
   374                 sg2d.drawpipe = x11txpipe;
   374                 sg2d.drawpipe = x11txpipe;
   375                 sg2d.fillpipe = x11txpipe;
   375                 sg2d.fillpipe = x11txpipe;
   376             } else if (sg2d.strokeState != sg2d.STROKE_THIN){
   376             } else if (sg2d.strokeState != SunGraphics2D.STROKE_THIN){
   377                 sg2d.drawpipe = x11txpipe;
   377                 sg2d.drawpipe = x11txpipe;
   378                 sg2d.fillpipe = x11pipe;
   378                 sg2d.fillpipe = x11pipe;
   379             } else {
   379             } else {
   380                 sg2d.drawpipe = x11pipe;
   380                 sg2d.drawpipe = x11pipe;
   381                 sg2d.fillpipe = x11pipe;
   381                 sg2d.fillpipe = x11pipe;
   396             super.validatePipe(sg2d);
   396             super.validatePipe(sg2d);
   397         }
   397         }
   398     }
   398     }
   399 
   399 
   400     public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
   400     public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
   401         if (sg2d.paintState <= sg2d.PAINT_ALPHACOLOR &&
   401         if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
   402             sg2d.compositeState <= sg2d.COMP_ISCOPY)
   402             sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY)
   403         {
   403         {
   404             return solidloops;
   404             return solidloops;
   405         }
   405         }
   406         return super.getRenderLoops(sg2d);
   406         return super.getRenderLoops(sg2d);
   407     }
   407     }
   486                 return true;
   486                 return true;
   487             }
   487             }
   488             makePipes();
   488             makePipes();
   489         }
   489         }
   490         CompositeType comptype = sg2d.imageComp;
   490         CompositeType comptype = sg2d.imageComp;
   491         if (sg2d.transformState < sg2d.TRANSFORM_TRANSLATESCALE &&
   491         if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE &&
   492             (CompositeType.SrcOverNoEa.equals(comptype) ||
   492             (CompositeType.SrcOverNoEa.equals(comptype) ||
   493              CompositeType.SrcNoEa.equals(comptype)))
   493              CompositeType.SrcNoEa.equals(comptype)))
   494         {
   494         {
   495             x += sg2d.transX;
   495             x += sg2d.transX;
   496             y += sg2d.transY;
   496             y += sg2d.transY;