| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "sky/engine/core/css/CSSValue.h" | 27 #include "sky/engine/core/css/CSSValue.h" |
| 28 #include "sky/engine/platform/geometry/IntSize.h" | 28 #include "sky/engine/platform/geometry/IntSize.h" |
| 29 #include "sky/engine/platform/geometry/LayoutSize.h" | 29 #include "sky/engine/platform/geometry/LayoutSize.h" |
| 30 #include "sky/engine/platform/graphics/Image.h" | 30 #include "sky/engine/platform/graphics/Image.h" |
| 31 #include "sky/engine/wtf/PassRefPtr.h" | 31 #include "sky/engine/wtf/PassRefPtr.h" |
| 32 #include "sky/engine/wtf/RefCounted.h" | 32 #include "sky/engine/wtf/RefCounted.h" |
| 33 #include "sky/engine/wtf/RefPtr.h" | 33 #include "sky/engine/wtf/RefPtr.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class ImageResource; | |
| 38 class CSSValue; | 37 class CSSValue; |
| 39 class RenderObject; | 38 class RenderObject; |
| 40 | 39 |
| 41 typedef void* WrappedImagePtr; | 40 typedef void* WrappedImagePtr; |
| 42 | 41 |
| 43 class StyleImage : public RefCounted<StyleImage> { | 42 class StyleImage : public RefCounted<StyleImage> { |
| 44 public: | 43 public: |
| 45 virtual ~StyleImage() { } | 44 virtual ~StyleImage() { } |
| 46 | 45 |
| 47 bool operator==(const StyleImage& other) const | 46 bool operator==(const StyleImage& other) const |
| (...skipping 11 matching lines...) Expand all Loading... |
| 59 virtual bool imageHasRelativeWidth() const = 0; | 58 virtual bool imageHasRelativeWidth() const = 0; |
| 60 virtual bool imageHasRelativeHeight() const = 0; | 59 virtual bool imageHasRelativeHeight() const = 0; |
| 61 virtual bool usesImageContainerSize() const = 0; | 60 virtual bool usesImageContainerSize() const = 0; |
| 62 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&
) = 0; | 61 virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&
) = 0; |
| 63 virtual void addClient(RenderObject*) = 0; | 62 virtual void addClient(RenderObject*) = 0; |
| 64 virtual void removeClient(RenderObject*) = 0; | 63 virtual void removeClient(RenderObject*) = 0; |
| 65 virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const = 0; | 64 virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const = 0; |
| 66 virtual WrappedImagePtr data() const = 0; | 65 virtual WrappedImagePtr data() const = 0; |
| 67 virtual float imageScaleFactor() const { return 1; } | 66 virtual float imageScaleFactor() const { return 1; } |
| 68 virtual bool knownToBeOpaque(const RenderObject*) const = 0; | 67 virtual bool knownToBeOpaque(const RenderObject*) const = 0; |
| 69 virtual ImageResource* cachedImage() const { return 0; } | |
| 70 | 68 |
| 71 ALWAYS_INLINE bool isImageResource() const { return m_isImageResource; } | |
| 72 ALWAYS_INLINE bool isPendingImage() const { return m_isPendingImage; } | 69 ALWAYS_INLINE bool isPendingImage() const { return m_isPendingImage; } |
| 73 ALWAYS_INLINE bool isGeneratedImage() const { return m_isGeneratedImage; } | 70 ALWAYS_INLINE bool isGeneratedImage() const { return m_isGeneratedImage; } |
| 74 ALWAYS_INLINE bool isImageResourceSet() const { return m_isImageResourceSet;
} | |
| 75 | 71 |
| 76 protected: | 72 protected: |
| 77 StyleImage() | 73 StyleImage() |
| 78 : m_isImageResource(false) | 74 : m_isPendingImage(false) |
| 79 , m_isPendingImage(false) | |
| 80 , m_isGeneratedImage(false) | 75 , m_isGeneratedImage(false) |
| 81 , m_isImageResourceSet(false) | |
| 82 { | 76 { |
| 83 } | 77 } |
| 84 bool m_isImageResource:1; | |
| 85 bool m_isPendingImage:1; | 78 bool m_isPendingImage:1; |
| 86 bool m_isGeneratedImage:1; | 79 bool m_isGeneratedImage:1; |
| 87 bool m_isImageResourceSet:1; | |
| 88 }; | 80 }; |
| 89 | 81 |
| 90 #define DEFINE_STYLE_IMAGE_TYPE_CASTS(thisType, function) \ | 82 #define DEFINE_STYLE_IMAGE_TYPE_CASTS(thisType, function) \ |
| 91 DEFINE_TYPE_CASTS(thisType, StyleImage, styleImage, styleImage->function, st
yleImage.function); \ | 83 DEFINE_TYPE_CASTS(thisType, StyleImage, styleImage, styleImage->function, st
yleImage.function); \ |
| 92 inline thisType* to##thisType(const RefPtr<StyleImage>& styleImage) { return
to##thisType(styleImage.get()); } \ | 84 inline thisType* to##thisType(const RefPtr<StyleImage>& styleImage) { return
to##thisType(styleImage.get()); } \ |
| 93 typedef int NeedsSemiColonAfterDefineStyleImageTypeCasts | 85 typedef int NeedsSemiColonAfterDefineStyleImageTypeCasts |
| 94 | 86 |
| 95 } | 87 } |
| 96 #endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEIMAGE_H_ | 88 #endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEIMAGE_H_ |
| OLD | NEW |