| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 { | 66 { |
| 67 const WebData& resource = Platform::current()->loadResource(name); | 67 const WebData& resource = Platform::current()->loadResource(name); |
| 68 if (resource.isEmpty()) | 68 if (resource.isEmpty()) |
| 69 return Image::nullImage(); | 69 return Image::nullImage(); |
| 70 | 70 |
| 71 RefPtr<Image> image = BitmapImage::create(); | 71 RefPtr<Image> image = BitmapImage::create(); |
| 72 image->setData(resource, true); | 72 image->setData(resource, true); |
| 73 return image.release(); | 73 return image.release(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 bool Image::supportsType(const String& type) | |
| 77 { | |
| 78 return MIMETypeRegistry::isSupportedImageResourceMIMEType(type); | |
| 79 } | |
| 80 | |
| 81 bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived) | 76 bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived) |
| 82 { | 77 { |
| 83 m_encodedImageData = data; | 78 m_encodedImageData = data; |
| 84 if (!m_encodedImageData.get()) | 79 if (!m_encodedImageData.get()) |
| 85 return true; | 80 return true; |
| 86 | 81 |
| 87 int length = m_encodedImageData->size(); | 82 int length = m_encodedImageData->size(); |
| 88 if (!length) | 83 if (!length) |
| 89 return true; | 84 return true; |
| 90 | 85 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 233 } |
| 239 | 234 |
| 240 PassRefPtr<Image> Image::imageForDefaultFrame() | 235 PassRefPtr<Image> Image::imageForDefaultFrame() |
| 241 { | 236 { |
| 242 RefPtr<Image> image(this); | 237 RefPtr<Image> image(this); |
| 243 | 238 |
| 244 return image.release(); | 239 return image.release(); |
| 245 } | 240 } |
| 246 | 241 |
| 247 } // namespace blink | 242 } // namespace blink |
| OLD | NEW |