| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 RefPtr<Image> image = BitmapImage::create(); | 75 RefPtr<Image> image = BitmapImage::create(); |
| 76 image->setData(resource, true); | 76 image->setData(resource, true); |
| 77 return image.release(); | 77 return image.release(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool Image::supportsType(const String& type) | 80 bool Image::supportsType(const String& type) |
| 81 { | 81 { |
| 82 return MIMETypeRegistry::isSupportedImageResourceMIMEType(type); | 82 return MIMETypeRegistry::isSupportedImageResourceMIMEType(type); |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived) | 85 Image::SizeAvailability Image::setData(PassRefPtr<SharedBuffer> data, bool allDa
taReceived) |
| 86 { | 86 { |
| 87 m_encodedImageData = data; | 87 m_encodedImageData = data; |
| 88 if (!m_encodedImageData.get()) | 88 if (!m_encodedImageData.get()) |
| 89 return true; | 89 return SizeAvailable; |
| 90 | 90 |
| 91 int length = m_encodedImageData->size(); | 91 int length = m_encodedImageData->size(); |
| 92 if (!length) | 92 if (!length) |
| 93 return true; | 93 return SizeAvailable; |
| 94 | 94 |
| 95 return dataChanged(allDataReceived); | 95 return dataChanged(allDataReceived); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const Fl
oatPoint& srcPoint, const FloatSize& scaledTileSize, SkXfermode::Mode op, const
FloatSize& repeatSpacing) | 98 void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const Fl
oatPoint& srcPoint, const FloatSize& scaledTileSize, SkXfermode::Mode op, const
FloatSize& repeatSpacing) |
| 99 { | 99 { |
| 100 FloatSize intrinsicTileSize = FloatSize(size()); | 100 FloatSize intrinsicTileSize = FloatSize(size()); |
| 101 if (hasRelativeSize()) { | 101 if (hasRelativeSize()) { |
| 102 intrinsicTileSize.setWidth(scaledTileSize.width()); | 102 intrinsicTileSize.setWidth(scaledTileSize.width()); |
| 103 intrinsicTileSize.setHeight(scaledTileSize.height()); | 103 intrinsicTileSize.setHeight(scaledTileSize.height()); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 FloatRect subset = dest; | 298 FloatRect subset = dest; |
| 299 subset.setX((dest.x() - tile.x()) / scale.width()); | 299 subset.setX((dest.x() - tile.x()) / scale.width()); |
| 300 subset.setY((dest.y() - tile.y()) / scale.height()); | 300 subset.setY((dest.y() - tile.y()) / scale.height()); |
| 301 subset.setWidth(dest.width() / scale.width()); | 301 subset.setWidth(dest.width() / scale.width()); |
| 302 subset.setHeight(dest.height() / scale.height()); | 302 subset.setHeight(dest.height() / scale.height()); |
| 303 | 303 |
| 304 return subset; | 304 return subset; |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace blink | 307 } // namespace blink |
| OLD | NEW |