2413 // validate the surfaceData correctly. Fail for now and 2414 // try again next time around. 2415 } 2416 } finally { 2417 surfaceData.markDirty(); 2418 } 2419 } 2420 2421 private void revalidateAll() { 2422 try { 2423 // REMIND: This locking needs to be done around the 2424 // caller of this method so that the pipe stays valid 2425 // long enough to call the new primitive. 2426 // REMIND: No locking yet in screen SurfaceData objects! 2427 // surfaceData.lock(); 2428 surfaceData = surfaceData.getReplacement(); 2429 if (surfaceData == null) { 2430 surfaceData = NullSurfaceData.theInstance; 2431 } 2432 2433 // this will recalculate the composite clip 2434 setDevClip(surfaceData.getBounds()); 2435 2436 if (paintState <= PAINT_ALPHACOLOR) { 2437 validateColor(); 2438 } 2439 if (composite instanceof XORComposite) { 2440 Color c = ((XORComposite) composite).getXorColor(); 2441 setComposite(new XORComposite(c, surfaceData)); 2442 } 2443 validatePipe(); 2444 } finally { 2445 // REMIND: No locking yet in screen SurfaceData objects! 2446 // surfaceData.unlock(); 2447 } 2448 } 2449 2450 public void clearRect(int x, int y, int w, int h) { 2451 // REMIND: has some "interesting" consequences if threads are 2452 // not synchronized | 2413 // validate the surfaceData correctly. Fail for now and 2414 // try again next time around. 2415 } 2416 } finally { 2417 surfaceData.markDirty(); 2418 } 2419 } 2420 2421 private void revalidateAll() { 2422 try { 2423 // REMIND: This locking needs to be done around the 2424 // caller of this method so that the pipe stays valid 2425 // long enough to call the new primitive. 2426 // REMIND: No locking yet in screen SurfaceData objects! 2427 // surfaceData.lock(); 2428 surfaceData = surfaceData.getReplacement(); 2429 if (surfaceData == null) { 2430 surfaceData = NullSurfaceData.theInstance; 2431 } 2432 2433 invalidatePipe(); 2434 2435 // this will recalculate the composite clip 2436 setDevClip(surfaceData.getBounds()); 2437 2438 if (paintState <= PAINT_ALPHACOLOR) { 2439 validateColor(); 2440 } 2441 if (composite instanceof XORComposite) { 2442 Color c = ((XORComposite) composite).getXorColor(); 2443 setComposite(new XORComposite(c, surfaceData)); 2444 } 2445 validatePipe(); 2446 } finally { 2447 // REMIND: No locking yet in screen SurfaceData objects! 2448 // surfaceData.unlock(); 2449 } 2450 } 2451 2452 public void clearRect(int x, int y, int w, int h) { 2453 // REMIND: has some "interesting" consequences if threads are 2454 // not synchronized |