Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 362921
Collapse All | Expand All

(-)src/org/eclipse/rwt/internal/theme/QxImage.java (-3 / +18 lines)
Lines 150-157 Link Here
150
    }
150
    }
151
    return result;
151
    return result;
152
  }
152
  }
153
153
  
154
  public int hashCode() {
154
  public long getHash() {
155
    CRC32 result = new CRC32();
155
    CRC32 result = new CRC32();
156
    if( none ) {
156
    if( none ) {
157
      result.update( 1 );
157
      result.update( 1 );
Lines 170-176 Link Here
170
      result.update( 3 );
170
      result.update( 3 );
171
      result.update( path.getBytes() );
171
      result.update( path.getBytes() );
172
    }
172
    }
173
    return ( int )result.getValue();
173
    return result.getValue();
174
  }
175
176
  public int hashCode() {
177
    return ( int )getHash();
174
  }
178
  }
175
179
176
  public String toString() {
180
  public String toString() {
Lines 193-198 Link Here
193
    result.append( " }" );
197
    result.append( " }" );
194
    return result.toString();
198
    return result.toString();
195
  }
199
  }
200
  
201
  public String getFilename() {
202
    String hash = Long.toHexString( getHash() );
203
    if( path != null ) {
204
      int index = path.lastIndexOf( '.' );
205
      if( index >= 0 ) {
206
        hash = hash + path.substring( index );
207
      }
208
    }
209
    return hash;
210
  }
196
211
197
  public static Image createSwtImage( QxImage image ) throws IOException {
212
  public static Image createSwtImage( QxImage image ) throws IOException {
198
    Image result;
213
    Image result;
(-)src/org/eclipse/rwt/internal/theme/ThemePropertyAdapterRegistry.java (-1 / +2 lines)
Lines 114-120 Link Here
114
  public static class ImagePropertyAdapter implements ThemePropertyAdapter {
114
  public static class ImagePropertyAdapter implements ThemePropertyAdapter {
115
115
116
    public String getKey( QxType value ) {
116
    public String getKey( QxType value ) {
117
      return Integer.toHexString( value.hashCode() );
117
      String filename = ((QxImage)value).getFilename();
118
      return filename;
118
    }
119
    }
119
120
120
    public String getSlot( QxType value ) {
121
    public String getSlot( QxType value ) {
(-)src/org/eclipse/swt/internal/graphics/InternalImageFactory.java (-1 / +25 lines)
Lines 149-155 Link Here
149
  }
149
  }
150
150
151
  private static String createGeneratedImagePath( ImageData data ) {
151
  private static String createGeneratedImagePath( ImageData data ) {
152
    String hash = getHash( data );
152
    int outputFormat = getOutputFormat( data );
153
    String extension;
154
    switch( outputFormat ) {
155
      case SWT.IMAGE_BMP:
156
      case SWT.IMAGE_BMP_RLE:
157
        extension = ".bmp";
158
        break;
159
      case SWT.IMAGE_GIF:
160
        extension = ".gif";
161
        break;
162
      case SWT.IMAGE_JPEG:
163
        extension = ".jpg";
164
        break;
165
      case SWT.IMAGE_TIFF:
166
        extension = ".tif";
167
        break;
168
      case SWT.IMAGE_ICO:
169
        extension = ".ico";
170
        break;
171
      case SWT.IMAGE_PNG:
172
      default:
173
        extension = ".png";
174
        break;
175
    }
176
    String hash = getHash( data ) + extension;
153
    return "generated/" + hash;
177
    return "generated/" + hash;
154
  }
178
  }
155
179

Return to bug 362921