Changeset 167497 in webkit
- Timestamp:
- Apr 18, 2014 11:35:20 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167493 r167497 1 2014-04-18 Simon Fraser <simon.fraser@apple.com> 2 3 Remove some includes from image-related headers, and Document.h 4 https://bugs.webkit.org/show_bug.cgi?id=131797 5 6 Reviewed by Martin Robinson. 7 8 Remove some #includes from Document.h, DragImage.h, GradientImage.h, 9 Image.h, and ImageBuffer.h and deal with the fallout. 10 11 * dom/ContainerNode.h: 12 * dom/Document.cpp: 13 (WebCore::Document::setInputCursor): 14 * dom/Document.h: 15 (WebCore::Document::inputCursor): 16 * dom/MutationObserverRegistration.cpp: 17 * html/canvas/WebGLRenderingContext.cpp: 18 * page/FrameSnapshotting.cpp: 19 * page/Page.cpp: 20 * platform/DragImage.h: 21 * platform/graphics/BitmapImage.cpp: 22 * platform/graphics/GradientImage.cpp: 23 (WebCore::GradientImage::GradientImage): 24 (WebCore::GradientImage::~GradientImage): 25 * platform/graphics/GradientImage.h: 26 * platform/graphics/Image.h: 27 * platform/graphics/ImageBuffer.cpp: 28 * platform/graphics/ImageBuffer.h: 29 (WebCore::ImageBuffer::create): 30 (WebCore::ImageBuffer::internalSize): 31 (WebCore::ImageBuffer::logicalSize): 32 (WebCore::ImageBuffer::baseTransform): 33 (WebCore::ImageBuffer::spaceSize): 34 (WebCore::ImageBuffer::setSpaceSize): 35 * rendering/RenderThemeMac.mm: 36 * rendering/shapes/Shape.cpp: 37 * rendering/svg/RenderSVGContainer.cpp: 38 * svg/SVGURIReference.h: 39 1 40 2014-04-18 Gabor Rapcsanyi <rgabor@webkit.org> 2 41 -
trunk/Source/WebCore/dom/ContainerNode.h
r166853 r167497 34 34 35 35 class FloatPoint; 36 class QualifiedName; 36 37 class RenderElement; 37 38 -
trunk/Source/WebCore/dom/Document.cpp
r167481 r167497 223 223 #include "WebReplayInputs.h" 224 224 #include <replay/EmptyInputCursor.h> 225 #include <replay/InputCursor.h> 225 226 #endif 226 227 … … 6189 6190 } 6190 6191 6192 #if ENABLE(WEB_REPLAY) 6193 void Document::setInputCursor(PassRefPtr<InputCursor> cursor) 6194 { 6195 m_inputCursor = cursor; 6196 } 6197 #endif 6198 6191 6199 } // namespace WebCore -
trunk/Source/WebCore/dom/Document.h
r166937 r167497 36 36 #include "DocumentTiming.h" 37 37 #include "FocusDirection.h" 38 #include "HitTestRequest.h"39 38 #include "IconURL.h" 40 39 #include "MutationObserver.h" 41 40 #include "PageVisibilityState.h" 42 41 #include "PlatformScreen.h" 43 #include "QualifiedName.h"44 42 #include "ReferrerPolicy.h" 45 43 #include "RenderPtr.h" … … 60 58 #include <wtf/WeakPtr.h> 61 59 60 namespace JSC { 61 class ExecState; 62 62 #if ENABLE(WEB_REPLAY) 63 #include <replay/InputCursor.h> 64 #endif 63 class InputCursor; 64 #endif 65 } 65 66 66 67 namespace WebCore { … … 89 90 class DocumentParser; 90 91 class DocumentSharedObjectPool; 91 class DocumentStyleSheetCollection;92 92 class DocumentType; 93 93 class Element; … … 131 131 class PlatformMouseEvent; 132 132 class ProcessingInstruction; 133 class QualifiedName; 133 134 class Range; 134 135 class RegisteredEventListener; … … 480 481 481 482 #if ENABLE(WEB_REPLAY) 482 InputCursor& inputCursor() const { return *m_inputCursor; }483 void setInputCursor(PassRefPtr< InputCursor> cursor) { m_inputCursor = cursor; }483 JSC::InputCursor& inputCursor() const { return *m_inputCursor; } 484 void setInputCursor(PassRefPtr<JSC::InputCursor>); 484 485 #endif 485 486 … … 1693 1694 1694 1695 #if ENABLE(WEB_REPLAY) 1695 RefPtr< InputCursor> m_inputCursor;1696 RefPtr<JSC::InputCursor> m_inputCursor; 1696 1697 #endif 1697 1698 -
trunk/Source/WebCore/dom/MutationObserverRegistration.cpp
r164662 r167497 34 34 35 35 #include "Document.h" 36 #include "QualifiedName.h" 36 37 37 38 namespace WebCore { -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r167196 r167497 41 41 #include "FrameLoaderClient.h" 42 42 #include "FrameView.h" 43 #include "GraphicsContext.h" 43 44 #include "HTMLCanvasElement.h" 44 45 #include "HTMLImageElement.h" -
trunk/Source/WebCore/page/FrameSnapshotting.cpp
r163739 r167497 36 36 #include "FrameSelection.h" 37 37 #include "FrameView.h" 38 #include "GraphicsContext.h" 38 39 #include "ImageBuffer.h" 39 40 #include "Page.h" -
trunk/Source/WebCore/page/Page.cpp
r167172 r167497 96 96 #if ENABLE(WEB_REPLAY) 97 97 #include "ReplayController.h" 98 #include <replay/InputCursor.h> 98 99 #endif 99 100 -
trunk/Source/WebCore/platform/DragImage.h
r165676 r167497 29 29 #include "FloatSize.h" 30 30 #include "FontRenderingMode.h" 31 #include "FrameSnapshotting.h"32 31 #include "ImageOrientation.h" 33 32 #include "IntSize.h" -
trunk/Source/WebCore/platform/graphics/BitmapImage.cpp
r167356 r167497 29 29 30 30 #include "FloatRect.h" 31 #include "GraphicsContext.h" 31 32 #include "ImageBuffer.h" 32 33 #include "ImageObserver.h" -
trunk/Source/WebCore/platform/graphics/GradientImage.cpp
r166582 r167497 29 29 #include "FloatRect.h" 30 30 #include "GraphicsContext.h" 31 #include "ImageBuffer.h" 31 32 #include "Length.h" 32 33 33 34 namespace WebCore { 35 36 GradientImage::GradientImage(PassRefPtr<Gradient> generator, const FloatSize& size) 37 : m_gradient(generator) 38 { 39 setContainerSize(size); 40 } 41 42 GradientImage::~GradientImage() 43 { 44 } 34 45 35 46 void GradientImage::draw(GraphicsContext* destContext, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription) -
trunk/Source/WebCore/platform/graphics/GradientImage.h
r166582 r167497 31 31 #include "Gradient.h" 32 32 #include "Image.h" 33 #include "ImageBuffer.h"34 33 #include <wtf/RefPtr.h> 35 34 36 35 namespace WebCore { 36 37 class ImageBuffer; 37 38 38 39 class GradientImage final : public GeneratedImage { … … 43 44 } 44 45 45 virtual ~GradientImage() { }46 virtual ~GradientImage(); 46 47 47 48 protected: … … 50 51 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override; 51 52 52 GradientImage(PassRefPtr<Gradient> generator, const FloatSize& size) 53 : m_gradient(generator) 54 { 55 setContainerSize(size); 56 } 53 GradientImage(PassRefPtr<Gradient>, const FloatSize&); 57 54 58 55 private: -
trunk/Source/WebCore/platform/graphics/Image.h
r167356 r167497 34 34 #include "GraphicsTypes.h" 35 35 #include "ImageOrientation.h" 36 #include "IntRect.h"37 36 #include "NativeImagePtr.h" 38 37 #include <wtf/PassRefPtr.h> -
trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp
r166582 r167497 28 28 #include "ImageBuffer.h" 29 29 30 #include "GraphicsContext.h" 30 31 #include "IntRect.h" 31 32 #include <wtf/MathExtras.h> -
trunk/Source/WebCore/platform/graphics/ImageBuffer.h
r166582 r167497 31 31 #include "AffineTransform.h" 32 32 #include "ColorSpace.h" 33 #include "FloatRect.h"34 #include "GraphicsContext.h"35 33 #include "GraphicsTypes.h" 36 34 #include "GraphicsTypes3D.h" … … 38 36 #include "ImageBufferData.h" 39 37 #include "PlatformLayer.h" 40 #include <runtime/JSCInlines.h>41 #include <runtime/TypedArrayInlines.h>42 38 #include <runtime/Uint8ClampedArray.h> 43 39 #include <wtf/Forward.h> … … 48 44 namespace WebCore { 49 45 50 class Image; 51 class ImageData; 52 class IntPoint; 53 class IntRect; 54 class GraphicsContext3D; 46 class FloatRect; 47 class GraphicsContext; 48 class GraphicsContext3D; 49 class Image; 50 class ImageData; 51 class IntPoint; 52 class IntRect; 55 53 56 57 58 59 54 enum Multiply { 55 Premultiplied, 56 Unmultiplied 57 }; 60 58 61 enum RenderingMode { 62 Unaccelerated, 63 UnacceleratedNonPlatformBuffer, // Use plain memory allocation rather than platform API to allocate backing store. 64 Accelerated 65 }; 59 enum RenderingMode { 60 Unaccelerated, 61 UnacceleratedNonPlatformBuffer, // Use plain memory allocation rather than platform API to allocate backing store. 62 Accelerated 63 }; 64 65 enum BackingStoreCopy { 66 CopyBackingStore, // Guarantee subsequent draws don't affect the copy. 67 DontCopyBackingStore // Subsequent draws may affect the copy. 68 }; 69 70 enum ScaleBehavior { 71 Scaled, 72 Unscaled 73 }; 74 75 class ImageBuffer { 76 WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED; 77 public: 78 // Will return a null pointer on allocation failure. 79 static std::unique_ptr<ImageBuffer> create(const FloatSize& size, float resolutionScale = 1, ColorSpace colorSpace = ColorSpaceDeviceRGB, RenderingMode renderingMode = Unaccelerated) 80 { 81 bool success = false; 82 std::unique_ptr<ImageBuffer> buffer(new ImageBuffer(size, resolutionScale, colorSpace, renderingMode, success)); 83 if (!success) 84 return nullptr; 85 return buffer; 86 } 87 88 static std::unique_ptr<ImageBuffer> createCompatibleBuffer(const FloatSize&, float resolutionScale, ColorSpace, const GraphicsContext*, bool hasAlpha); 89 90 ~ImageBuffer(); 91 92 // The actual resolution of the backing store 93 const IntSize& internalSize() const { return m_size; } 94 const IntSize& logicalSize() const { return m_logicalSize; } 95 96 GraphicsContext* context() const; 97 98 PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavior = Scaled) const; 99 // Give hints on the faster copyImage Mode, return DontCopyBackingStore if it supports the DontCopyBackingStore behavior 100 // or return CopyBackingStore if it doesn't. 101 static BackingStoreCopy fastCopyImageMode(); 102 103 enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSystem }; 104 105 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const; 106 PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const; 107 108 void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem = LogicalCoordinateSystem); 66 109 67 enum BackingStoreCopy { 68 CopyBackingStore, // Guarantee subsequent draws don't affect the copy. 69 DontCopyBackingStore // Subsequent draws may affect the copy. 70 }; 110 void convertToLuminanceMask(); 111 112 String toDataURL(const String& mimeType, const double* quality = 0, CoordinateSystem = LogicalCoordinateSystem) const; 113 #if !USE(CG) 114 AffineTransform baseTransform() const { return AffineTransform(); } 115 void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace); 116 void platformTransformColorSpace(const Vector<int>&); 117 #else 118 AffineTransform baseTransform() const { return AffineTransform(1, 0, 0, -1, 0, m_data.m_backingStoreSize.height()); } 119 #endif 120 PlatformLayer* platformLayer() const; 71 121 72 enum ScaleBehavior { 73 Scaled, 74 Unscaled 75 }; 122 // FIXME: current implementations of this method have the restriction that they only work 123 // with textures that are RGB or RGBA format, and UNSIGNED_BYTE type. 124 bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, bool, bool); 76 125 77 class ImageBuffer { 78 WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED; 79 public: 80 // Will return a null pointer on allocation failure. 81 static std::unique_ptr<ImageBuffer> create(const FloatSize& size, float resolutionScale = 1, ColorSpace colorSpace = ColorSpaceDeviceRGB, RenderingMode renderingMode = Unaccelerated) 82 { 83 bool success = false; 84 std::unique_ptr<ImageBuffer> buffer(new ImageBuffer(size, resolutionScale, colorSpace, renderingMode, success)); 85 if (!success) 86 return nullptr; 87 return buffer; 88 } 126 FloatSize spaceSize() const { return m_space; } 127 void setSpaceSize(const FloatSize& space) 128 { 129 m_space = space; 130 } 89 131 90 static std::unique_ptr<ImageBuffer> createCompatibleBuffer(const FloatSize&, float resolutionScale, ColorSpace, const GraphicsContext*, bool hasAlpha); 132 private: 133 #if USE(CG) 134 // The returned image might be larger than the internalSize(). If you want the smaller 135 // image, crop the result. 136 RetainPtr<CGImageRef> copyNativeImage(BackingStoreCopy = CopyBackingStore) const; 137 void flushContext() const; 138 #endif 139 void clip(GraphicsContext*, const FloatRect&) const; 91 140 92 ~ImageBuffer(); 141 void draw(GraphicsContext*, ColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false); 142 void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal); 93 143 94 // The actual resolution of the backing store 95 const IntSize& internalSize() const { return m_size; } 96 const IntSize& logicalSize() const { return m_logicalSize; } 144 inline void genericConvertToLuminanceMask(); 97 145 98 GraphicsContext* context() const; 146 friend class GraphicsContext; 147 friend class GeneratedImage; 148 friend class CrossfadeGeneratedImage; 149 friend class GradientImage; 99 150 100 PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavior = Scaled) const; 101 // Give hints on the faster copyImage Mode, return DontCopyBackingStore if it supports the DontCopyBackingStore behavior 102 // or return CopyBackingStore if it doesn't. 103 static BackingStoreCopy fastCopyImageMode(); 151 private: 152 ImageBufferData m_data; 153 IntSize m_size; 154 IntSize m_logicalSize; 155 float m_resolutionScale; 156 OwnPtr<GraphicsContext> m_context; 157 FloatSize m_space; 104 158 105 enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSystem }; 106 107 PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const; 108 PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const; 109 110 void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem = LogicalCoordinateSystem); 111 112 void convertToLuminanceMask(); 113 114 String toDataURL(const String& mimeType, const double* quality = 0, CoordinateSystem = LogicalCoordinateSystem) const; 115 #if !USE(CG) 116 AffineTransform baseTransform() const { return AffineTransform(); } 117 void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace); 118 void platformTransformColorSpace(const Vector<int>&); 119 #else 120 AffineTransform baseTransform() const { return AffineTransform(1, 0, 0, -1, 0, m_data.m_backingStoreSize.height()); } 121 #endif 122 PlatformLayer* platformLayer() const; 123 124 // FIXME: current implementations of this method have the restriction that they only work 125 // with textures that are RGB or RGBA format, and UNSIGNED_BYTE type. 126 bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, bool, bool); 127 128 FloatSize spaceSize() const { return m_space; } 129 void setSpaceSize(const FloatSize& space) 130 { 131 m_space = space; 132 } 133 134 private: 135 #if USE(CG) 136 // The returned image might be larger than the internalSize(). If you want the smaller 137 // image, crop the result. 138 RetainPtr<CGImageRef> copyNativeImage(BackingStoreCopy = CopyBackingStore) const; 139 void flushContext() const; 140 #endif 141 void clip(GraphicsContext*, const FloatRect&) const; 142 143 void draw(GraphicsContext*, ColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false); 144 void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal); 145 146 inline void genericConvertToLuminanceMask(); 147 148 friend class GraphicsContext; 149 friend class GeneratedImage; 150 friend class CrossfadeGeneratedImage; 151 friend class GradientImage; 152 153 private: 154 ImageBufferData m_data; 155 IntSize m_size; 156 IntSize m_logicalSize; 157 float m_resolutionScale; 158 OwnPtr<GraphicsContext> m_context; 159 FloatSize m_space; 160 161 // This constructor will place its success into the given out-variable 162 // so that create() knows when it should return failure. 163 ImageBuffer(const FloatSize&, float resolutionScale, ColorSpace, RenderingMode, bool& success); 164 }; 159 // This constructor will place its success into the given out-variable 160 // so that create() knows when it should return failure. 161 ImageBuffer(const FloatSize&, float resolutionScale, ColorSpace, RenderingMode, bool& success); 162 }; 165 163 166 164 #if USE(CG) 167 165 String ImageDataToDataURL(const ImageData&, const String& mimeType, const double* quality); 168 166 #endif 169 167 -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r167145 r167497 66 66 #import <wtf/RetainPtr.h> 67 67 #import <wtf/StdLibExtras.h> 68 #import <wtf/text/StringBuilder.h> 68 69 #import <Carbon/Carbon.h> 69 70 #import <Cocoa/Cocoa.h> -
trunk/Source/WebCore/rendering/shapes/Shape.cpp
r167395 r167497 33 33 #include "BasicShapeFunctions.h" 34 34 #include "BoxShape.h" 35 #include "GraphicsContext.h" 35 36 #include "ImageBuffer.h" 36 37 #include "LengthFunctions.h" -
trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
r163440 r167497 26 26 27 27 #include "GraphicsContext.h" 28 #include "HitTestRequest.h" 28 29 #include "LayoutRepainter.h" 29 30 #include "RenderIterator.h" -
trunk/Source/WebCore/svg/SVGURIReference.h
r163440 r167497 23 23 24 24 #include "Document.h" 25 #include "QualifiedName.h" 25 26 26 27 namespace WebCore {
Note: See TracChangeset
for help on using the changeset viewer.