2408 try { 2409 revalidateAll(); 2410 fillpipe.fillRect(this, x, y, w, h); 2411 } catch (InvalidPipeException e2) { 2412 // Still catching the exception; we are not yet ready to 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) { | 2408 try { 2409 revalidateAll(); 2410 fillpipe.fillRect(this, x, y, w, h); 2411 } catch (InvalidPipeException e2) { 2412 // Still catching the exception; we are not yet ready to 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 final SurfaceType type = surfaceData.getSurfaceType(); 2429 2430 surfaceData = surfaceData.getReplacement(); 2431 if (surfaceData == null) { 2432 surfaceData = NullSurfaceData.theInstance; 2433 } 2434 2435 if (!surfaceData.getSurfaceType().equals(type)) { 2436 invalidatePipe(); 2437 } 2438 2439 // this will recalculate the composite clip 2440 setDevClip(surfaceData.getBounds()); 2441 2442 if (paintState <= PAINT_ALPHACOLOR) { 2443 validateColor(); 2444 } 2445 if (composite instanceof XORComposite) { 2446 Color c = ((XORComposite) composite).getXorColor(); 2447 setComposite(new XORComposite(c, surfaceData)); 2448 } 2449 validatePipe(); 2450 } finally { 2451 // REMIND: No locking yet in screen SurfaceData objects! 2452 // surfaceData.unlock(); 2453 } 2454 } 2455 2456 public void clearRect(int x, int y, int w, int h) { |