#import "DWImageView.h"
#import "Profile.h"


@implementation DWImageView

    /* this really should become DWStaticImageView */
    
    #if 1
    - (void) drawRect: (NSRect) rect; 
    {
        if (imageRep && NSEqualSizes([imageRep size], rect.size)) {
        
            //[Profile start];
            
            [imageRep drawAtPoint: rect.origin];
            
            //[Profile end];

        } else {

            //[Profile startWithString: @"caching"];

            [super drawRect: rect];

            [imageRep release];
            
            imageRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: rect];
            [imageRep setAlpha: NO];
            [imageRep setOpaque: YES];
                
            //[Profile end];

        }
    }
    #endif

@end