Changeset 150053 in webkit
- Timestamp:
- May 13, 2013 9:04:36 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150049 r150053 1 2013-05-13 Benjamin Poulain <bpoulain@apple.com> 2 3 Remove platform/graphic's Generator 4 https://bugs.webkit.org/show_bug.cgi?id=116084 5 6 Reviewed by Darin Adler. 7 8 The Generator no longer abstract anything useful, its only 9 implementation is Gradient. 10 11 * GNUmakefile.list.am: 12 * WebCore.exp.in: 13 * WebCore.vcproj/WebCore.vcproj: 14 * WebCore.vcxproj/WebCore.vcxproj: 15 * WebCore.vcxproj/WebCore.vcxproj.filters: 16 * WebCore.xcodeproj/project.pbxproj: 17 * platform/graphics/GeneratedImage.h: 18 * platform/graphics/Generator.h: Removed. 19 * platform/graphics/GeneratorGeneratedImage.cpp: 20 (WebCore::GeneratorGeneratedImage::draw): 21 (WebCore::GeneratorGeneratedImage::drawPattern): 22 * platform/graphics/GeneratorGeneratedImage.h: 23 (WebCore::GeneratorGeneratedImage::create): 24 (WebCore::GeneratorGeneratedImage::GeneratorGeneratedImage): 25 (GeneratorGeneratedImage): 26 * platform/graphics/Gradient.h: 27 (WebCore): 28 (Gradient): 29 * platform/graphics/GraphicsContext.cpp: 30 (WebCore::GraphicsContext::fillRect): 31 * platform/graphics/GraphicsContext.h: 32 (WebCore): 33 (GraphicsContext): 34 1 35 2013-05-13 David Kilzer <ddkilzer@apple.com> 2 36 -
trunk/Source/WebCore/GNUmakefile.list.am
r150045 r150053 5680 5680 Source/WebCore/platform/graphics/GeneratedImage.cpp \ 5681 5681 Source/WebCore/platform/graphics/GeneratedImage.h \ 5682 Source/WebCore/platform/graphics/Generator.h \5683 5682 Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp \ 5684 5683 Source/WebCore/platform/graphics/GeneratorGeneratedImage.h \ -
trunk/Source/WebCore/WebCore.exp.in
r150010 r150053 68 68 __ZN3WTF6StringC1EP8NSString 69 69 __ZN3WTF6StringC1EPK10__CFString 70 __ZN7WebCore8GradientD1Ev 70 71 __ZN7WebCore10ClientRectC1ERKNS_7IntRectE 71 72 __ZN7WebCore10ClientRectC1ERKNS_9FloatRectE -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r150045 r150053 29995 29995 </File> 29996 29996 <File 29997 RelativePath="..\platform\graphics\Generator.h"29998 >29999 </File>30000 <File30001 29997 RelativePath="..\platform\graphics\GeneratorGeneratedImage.cpp" 30002 29998 > -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r150045 r150053 11667 11667 <ClInclude Include="..\platform\graphics\FontTraitsMask.h" /> 11668 11668 <ClInclude Include="..\platform\graphics\GeneratedImage.h" /> 11669 <ClInclude Include="..\platform\graphics\Generator.h" />11670 11669 <ClInclude Include="..\platform\graphics\Glyph.h" /> 11671 11670 <ClInclude Include="..\platform\graphics\GlyphBuffer.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r150045 r150053 8194 8194 <Filter>platform\graphics</Filter> 8195 8195 </ClInclude> 8196 <ClInclude Include="..\platform\graphics\Generator.h">8197 <Filter>platform\graphics</Filter>8198 </ClInclude>8199 8196 <ClInclude Include="..\platform\graphics\Glyph.h"> 8200 8197 <Filter>platform\graphics</Filter> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r150049 r150053 5002 5002 BCE0139A0C0BEF180043860A /* JSStyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE013980C0BEF180043860A /* JSStyleSheet.cpp */; }; 5003 5003 BCE0139B0C0BEF180043860A /* JSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE013990C0BEF180043860A /* JSStyleSheet.h */; }; 5004 BCE04C8A0DAFF7A0007A0F41 /* Generator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE04C890DAFF7A0007A0F41 /* Generator.h */; settings = {ATTRIBUTES = (Private, ); }; };5005 5004 BCE1C41B0D982980003B02F2 /* Location.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE1C4190D982980003B02F2 /* Location.h */; }; 5006 5005 BCE1C41C0D982981003B02F2 /* Location.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE1C41A0D982980003B02F2 /* Location.cpp */; }; … … 11726 11725 BCE013980C0BEF180043860A /* JSStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheet.cpp; sourceTree = "<group>"; }; 11727 11726 BCE013990C0BEF180043860A /* JSStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSStyleSheet.h; sourceTree = "<group>"; }; 11728 BCE04C890DAFF7A0007A0F41 /* Generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Generator.h; sourceTree = "<group>"; };11729 11727 BCE1C4190D982980003B02F2 /* Location.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Location.h; sourceTree = "<group>"; }; 11730 11728 BCE1C41A0D982980003B02F2 /* Location.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Location.cpp; sourceTree = "<group>"; }; … … 18416 18414 4FB390AC15EF61F3007AD51F /* GeneratedImage.cpp */, 18417 18415 BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */, 18418 BCE04C890DAFF7A0007A0F41 /* Generator.h */,18419 18416 2D2FC0561460CD6F00263633 /* GeneratorGeneratedImage.cpp */, 18420 18417 2D2FC0571460CD6F00263633 /* GeneratorGeneratedImage.h */, … … 21935 21932 C0C054CC1118C8E400CE2636 /* generate-bindings.pl in Headers */, 21936 21933 BC23F0DB0DAFF4A4009FDC91 /* GeneratedImage.h in Headers */, 21937 BCE04C8A0DAFF7A0007A0F41 /* Generator.h in Headers */,21938 21934 2D481F04146B5C6B00AA7834 /* GeneratorGeneratedImage.h in Headers */, 21939 21935 A622A8FF122C44A600A785B3 /* GenericBinding.h in Headers */, -
trunk/Source/WebCore/platform/graphics/GeneratedImage.h
r148921 r150053 1 1 /* 2 * Copyright (C) 2008 Apple Computer, Inc. All rights reserved.2 * Copyright (C) 2008, 2013 Apple Computer, Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "Image.h" 30 30 31 #include "Generator.h"32 31 #include "IntSize.h" 33 32 #include <wtf/RefPtr.h> -
trunk/Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp
r149886 r150053 1 1 /* 2 * Copyright (C) 2008, 2009, 2010, 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 42 42 destContext->scale(FloatSize(destRect.width() / srcRect.width(), destRect.height() / srcRect.height())); 43 43 destContext->translate(-srcRect.x(), -srcRect.y()); 44 destContext->fillRect(FloatRect(FloatPoint(), m_size), *m_g enerator.get());44 destContext->fillRect(FloatRect(FloatPoint(), m_size), *m_gradient.get()); 45 45 } 46 46 … … 51 51 IntSize adjustedSize = m_size; 52 52 FloatRect adjustedSrcRect = srcRect; 53 m_g enerator->adjustParametersForTiledDrawing(adjustedSize, adjustedSrcRect);53 m_gradient->adjustParametersForTiledDrawing(adjustedSize, adjustedSrcRect); 54 54 55 55 // Factor in the destination context's scale to generate at the best resolution … … 61 61 adjustedSrcRect.scale(xScale, yScale); 62 62 63 unsigned generatorHash = m_g enerator->hash();63 unsigned generatorHash = m_gradient->hash(); 64 64 65 65 if (!m_cachedImageBuffer || m_cachedGeneratorHash != generatorHash || m_cachedAdjustedSize != adjustedSize || !destContext->isCompatibleWithBuffer(m_cachedImageBuffer.get())) { 66 m_cachedImageBuffer = destContext->createCompatibleBuffer(adjustedSize, m_g enerator->hasAlpha());66 m_cachedImageBuffer = destContext->createCompatibleBuffer(adjustedSize, m_gradient->hasAlpha()); 67 67 if (!m_cachedImageBuffer) 68 68 return; 69 69 70 70 // Fill with the generated image. 71 m_cachedImageBuffer->context()->fillRect(FloatRect(FloatPoint(), adjustedSize), *m_g enerator);71 m_cachedImageBuffer->context()->fillRect(FloatRect(FloatPoint(), adjustedSize), *m_gradient); 72 72 73 73 m_cachedGeneratorHash = generatorHash; -
trunk/Source/WebCore/platform/graphics/GeneratorGeneratedImage.h
r149886 r150053 1 1 /* 2 * Copyright (C) 2008, 2012 Apple Computer, Inc. All rights reserved.2 * Copyright (C) 2008, 2012, 2013 Apple Computer, Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 29 29 #include "GeneratedImage.h" 30 #include "G enerator.h"30 #include "Gradient.h" 31 31 #include "Image.h" 32 32 #include "ImageBuffer.h" … … 38 38 class GeneratorGeneratedImage : public GeneratedImage { 39 39 public: 40 static PassRefPtr<GeneratorGeneratedImage> create(PassRefPtr<G enerator> generator, const IntSize& size)40 static PassRefPtr<GeneratorGeneratedImage> create(PassRefPtr<Gradient> generator, const IntSize& size) 41 41 { 42 42 return adoptRef(new GeneratorGeneratedImage(generator, size)); … … 50 50 const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode); 51 51 52 GeneratorGeneratedImage(PassRefPtr<G enerator> generator, const IntSize& size)53 : m_g enerator(generator)52 GeneratorGeneratedImage(PassRefPtr<Gradient> generator, const IntSize& size) 53 : m_gradient(generator) 54 54 { 55 55 m_size = size; 56 56 } 57 57 58 RefPtr<G enerator> m_generator;58 RefPtr<Gradient> m_gradient; 59 59 OwnPtr<ImageBuffer> m_cachedImageBuffer; 60 60 IntSize m_cachedAdjustedSize; -
trunk/Source/WebCore/platform/graphics/Gradient.h
r149193 r150053 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2011, 2012, 2013 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 4 * Copyright (C) 2008 Torch Mobile, Inc. … … 31 31 #include "AffineTransform.h" 32 32 #include "FloatPoint.h" 33 #include "Generator.h"34 33 #include "GraphicsTypes.h" 35 34 #include <wtf/PassRefPtr.h> 35 #include <wtf/RefCounted.h> 36 36 #include <wtf/Vector.h> 37 37 … … 67 67 68 68 class Color; 69 70 class Gradient : public Generator { 69 class FloatRect; 70 class GraphicsContext; 71 72 class Gradient : public RefCounted<Gradient> { 71 73 public: 72 74 static PassRefPtr<Gradient> create(const FloatPoint& p0, const FloatPoint& p1) … … 78 80 return adoptRef(new Gradient(p0, r0, p1, r1, aspectRatio)); 79 81 } 80 virtual~Gradient();82 ~Gradient(); 81 83 82 84 struct ColorStop; … … 85 87 86 88 void getColor(float value, float* r, float* g, float* b, float* a) const; 87 virtual bool hasAlpha() const OVERRIDE;89 bool hasAlpha() const; 88 90 89 91 bool isRadial() const { return m_radial; } … … 163 165 AffineTransform gradientSpaceTransform() { return m_gradientSpaceTransformation; } 164 166 165 v irtual void fill(GraphicsContext*, const FloatRect&);166 v irtual void adjustParametersForTiledDrawing(IntSize& size, FloatRect& srcRect);167 void fill(GraphicsContext*, const FloatRect&); 168 void adjustParametersForTiledDrawing(IntSize&, FloatRect&); 167 169 168 170 void setPlatformGradientSpaceTransform(const AffineTransform& gradientSpaceTransformation); 169 171 170 virtual unsigned hash() const OVERRIDE;172 unsigned hash() const; 171 173 void invalidateHash() { m_cachedHash = 0; } 172 174 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r149193 r150053 1 1 /* 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "BidiResolver.h" 30 30 #include "BitmapImage.h" 31 #include "G enerator.h"31 #include "Gradient.h" 32 32 #include "ImageBuffer.h" 33 33 #include "IntRect.h" … … 665 665 } 666 666 667 void GraphicsContext::fillRect(const FloatRect& rect, G enerator& generator)668 { 669 if (paintingDisabled()) 670 return; 671 g enerator.fill(this, rect);667 void GraphicsContext::fillRect(const FloatRect& rect, Gradient& gradient) 668 { 669 if (paintingDisabled()) 670 return; 671 gradient.fill(this, rect); 672 672 } 673 673 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r149566 r150053 1 1 /* 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. 4 4 * … … 83 83 class AffineTransform; 84 84 class DrawingBuffer; 85 class G enerator;85 class Gradient; 86 86 class GraphicsContextPlatformPrivate; 87 87 class ImageBuffer; … … 271 271 void fillRect(const FloatRect&); 272 272 void fillRect(const FloatRect&, const Color&, ColorSpace); 273 void fillRect(const FloatRect&, G enerator&);273 void fillRect(const FloatRect&, Gradient&); 274 274 void fillRect(const FloatRect&, const Color&, ColorSpace, CompositeOperator, BlendMode = BlendModeNormal); 275 275 void fillRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color&, ColorSpace);
Note: See TracChangeset
for help on using the changeset viewer.