| 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 17 matching lines...) Expand all Loading... |
| 28 #define Image_h | 28 #define Image_h |
| 29 | 29 |
| 30 #include "platform/PlatformExport.h" | 30 #include "platform/PlatformExport.h" |
| 31 #include "platform/SharedBuffer.h" | 31 #include "platform/SharedBuffer.h" |
| 32 #include "platform/geometry/IntRect.h" | 32 #include "platform/geometry/IntRect.h" |
| 33 #include "platform/graphics/Color.h" | 33 #include "platform/graphics/Color.h" |
| 34 #include "platform/graphics/GraphicsTypes.h" | 34 #include "platform/graphics/GraphicsTypes.h" |
| 35 #include "platform/graphics/ImageAnimationPolicy.h" | 35 #include "platform/graphics/ImageAnimationPolicy.h" |
| 36 #include "platform/graphics/ImageObserver.h" | 36 #include "platform/graphics/ImageObserver.h" |
| 37 #include "platform/graphics/ImageOrientation.h" | 37 #include "platform/graphics/ImageOrientation.h" |
| 38 #include "skia/ext/cdl_common.h" |
| 38 #include "third_party/skia/include/core/SkRefCnt.h" | 39 #include "third_party/skia/include/core/SkRefCnt.h" |
| 39 #include "wtf/Assertions.h" | 40 #include "wtf/Assertions.h" |
| 40 #include "wtf/Noncopyable.h" | 41 #include "wtf/Noncopyable.h" |
| 41 #include "wtf/PassRefPtr.h" | 42 #include "wtf/PassRefPtr.h" |
| 42 #include "wtf/RefPtr.h" | 43 #include "wtf/RefPtr.h" |
| 43 #include "wtf/ThreadSafeRefCounted.h" | 44 #include "wtf/ThreadSafeRefCounted.h" |
| 44 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
| 45 | 46 |
| 46 class SkCanvas; | |
| 47 class SkImage; | 47 class SkImage; |
| 48 class SkMatrix; | 48 class SkMatrix; |
| 49 class SkPaint; | |
| 50 | 49 |
| 51 namespace blink { | 50 namespace blink { |
| 52 | 51 |
| 53 class FloatPoint; | 52 class FloatPoint; |
| 54 class FloatRect; | 53 class FloatRect; |
| 55 class FloatSize; | 54 class FloatSize; |
| 56 class GraphicsContext; | 55 class GraphicsContext; |
| 57 class Image; | 56 class Image; |
| 58 | 57 |
| 59 class PLATFORM_EXPORT Image : public ThreadSafeRefCounted<Image> { | 58 class PLATFORM_EXPORT Image : public ThreadSafeRefCounted<Image> { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 const FloatPoint& phase, | 160 const FloatPoint& phase, |
| 162 SkBlendMode, | 161 SkBlendMode, |
| 163 const FloatRect&, | 162 const FloatRect&, |
| 164 const FloatSize& repeatSpacing = FloatSize()); | 163 const FloatSize& repeatSpacing = FloatSize()); |
| 165 | 164 |
| 166 enum ImageClampingMode { | 165 enum ImageClampingMode { |
| 167 ClampImageToSourceRect, | 166 ClampImageToSourceRect, |
| 168 DoNotClampImageToSourceRect | 167 DoNotClampImageToSourceRect |
| 169 }; | 168 }; |
| 170 | 169 |
| 171 virtual void draw(SkCanvas*, | 170 virtual void draw(CdlCanvas*, |
| 172 const SkPaint&, | 171 const CdlPaint&, |
| 173 const FloatRect& dstRect, | 172 const FloatRect& dstRect, |
| 174 const FloatRect& srcRect, | 173 const FloatRect& srcRect, |
| 175 RespectImageOrientationEnum, | 174 RespectImageOrientationEnum, |
| 176 ImageClampingMode) = 0; | 175 ImageClampingMode) = 0; |
| 177 | 176 |
| 178 virtual bool applyShader(SkPaint&, const SkMatrix& localMatrix); | 177 virtual bool applyShader(CdlPaint&, const SkMatrix& localMatrix); |
| 179 | 178 |
| 180 // Compute the tile which contains a given point (assuming a repeating tile | 179 // Compute the tile which contains a given point (assuming a repeating tile |
| 181 // grid). The point and returned value are in destination grid space. | 180 // grid). The point and returned value are in destination grid space. |
| 182 static FloatRect computeTileContaining(const FloatPoint&, | 181 static FloatRect computeTileContaining(const FloatPoint&, |
| 183 const FloatSize& tileSize, | 182 const FloatSize& tileSize, |
| 184 const FloatPoint& tilePhase, | 183 const FloatPoint& tilePhase, |
| 185 const FloatSize& tileSpacing); | 184 const FloatSize& tileSpacing); |
| 186 | 185 |
| 187 // Compute the image subset which gets mapped onto |dest|, when the whole | 186 // Compute the image subset which gets mapped onto |dest|, when the whole |
| 188 // image is drawn into |tile|. Assumes |tile| contains |dest|. The tile rect | 187 // image is drawn into |tile|. Assumes |tile| contains |dest|. The tile rect |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 bool m_imageObserverDisabled; | 219 bool m_imageObserverDisabled; |
| 221 }; | 220 }; |
| 222 | 221 |
| 223 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 222 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
| 224 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), \ | 223 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), \ |
| 225 image.is##typeName()) | 224 image.is##typeName()) |
| 226 | 225 |
| 227 } // namespace blink | 226 } // namespace blink |
| 228 | 227 |
| 229 #endif | 228 #endif |
| OLD | NEW |