Changeset 106978 in webkit


Ignore:
Timestamp:
Feb 7, 2012 12:48:30 PM (12 years ago)
Author:
jer.noble@apple.com
Message:

Use CMClock as a timing source for PlatformClock where available.
https://bugs.webkit.org/show_bug.cgi?id=77885

Reviewed by Eric Carlson.

Source/JavaScriptCore:

  • wtf/Platform.h: Added WTF_USE_COREMEDIA.

Source/WebCore:

No new tests; performance improvement covered by existing test cases.

  • WebCore.xcodeproj/project.pbxproj:
  • platform/Clock.cpp:

(Clock::create): Use PlatformClockCM if available.

  • platform/mac/PlatformClockCM.h: Added.

(WebCore::PlatformClockCM::playRate):
(WebCore::PlatformClockCM::isRunning):

  • platform/mac/PlatformClockCM.mm: Added.

(PlatformClockCM::PlatformClockCM):
(PlatformClockCM::initializeWithTimingSource):
(PlatformClockCM::setCurrentTime):
(PlatformClockCM::currentTime):
(PlatformClockCM::setPlayRate):
(PlatformClockCM::start):
(PlatformClockCM::stop):

Location:
trunk/Source
Files:
1 added
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r106879 r106978  
     12012-02-06  Jer Noble  <jer.noble@apple.com>
     2
     3        Use CMClock as a timing source for PlatformClock where available.
     4        https://bugs.webkit.org/show_bug.cgi?id=77885
     5
     6        Reviewed by Eric Carlson.
     7
     8        * wtf/Platform.h: Added WTF_USE_COREMEDIA.
     9
    1102012-02-06  Filip Pizlo  <fpizlo@apple.com>
    211
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r106650 r106978  
    11421142#endif
    11431143
     1144#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION)
     1145#define WTF_USE_COREMEDIA 1
     1146#endif
     1147
    11441148#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) || PLATFORM(QT)
    11451149#define WTF_USE_REQUEST_ANIMATION_FRAME_TIMER 1
  • trunk/Source/WebCore/ChangeLog

    r106977 r106978  
     12012-02-06  Jer Noble  <jer.noble@apple.com>
     2
     3        Use CMClock as a timing source for PlatformClock where available.
     4        https://bugs.webkit.org/show_bug.cgi?id=77885
     5
     6        Reviewed by Eric Carlson.
     7
     8        No new tests; performance improvement covered by existing test cases.
     9
     10        * WebCore.xcodeproj/project.pbxproj:
     11        * platform/Clock.cpp:
     12        (Clock::create): Use PlatformClockCM if available.
     13        * platform/mac/PlatformClockCM.h: Added.
     14        (WebCore::PlatformClockCM::playRate):
     15        (WebCore::PlatformClockCM::isRunning):
     16        * platform/mac/PlatformClockCM.mm: Added.
     17        (PlatformClockCM::PlatformClockCM):
     18        (PlatformClockCM::initializeWithTimingSource):
     19        (PlatformClockCM::setCurrentTime):
     20        (PlatformClockCM::currentTime):
     21        (PlatformClockCM::setPlayRate):
     22        (PlatformClockCM::start):
     23        (PlatformClockCM::stop):
     24
    1252012-02-06  Anders Carlsson  <andersca@apple.com>
    226
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r106953 r106978  
    55995599                CD8203101395ACE700F956C6 /* WebWindowAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */; };
    56005600                CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */; };
     5601                CDAA8D0A14D71B2E0061EA60 /* PlatformClockCM.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */; };
    56015602                CDD525D7145B6DD0008D204D /* JSHTMLMediaElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDF65CCC145B6AFE00C4C7AA /* JSHTMLMediaElementCustom.cpp */; };
    56025603                CDEA763014608A53008B31F1 /* PlatformClockCA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */; };
     
    1255112552                CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebWindowAnimation.h; sourceTree = "<group>"; };
    1255212553                CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebWindowAnimation.mm; sourceTree = "<group>"; };
     12554                CDAA8D0714D385600061EA60 /* PlatformClockCM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCM.h; sourceTree = "<group>"; };
     12555                CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformClockCM.mm; sourceTree = "<group>"; };
    1255312556                CDBD93BA1333BD4B002570E3 /* fullscreenQuickTime.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = fullscreenQuickTime.css; sourceTree = "<group>"; };
    1255412557                CDCE5CD014633BC900D47CCA /* EventTargetFactory.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventTargetFactory.in; sourceTree = "<group>"; };
     
    1503615039                                CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */,
    1503715040                                CDEA762F146084EE008B31F1 /* PlatformClockCA.h */,
     15041                                CDAA8D0714D385600061EA60 /* PlatformClockCM.h */,
     15042                                CDAA8D0814D385600061EA60 /* PlatformClockCM.mm */,
    1503815043                                BCAA486E14A052530088FAC4 /* PlatformEventFactoryMac.h */,
    1503915044                                BCAA486D14A052530088FAC4 /* PlatformEventFactoryMac.mm */,
     
    2709327098                                1AAADDE814DC8DF800AF64B3 /* ScrollingTreeNodeMac.mm in Sources */,
    2709427099                                7A54857F14E02D51006AE05A /* InspectorHistory.cpp in Sources */,
     27100                                CDAA8D0A14D71B2E0061EA60 /* PlatformClockCM.mm in Sources */,
    2709527101                        );
    2709627102                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/platform/Clock.cpp

    r99488 r106978  
    2727#include "Clock.h"
    2828
    29 #if USE(COREAUDIO)
     29#if USE(COREMEDIA)
     30    #include "PlatformClockCM.h"
     31#elif USE(COREAUDIO)
    3032    #include "PlatformClockCA.h"
    3133#else
     
    3739PassRefPtr<Clock> Clock::create()
    3840{
    39 #if USE(COREAUDIO)
     41#if USE(COREMEDIA)
     42    return adoptRef(new PlatformClockCM());
     43#elif USE(COREAUDIO)
    4044    return adoptRef(new PlatformClockCA());
    4145#else
  • trunk/Source/WebCore/platform/mac/PlatformClockCM.h

    r106977 r106978  
    11/*
    2  * Copyright (C) 2011 Apple Inc.  All rights reserved.
     2 * Copyright (C) 2012 Apple Inc.  All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
    2525
    26 #include "config.h"
     26#ifndef PlatformClockCM_h
     27#define PlatformClockCM_h
     28
     29#if USE(COREMEDIA)
     30
    2731#include "Clock.h"
     32#include <wtf/RetainPtr.h>
    2833
    29 #if USE(COREAUDIO)
    30     #include "PlatformClockCA.h"
    31 #else
    32     #include "ClockGeneric.h"
     34typedef struct OpaqueCMTimebase* CMTimebaseRef;
     35typedef struct OpaqueCMClock* CMClockRef;
     36
     37namespace WebCore {
     38
     39class PlatformClockCM : public Clock {
     40public:
     41    PlatformClockCM();
     42    PlatformClockCM(CMClockRef);
     43
     44private:
     45    void initializeWithTimingSource(CMClockRef);
     46
     47    virtual void setCurrentTime(float);
     48    virtual float currentTime() const;
     49
     50    virtual void setPlayRate(float);
     51    virtual float playRate() const { return m_rate; }
     52
     53    virtual void start();
     54    virtual void stop();
     55    virtual bool isRunning() const { return m_running; }
     56
     57    RetainPtr<CMTimebaseRef> m_timebase;
     58    float m_rate;
     59    bool m_running;
     60};
     61
     62}
     63
    3364#endif
    3465
    35 using namespace WebCore;
    36 
    37 PassRefPtr<Clock> Clock::create()
    38 {
    39 #if USE(COREAUDIO)
    40     return adoptRef(new PlatformClockCA());
    41 #else
    42     return adoptRef(new ClockGeneric());
    4366#endif
    44 }
Note: See TracChangeset for help on using the changeset viewer.