Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 27 #ifndef Image_h | 27 #ifndef Image_h |
| 28 #define Image_h | 28 #define Image_h |
| 29 | 29 |
| 30 #include "platform/PlatformExport.h" | 30 #include "platform/PlatformExport.h" |
| 31 #include "platform/geometry/IntRect.h" | 31 #include "platform/geometry/IntRect.h" |
| 32 #include "platform/graphics/Color.h" | 32 #include "platform/graphics/Color.h" |
| 33 #include "platform/graphics/GraphicsTypes.h" | 33 #include "platform/graphics/GraphicsTypes.h" |
| 34 #include "platform/graphics/ImageAnimationPolicy.h" | 34 #include "platform/graphics/ImageAnimationPolicy.h" |
| 35 #include "platform/graphics/ImageObserver.h" | 35 #include "platform/graphics/ImageObserver.h" |
| 36 #include "platform/graphics/ImageOrientation.h" | 36 #include "platform/graphics/ImageOrientation.h" |
| 37 #include "public/platform/WebGraphicsContext3DProvider.h" | |
| 37 #include "wtf/Assertions.h" | 38 #include "wtf/Assertions.h" |
| 38 #include "wtf/Noncopyable.h" | 39 #include "wtf/Noncopyable.h" |
| 39 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
| 40 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
| 41 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
| 42 #include "wtf/text/WTFString.h" | 43 #include "wtf/text/WTFString.h" |
| 43 | 44 |
| 44 class SkBitmap; | 45 class SkBitmap; |
| 45 class SkCanvas; | 46 class SkCanvas; |
| 46 class SkImage; | 47 class SkImage; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 virtual void advanceAnimationForTesting() { } | 131 virtual void advanceAnimationForTesting() { } |
| 131 | 132 |
| 132 // Typically the ImageResource that owns us. | 133 // Typically the ImageResource that owns us. |
| 133 ImageObserver* getImageObserver() const { return m_imageObserverDisabled ? n ullptr : m_imageObserver; } | 134 ImageObserver* getImageObserver() const { return m_imageObserverDisabled ? n ullptr : m_imageObserver; } |
| 134 void clearImageObserver() { m_imageObserver = nullptr; } | 135 void clearImageObserver() { m_imageObserver = nullptr; } |
| 135 // Do not call setImageObserverDisabled() other than from ImageObserverDisab ler to avoid interleaved accesses to |m_imageObserverDisabled|. | 136 // Do not call setImageObserverDisabled() other than from ImageObserverDisab ler to avoid interleaved accesses to |m_imageObserverDisabled|. |
| 136 void setImageObserverDisabled(bool disabled) { m_imageObserverDisabled = dis abled; } | 137 void setImageObserverDisabled(bool disabled) { m_imageObserverDisabled = dis abled; } |
| 137 | 138 |
| 138 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; | 139 enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; |
| 139 | 140 |
| 140 virtual PassRefPtr<SkImage> imageForCurrentFrame() = 0; | 141 virtual PassRefPtr<SkImage> imageForCurrentFrame(WebGraphicsContext3DProvide r* = nullptr) = 0; |
|
Justin Novosad
2016/06/09 20:21:29
The usage of contextProvider argument is non-trivi
xidachen
2016/06/10 15:36:08
Done.
| |
| 141 virtual PassRefPtr<Image> imageForDefaultFrame(); | 142 virtual PassRefPtr<Image> imageForDefaultFrame(); |
| 142 | 143 |
| 143 virtual void drawPattern(GraphicsContext&, const FloatRect&, | 144 virtual void drawPattern(GraphicsContext&, const FloatRect&, |
| 144 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode, | 145 const FloatSize&, const FloatPoint& phase, SkXfermode::Mode, |
| 145 const FloatRect&, const FloatSize& repeatSpacing = FloatSize()); | 146 const FloatRect&, const FloatSize& repeatSpacing = FloatSize()); |
| 146 | 147 |
| 147 enum ImageClampingMode { | 148 enum ImageClampingMode { |
| 148 ClampImageToSourceRect, | 149 ClampImageToSourceRect, |
| 149 DoNotClampImageToSourceRect | 150 DoNotClampImageToSourceRect |
| 150 }; | 151 }; |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 181 UntracedMember<ImageObserver> m_imageObserver; | 182 UntracedMember<ImageObserver> m_imageObserver; |
| 182 bool m_imageObserverDisabled; | 183 bool m_imageObserverDisabled; |
| 183 }; | 184 }; |
| 184 | 185 |
| 185 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ | 186 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ |
| 186 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) | 187 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##t ypeName()) |
| 187 | 188 |
| 188 } // namespace blink | 189 } // namespace blink |
| 189 | 190 |
| 190 #endif | 191 #endif |
| OLD | NEW |