Changeset 130072 in webkit


Ignore:
Timestamp:
Oct 1, 2012, 1:44:10 PM (13 years ago)
Author:
andersca@apple.com
Message:

Would like a way to customize the type of GraphicsLayers created on a per page basis
https://bugs.webkit.org/show_bug.cgi?id=98051

Reviewed by Simon Fraser.

Add a GraphicsLayerFactory abstract class and a new GraphicsLayer::create overload that takes
a factory object. Eventually, all calls to the old GraphicsLayer::create will be replaced with
the new version that takes an optional factory.

  • WebCore.xcodeproj/project.pbxproj:
  • platform/graphics/GraphicsLayer.h:

(WebCore):
(GraphicsLayer):

  • platform/graphics/GraphicsLayerFactory.h: Added.

(WebCore):
(GraphicsLayerFactory):
(WebCore::GraphicsLayerFactory::~GraphicsLayerFactory):

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayer::create):
(WebCore):

Location:
trunk/Source/WebCore
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r130069 r130072  
     12012-10-01  Anders Carlsson  <andersca@apple.com>
     2
     3        Would like a way to customize the type of GraphicsLayers created on a per page basis
     4        https://bugs.webkit.org/show_bug.cgi?id=98051
     5
     6        Reviewed by Simon Fraser.
     7
     8        Add a GraphicsLayerFactory abstract class and a new GraphicsLayer::create overload that takes
     9        a factory object. Eventually, all calls to the old GraphicsLayer::create will be replaced with
     10        the new version that takes an optional factory.
     11
     12        * WebCore.xcodeproj/project.pbxproj:
     13        * platform/graphics/GraphicsLayer.h:
     14        (WebCore):
     15        (GraphicsLayer):
     16        * platform/graphics/GraphicsLayerFactory.h: Added.
     17        (WebCore):
     18        (GraphicsLayerFactory):
     19        (WebCore::GraphicsLayerFactory::~GraphicsLayerFactory):
     20        * platform/graphics/ca/GraphicsLayerCA.cpp:
     21        (WebCore::GraphicsLayer::create):
     22        (WebCore):
     23
    1242012-10-01  Adam Klein  <adamk@chromium.org>
    225
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r130005 r130072  
    548548                1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC2260A0DB69F190089B669 /* JSDOMApplicationCache.cpp */; };
    549549                1AC2260D0DB69F190089B669 /* JSDOMApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC2260B0DB69F190089B669 /* JSDOMApplicationCache.h */; };
     550                1AC69593161A1E53003732CB /* GraphicsLayerFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC69592161A1E53003732CB /* GraphicsLayerFactory.h */; };
    550551                1ACD1B630B029739007E5016 /* DOMCSSStyleDeclarationInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85E711440AC5D5340053270F /* DOMCSSStyleDeclarationInternal.h */; };
    551552                1ACE53DF0A8D18810022947D /* JSDOMParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */; };
     
    76087609                1AC2260A0DB69F190089B669 /* JSDOMApplicationCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMApplicationCache.cpp; sourceTree = "<group>"; };
    76097610                1AC2260B0DB69F190089B669 /* JSDOMApplicationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMApplicationCache.h; sourceTree = "<group>"; };
     7611                1AC69592161A1E53003732CB /* GraphicsLayerFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsLayerFactory.h; sourceTree = "<group>"; };
    76107612                1ACE53DD0A8D18810022947D /* JSDOMParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMParser.cpp; sourceTree = "<group>"; };
    76117613                1ACE53DE0A8D18810022947D /* JSDOMParser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMParser.h; sourceTree = "<group>"; };
     
    1987919881                                0F580B0A0F12A2690051D689 /* GraphicsLayer.h */,
    1988019882                                0F580B0B0F12A2690051D689 /* GraphicsLayerClient.h */,
     19883                                1AC69592161A1E53003732CB /* GraphicsLayerFactory.h */,
    1988119884                                B2A015940AF6CD53006BCE0E /* GraphicsTypes.cpp */,
    1988219885                                B2A015950AF6CD53006BCE0E /* GraphicsTypes.h */,
     
    2550525508                                4F7B4A6615FF6D6A006B5F22 /* PlatformMemoryInstrumentation.h in Headers */,
    2550625509                                931D72F615FE695300C4C07E /* LayoutMilestones.h in Headers */,
     25510                                1AC69593161A1E53003732CB /* GraphicsLayerFactory.h in Headers */,
    2550725511                        );
    2550825512                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r128572 r130072  
    5555class FloatPoint3D;
    5656class GraphicsContext;
     57class GraphicsLayerFactory;
    5758class Image;
    5859class TextStream;
     
    192193    WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED;
    193194public:
     195    static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*);
     196
     197    // FIXME: Replace all uses of this create function with the one that takes a GraphicsLayerFactory.
    194198    static PassOwnPtr<GraphicsLayer> create(GraphicsLayerClient*);
    195199   
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r126926 r130072  
    3333#include "FloatConversion.h"
    3434#include "FloatRect.h"
     35#include "GraphicsLayerFactory.h"
    3536#include "PlatformCALayer.h"
    3637#include "RotateTransformOperation.h"
     
    256257#endif
    257258
     259PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client)
     260{
     261    if (!factory)
     262        return adoptPtr(new GraphicsLayerCA(client));
     263
     264    return factory->createGraphicsLayer(client);
     265}
     266
    258267PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
    259268{
Note: See TracChangeset for help on using the changeset viewer.