| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // image frame contains only resources from its own security origin. | 77 // image frame contains only resources from its own security origin. |
| 78 virtual bool currentFrameHasSingleSecurityOrigin() const { return false; } | 78 virtual bool currentFrameHasSingleSecurityOrigin() const { return false; } |
| 79 | 79 |
| 80 static Image* nullImage(); | 80 static Image* nullImage(); |
| 81 bool isNull() const { return size().isEmpty(); } | 81 bool isNull() const { return size().isEmpty(); } |
| 82 | 82 |
| 83 virtual void setContainerSize(const IntSize&) { } | 83 virtual void setContainerSize(const IntSize&) { } |
| 84 virtual bool usesContainerSize() const { return false; } | 84 virtual bool usesContainerSize() const { return false; } |
| 85 virtual bool hasRelativeWidth() const { return false; } | 85 virtual bool hasRelativeWidth() const { return false; } |
| 86 virtual bool hasRelativeHeight() const { return false; } | 86 virtual bool hasRelativeHeight() const { return false; } |
| 87 |
| 88 // Computes (extracts) the intrinsic dimensions and ratio from the Image. Th
e intrinsic ratio |
| 89 // will be the 'viewport' of the image. (Same as the dimensions for a raster
image. For SVG |
| 90 // images it can be the dimensions defined by the 'viewBox'.) |
| 87 virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intr
insicHeight, FloatSize& intrinsicRatio); | 91 virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intr
insicHeight, FloatSize& intrinsicRatio); |
| 88 | 92 |
| 89 virtual IntSize size() const = 0; | 93 virtual IntSize size() const = 0; |
| 90 IntRect rect() const { return IntRect(IntPoint(), size()); } | 94 IntRect rect() const { return IntRect(IntPoint(), size()); } |
| 91 int width() const { return size().width(); } | 95 int width() const { return size().width(); } |
| 92 int height() const { return size().height(); } | 96 int height() const { return size().height(); } |
| 93 virtual bool getHotSpot(IntPoint&) const { return false; } | 97 virtual bool getHotSpot(IntPoint&) const { return false; } |
| 94 | 98 |
| 95 bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived); | 99 bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived); |
| 96 virtual bool dataChanged(bool /*allDataReceived*/) { return false; } | 100 virtual bool dataChanged(bool /*allDataReceived*/) { return false; } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 RefPtr<SharedBuffer> m_encodedImageData; | 153 RefPtr<SharedBuffer> m_encodedImageData; |
| 150 ImageObserver* m_imageObserver; | 154 ImageObserver* m_imageObserver; |
| 151 }; | 155 }; |
| 152 | 156 |
| 153 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 157 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
| 154 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) | 158 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t
ypeName()) |
| 155 | 159 |
| 156 } // namespace blink | 160 } // namespace blink |
| 157 | 161 |
| 158 #endif | 162 #endif |
| OLD | NEW |