Changeset 89700 in webkit


Ignore:
Timestamp:
Jun 24, 2011 1:46:42 PM (13 years ago)
Author:
nduca@chromium.org
Message:

2011-06-24 Nat Duca <nduca@chromium.org>

Unreviewed, rolling out r89694.
http://trac.webkit.org/changeset/89694
https://bugs.webkit.org/show_bug.cgi?id=58408

Test shell still not ready for animate changes.

  • WebCore.gypi:
  • platform/graphics/chromium/LayerRendererChromium.cpp: (WebCore::LayerRendererChromium::create): (WebCore::LayerRendererChromium::LayerRendererChromium): (WebCore::LayerRendererChromium::setViewport): (WebCore::LayerRendererChromium::updateAndDrawLayers):
  • platform/graphics/chromium/LayerRendererChromium.h:
  • platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
  • platform/graphics/chromium/cc/CCHeadsUpDisplay.h: (WebCore::CCHeadsUpDisplay::setShowFPSCounter): (WebCore::CCHeadsUpDisplay::setShowPlatformLayerTree):
  • platform/graphics/chromium/cc/CCLayerTreeHost.cpp: Removed.
  • platform/graphics/chromium/cc/CCLayerTreeHost.h: Removed.
  • platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp: Removed.
  • platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h: Removed.
  • platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp: Removed.
  • platform/graphics/chromium/cc/CCLayerTreeHostImpl.h: Removed.
  • platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp: Removed.
  • platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h: Removed.
  • platform/graphics/chromium/cc/CCMainThreadTask.h:
  • platform/graphics/chromium/cc/CCThread.cpp: (WebCore::CCThread::runLoop):
  • platform/graphics/chromium/cc/CCThreadTask.h:

2011-06-24 Nat Duca <nduca@chromium.org>

Unreviewed, rolling out r89694.
http://trac.webkit.org/changeset/89694
https://bugs.webkit.org/show_bug.cgi?id=58408

Test shell still not ready for animate changes.

  • WebKit.gypi:
  • public/WebWidget.h: (WebKit::WebWidget::animate): (WebKit::WebWidget::composite):
  • src/WebPopupMenuImpl.cpp: (WebKit::WebPopupMenuImpl::animate):
  • src/WebPopupMenuImpl.h:
  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::resize): (WebKit::WebViewImpl::animate): (WebKit::WebViewImpl::paint): (WebKit::WebViewImpl::composite): (WebKit::WebViewImpl::fullFramePluginZoomLevelChanged): (WebKit::WebView::zoomLevelToZoomFactor): (WebKit::WebViewImpl::setRootLayerNeedsDisplay): (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): (WebKit::WebViewImpl::doComposite): (WebKit::WebViewImpl::reallocateRenderer): (WebKit::WebViewImpl::updateLayerRendererViewport): (WebKit::WebViewImpl::graphicsContext3D):
  • src/WebViewImpl.h:
  • tests/CCLayerTreeHostTest.cpp: Removed.
  • tests/CCThreadTest.cpp: (WebCore::TEST):

2011-06-24 Nat Duca <nduca@chromium.org>

Unreviewed, rolling out r89694.
http://trac.webkit.org/changeset/89694
https://bugs.webkit.org/show_bug.cgi?id=58408

Test shell still not ready for animate changes.

  • DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::paintInvalidatedRegion):
Location:
trunk
Files:
9 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89699 r89700  
     12011-06-24  Nat Duca  <nduca@chromium.org>
     2
     3        Unreviewed, rolling out r89694.
     4        http://trac.webkit.org/changeset/89694
     5        https://bugs.webkit.org/show_bug.cgi?id=58408
     6
     7        Test shell still not ready for animate changes.
     8
     9        * WebCore.gypi:
     10        * platform/graphics/chromium/LayerRendererChromium.cpp:
     11        (WebCore::LayerRendererChromium::create):
     12        (WebCore::LayerRendererChromium::LayerRendererChromium):
     13        (WebCore::LayerRendererChromium::setViewport):
     14        (WebCore::LayerRendererChromium::updateAndDrawLayers):
     15        * platform/graphics/chromium/LayerRendererChromium.h:
     16        * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp:
     17        * platform/graphics/chromium/cc/CCHeadsUpDisplay.h:
     18        (WebCore::CCHeadsUpDisplay::setShowFPSCounter):
     19        (WebCore::CCHeadsUpDisplay::setShowPlatformLayerTree):
     20        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: Removed.
     21        * platform/graphics/chromium/cc/CCLayerTreeHost.h: Removed.
     22        * platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp: Removed.
     23        * platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h: Removed.
     24        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp: Removed.
     25        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h: Removed.
     26        * platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp: Removed.
     27        * platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h: Removed.
     28        * platform/graphics/chromium/cc/CCMainThreadTask.h:
     29        * platform/graphics/chromium/cc/CCThread.cpp:
     30        (WebCore::CCThread::runLoop):
     31        * platform/graphics/chromium/cc/CCThreadTask.h:
     32
    1332011-06-24  Chris Rogers  <crogers@google.com>
    234
  • trunk/Source/WebCore/WebCore.gypi

    r89694 r89700  
    41684168            'platform/graphics/chromium/cc/CCLayerSorter.cpp',
    41694169            'platform/graphics/chromium/cc/CCLayerSorter.h',
    4170             'platform/graphics/chromium/cc/CCLayerTreeHost.cpp',
    4171             'platform/graphics/chromium/cc/CCLayerTreeHost.h',
    4172             'platform/graphics/chromium/cc/CCLayerTreeHostCommitter.cpp',
    4173             'platform/graphics/chromium/cc/CCLayerTreeHostCommitter.h',
    4174             'platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp',
    4175             'platform/graphics/chromium/cc/CCLayerTreeHostImpl.h',
    4176             'platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.cpp',
    4177             'platform/graphics/chromium/cc/CCLayerTreeHostImplProxy.h',
    41784170            'platform/graphics/chromium/cc/CCMainThread.cpp',
    41794171            'platform/graphics/chromium/cc/CCMainThread.h',
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r89694 r89700  
    5151#include "WebGLLayerChromium.h"
    5252#include "cc/CCLayerImpl.h"
    53 #include "cc/CCLayerTreeHostImpl.h"
    54 #include "cc/CCMainThreadTask.h"
    5553#if USE(SKIA)
    5654#include "Extensions3D.h"
     
    10199}
    102100
    103 PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(CCLayerTreeHostClient* client, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing)
    104 {
    105     RefPtr<GraphicsContext3D> context = client->createLayerTreeHostContext3D();
     101PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(PassRefPtr<GraphicsContext3D> context, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing)
     102{
    106103    if (!context)
    107104        return 0;
    108105
    109     RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(client, context, contentPaint, accelerateDrawing)));
    110     layerRenderer->init();
     106    RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(context, contentPaint, accelerateDrawing)));
    111107    if (!layerRenderer->hardwareCompositing())
    112108        return 0;
     
    115111}
    116112
    117 LayerRendererChromium::LayerRendererChromium(CCLayerTreeHostClient* client,
    118                                              PassRefPtr<GraphicsContext3D> context,
     113LayerRendererChromium::LayerRendererChromium(PassRefPtr<GraphicsContext3D> context,
    119114                                             PassOwnPtr<LayerPainterChromium> contentPaint,
    120115                                             bool accelerateDrawing)
    121     : CCLayerTreeHost(client)
    122     , m_viewportScrollPosition(IntPoint(-1, -1))
     116    : m_viewportScrollPosition(IntPoint(-1, -1))
    123117    , m_rootLayer(0)
    124118    , m_accelerateDrawing(false)
     
    230224        m_rootLayerContentTiler->invalidateEntireLayer();
    231225    }
    232     setNeedsCommitAndRedraw();
    233 }
    234 
    235 void LayerRendererChromium::updateLayers()
    236 {
    237     CCLayerTreeHost::updateLayers();
     226}
     227
     228void LayerRendererChromium::updateAndDrawLayers()
     229{
    238230    if (m_viewportVisibleRect.isEmpty())
    239231        return;
     
    260252    }
    261253
    262     m_computedRenderSurfaceLayerList = adoptPtr(new LayerList());
    263     updateLayers(*m_computedRenderSurfaceLayerList);
    264 }
    265 
    266 void LayerRendererChromium::drawLayers()
    267 {
    268     ASSERT(m_hardwareCompositing);
    269     ASSERT(m_computedRenderSurfaceLayerList);
     254    LayerList renderSurfaceLayerList;
     255    updateLayers(renderSurfaceLayerList);
     256
    270257    // Before drawLayers:
    271258    if (hardwareCompositing() && m_contextSupportsLatch) {
     
    290277    }
    291278
    292     drawLayers(*m_computedRenderSurfaceLayerList);
     279    drawLayers(renderSurfaceLayerList);
    293280
    294281    m_textureManager->unprotectAllTextures();
     
    12791266}
    12801267
    1281 class LayerRendererChromiumImpl : public CCLayerTreeHostImpl {
    1282 public:
    1283     static PassOwnPtr<LayerRendererChromiumImpl> create(CCLayerTreeHostImplClient* client, LayerRendererChromium* layerRenderer)
    1284     {
    1285         return adoptPtr(new LayerRendererChromiumImpl(client, layerRenderer));
    1286     }
    1287 
    1288     virtual void drawLayersAndPresent()
    1289     {
    1290         CCCompletionEvent completion;
    1291         bool contextLost;
    1292         CCMainThread::postTask(createMainThreadTask(this, &LayerRendererChromiumImpl::drawLayersOnMainThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&contextLost)));
    1293         completion.wait();
    1294 
    1295         // FIXME: Send the "UpdateRect" message up to the RenderWidget [or moveplugin equivalents...]
    1296 
    1297         // FIXME: handle context lost
    1298         if (contextLost)
    1299             FATAL("LayerRendererChromiumImpl does not handle context lost yet.");
    1300     }
    1301 
    1302 private:
    1303     LayerRendererChromiumImpl(CCLayerTreeHostImplClient* client, LayerRendererChromium* layerRenderer)
    1304         : CCLayerTreeHostImpl(client)
    1305         , m_layerRenderer(layerRenderer) { }
    1306 
    1307     void drawLayersOnMainThread(CCCompletionEvent* completion, bool* contextLost)
    1308     {
    1309         ASSERT(isMainThread());
    1310 
    1311         if (m_layerRenderer->rootLayer()) {
    1312             m_layerRenderer->drawLayers();
    1313             m_layerRenderer->present();
    1314 
    1315             GraphicsContext3D* context = m_layerRenderer->context();
    1316             *contextLost = context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR;
    1317         } else
    1318             *contextLost = false;
    1319         completion->signal();
    1320     }
    1321 
    1322     LayerRendererChromium* m_layerRenderer;
    1323 };
    1324 
    1325 class LayerRendererChromiumImplProxy : public CCLayerTreeHostImplProxy {
    1326 public:
    1327     static PassOwnPtr<LayerRendererChromiumImplProxy> create(LayerRendererChromium* layerRenderer)
    1328     {
    1329         return adoptPtr(new LayerRendererChromiumImplProxy(layerRenderer));
    1330     }
    1331 
    1332     virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl()
    1333     {
    1334         return LayerRendererChromiumImpl::create(this, static_cast<LayerRendererChromium*>(host()));
    1335     }
    1336 
    1337 private:
    1338     LayerRendererChromiumImplProxy(LayerRendererChromium* layerRenderer)
    1339         : CCLayerTreeHostImplProxy(layerRenderer) { }
    1340 };
    1341 
    1342 PassOwnPtr<CCLayerTreeHostImplProxy> LayerRendererChromium::createLayerTreeHostImplProxy()
    1343 {
    1344     OwnPtr<CCLayerTreeHostImplProxy> proxy = LayerRendererChromiumImplProxy::create(this);
    1345     proxy->start();
    1346     return proxy.release();
    1347 }
    1348 
    13491268} // namespace WebCore
    13501269
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h

    r89694 r89700  
    4545#include "cc/CCHeadsUpDisplay.h"
    4646#include "cc/CCLayerSorter.h"
    47 #include "cc/CCLayerTreeHost.h"
    4847#include "cc/CCPluginLayerImpl.h"
    4948#include "cc/CCVideoLayerImpl.h"
     
    5251#include <wtf/PassOwnPtr.h>
    5352#include <wtf/PassRefPtr.h>
     53#include <wtf/RefCounted.h>
    5454#include <wtf/Vector.h>
    5555
     
    6767class CCHeadsUpDisplay;
    6868class CCLayerImpl;
    69 class CCLayerTreeHostCommitter;
    70 class CCLayerTreeHostImpl;
    7169class GeometryBinding;
    7270class GraphicsContext3D;
     
    7472
    7573// Class that handles drawing of composited render layers using GL.
    76 class LayerRendererChromium : public CCLayerTreeHost {
     74class LayerRendererChromium : public RefCounted<LayerRendererChromium> {
    7775public:
    78     static PassRefPtr<LayerRendererChromium> create(CCLayerTreeHostClient*, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing);
     76    static PassRefPtr<LayerRendererChromium> create(PassRefPtr<GraphicsContext3D>, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing);
    7977
    8078    ~LayerRendererChromium();
     
    9189
    9290    // updates and draws the current layers onto the backbuffer
    93     virtual void updateLayers();
    94     void drawLayers();
     91    void updateAndDrawLayers();
    9592
    9693    // Set by WebViewImpl when animation callbacks are running.
     
    160157    static bool s_inPaintLayerContents;
    161158#endif
    162 protected:
    163     virtual PassOwnPtr<CCLayerTreeHostImplProxy> createLayerTreeHostImplProxy();
    164 
    165159private:
    166160    typedef Vector<RefPtr<CCLayerImpl> > LayerList;
    167161    typedef HashMap<GraphicsContext3D*, int> ChildContextMap;
    168162
    169     // FIXME: This needs to be moved to the CCLayerTreeHostImpl when that class exists.
     163    // FIXME: This needs to be moved to the CCViewImpl when that class exists.
    170164    RefPtr<CCLayerImpl> m_rootCCLayerImpl;
    171165
    172     LayerRendererChromium(CCLayerTreeHostClient*, PassRefPtr<GraphicsContext3D>, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing);
     166    LayerRendererChromium(PassRefPtr<GraphicsContext3D>, PassOwnPtr<LayerPainterChromium> contentPaint, bool accelerateDrawing);
    173167
    174168    void updateLayers(LayerList& renderSurfaceLayerList);
     
    216210    bool m_hardwareCompositing;
    217211    bool m_accelerateDrawing;
    218 
    219     OwnPtr<LayerList> m_computedRenderSurfaceLayerList;
    220212
    221213    RenderSurfaceChromium* m_currentRenderSurface;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp

    r89694 r89700  
    248248}
    249249
    250 void CCHeadsUpDisplay::setShowFPSCounter(bool show)
    251 {
    252     m_showFPSCounter = show;
    253     m_layerRenderer->setNeedsRedraw();
    254 }
    255 
    256 void CCHeadsUpDisplay::setShowPlatformLayerTree(bool show)
    257 {
    258     m_showPlatformLayerTree = show;
    259     m_layerRenderer->setNeedsRedraw();
    260 }
    261 
    262250}
    263251
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.h

    r89694 r89700  
    5050    ~CCHeadsUpDisplay();
    5151
    52     int currentFrameNumber() const { return m_currentFrameNumber; }
    53 
    5452    void onFrameBegin(double timestamp);
    5553    void onPresent();
    5654
    57     void setShowFPSCounter(bool enable);
     55    void setShowFPSCounter(bool enable) { m_showFPSCounter = enable; }
    5856    bool showFPSCounter() const { return m_showFPSCounter; }
    5957
    60     void setShowPlatformLayerTree(bool enable);
     58    void setShowPlatformLayerTree(bool enable) { m_showPlatformLayerTree = enable; }
    6159    bool showPlatformLayerTree() const { return m_showPlatformLayerTree; }
    6260
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCMainThreadTask.h

    r89694 r89700  
    2525#define CCMainThreadTask_h
    2626
     27#include "CCMainThread.h"
    2728#include "CrossThreadCopier.h"
    2829#include "CrossThreadTask.h"
    29 #include "cc/CCMainThread.h"
    3030#include <wtf/PassOwnPtr.h>
    3131#include <wtf/PassRefPtr.h>
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCThread.cpp

    r89694 r89700  
    2828
    2929#include "LayerRendererChromium.h"
    30 #include "TraceEvent.h"
    3130#include <wtf/CurrentTime.h>
    3231#include <wtf/PassOwnPtr.h>
     
    6665void* CCThread::runLoop()
    6766{
    68     TRACE_EVENT("CCThread::runLoop", this, 0);
    6967    {
    7068        // Wait for CCThread::start() to complete to have m_threadID
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadTask.h

    r89694 r89700  
    2525#define CCThreadTask_h
    2626
     27#include "CCThread.h"
    2728#include "CrossThreadCopier.h"
    2829#include "CrossThreadTask.h"
    29 #include "cc/CCThread.h"
    3030#include <wtf/PassOwnPtr.h>
    3131#include <wtf/PassRefPtr.h>
  • trunk/Source/WebKit/chromium/ChangeLog

    r89694 r89700  
     12011-06-24  Nat Duca  <nduca@chromium.org>
     2
     3        Unreviewed, rolling out r89694.
     4        http://trac.webkit.org/changeset/89694
     5        https://bugs.webkit.org/show_bug.cgi?id=58408
     6
     7        Test shell still not ready for animate changes.
     8
     9        * WebKit.gypi:
     10        * public/WebWidget.h:
     11        (WebKit::WebWidget::animate):
     12        (WebKit::WebWidget::composite):
     13        * src/WebPopupMenuImpl.cpp:
     14        (WebKit::WebPopupMenuImpl::animate):
     15        * src/WebPopupMenuImpl.h:
     16        * src/WebViewImpl.cpp:
     17        (WebKit::WebViewImpl::resize):
     18        (WebKit::WebViewImpl::animate):
     19        (WebKit::WebViewImpl::paint):
     20        (WebKit::WebViewImpl::composite):
     21        (WebKit::WebViewImpl::fullFramePluginZoomLevelChanged):
     22        (WebKit::WebView::zoomLevelToZoomFactor):
     23        (WebKit::WebViewImpl::setRootLayerNeedsDisplay):
     24        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
     25        (WebKit::WebViewImpl::doComposite):
     26        (WebKit::WebViewImpl::reallocateRenderer):
     27        (WebKit::WebViewImpl::updateLayerRendererViewport):
     28        (WebKit::WebViewImpl::graphicsContext3D):
     29        * src/WebViewImpl.h:
     30        * tests/CCLayerTreeHostTest.cpp: Removed.
     31        * tests/CCThreadTest.cpp:
     32        (WebCore::TEST):
     33
    1342011-05-17  Nat Duca  <nduca@chromium.org>
    235
  • trunk/Source/WebKit/chromium/WebKit.gypi

    r89694 r89700  
    5555            'tests/ArenaTestHelpers.h',
    5656            'tests/AssociatedURLLoaderTest.cpp',
    57             'tests/CCLayerTreeHostTest.cpp',
     57            'tests/InnerGestureRecognizerTest.cpp',
    5858            'tests/CCThreadTaskTest.cpp',
    5959            'tests/CCThreadTest.cpp',
     
    6161            'tests/IDBKeyPathTest.cpp',
    6262            'tests/IDBLevelDBCodingTest.cpp',
    63             'tests/InnerGestureRecognizerTest.cpp',
    6463            'tests/KeyboardTest.cpp',
    6564            'tests/KURLTest.cpp',
  • trunk/Source/WebKit/chromium/public/WebWidget.h

    r89694 r89700  
    4848template <typename T> class WebVector;
    4949
    50 // FIXME: remove this define once render_widget has been changed to issue threaded compositor calls
    51 #define WEBWIDGET_HAS_ANIMATE_CHANGES 1
    52 
    5350class WebWidget {
    5451public:
     
    7269    virtual void willEndLiveResize() { }
    7370
    74     // Called to update imperative animation state. This should be called before
    75     // paint, although the client can rate-limit these calls. When
    76     // frameBeginTime is 0.0, the WebWidget will determine the frame begin time
    77     // itself.
    78     virtual void animate(double frameBeginTime) { }
     71    // Called to update imperative animation state.  This should be called before
     72    // paint, although the client can rate-limit these calls.
     73    virtual void animate() { }
    7974
    8075    // Called to layout the WebWidget.  This MUST be called before Paint,
     
    8277    virtual void layout() { }
    8378
    84     // Called to paint the rectangular region within the WebWidget
     79    // Called to paint the rectangular region within the WebWidget 
    8580    // onto the specified canvas at (viewPort.x,viewPort.y). You MUST call
    8681    // Layout before calling this method.  It is okay to call paint
     
    9186    virtual void paint(WebCanvas*, const WebRect& viewPort) { }
    9287
    93     // In non-threaded compositing mode, triggers compositing of the current
    94     // layers onto the screen. You MUST call Layout before calling this method, for the same
    95     // reasons described in the paint method above
    96     //
    97     // In threaded compositing mode, indicates that the widget should update
    98     // itself, for example due to window damage. The redraw will begin
    99     // asynchronously and perform layout and animation internally. Do not call
    100     // animate or layout in this case.
    101     virtual void composite(bool finish) = 0;
     88    // Triggers compositing of the current layers onto the screen.
     89    // The finish argument controls whether the compositor will wait for the
     90    // GPU to finish rendering before returning. You MUST call Layout
     91    // before calling this method, for the same reasons described in
     92    // the paint method above.
     93    virtual void composite(bool finish) { }
    10294
    10395    // Called to inform the WebWidget of a change in theme.
  • trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp

    r89694 r89700  
    168168}
    169169
    170 void WebPopupMenuImpl::animate(double)
     170void WebPopupMenuImpl::animate()
    171171{
    172172}
  • trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.h

    r89694 r89700  
    6666    virtual void resize(const WebSize&);
    6767    virtual void willEndLiveResize();
    68     virtual void animate(double frameBeginTime);
     68    virtual void animate();
    6969    virtual void layout();
    7070    virtual void paint(WebCanvas* canvas, const WebRect& rect);
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r89694 r89700  
    149149
    150150using namespace WebCore;
    151 using namespace std;
    152151
    153152namespace {
     
    10061005#if USE(ACCELERATED_COMPOSITING)
    10071006    if (m_layerRenderer && isAcceleratedCompositingActive()) {
    1008         m_layerRenderer->resizeOnscreenContent(IntSize(max(1, m_size.width),
    1009                                                        max(1, m_size.height)));
     1007        m_layerRenderer->resizeOnscreenContent(IntSize(std::max(1, m_size.width),
     1008                                                       std::max(1, m_size.height)));
    10101009    }
    10111010#endif
     
    10181017}
    10191018
    1020 void WebViewImpl::animate(double frameBeginTime)
    1021 {
     1019void WebViewImpl::animate()
     1020{
     1021    TRACE_EVENT("WebViewImpl::animate", this, 0);
    10221022#if ENABLE(REQUEST_ANIMATION_FRAME)
    1023     TRACE_EVENT("WebViewImpl::animate", this, 0);
    1024     // FIXME: remove this zero-check once render_widget has been modified to
    1025     // pass in a frameBeginTime.
    1026     if (!frameBeginTime)
    1027         frameBeginTime = currentTime();
    10281023    WebFrameImpl* webframe = mainFrameImpl();
    10291024    if (webframe) {
     
    10321027            if (m_layerRenderer)
    10331028                m_layerRenderer->setIsAnimating(true);
    1034             view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(frameBeginTime));
     1029            view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(currentTime()));
    10351030            if (m_layerRenderer)
    10361031                m_layerRenderer->setIsAnimating(false);
     
    11011096    if (isAcceleratedCompositingActive()) {
    11021097#if USE(ACCELERATED_COMPOSITING)
    1103 #if USE(THREADED_COMPOSITING)
    1104         // FIXME: do readback in threaded compositing mode rather than returning nothing
    1105         return;
    1106 #endif
    11071098        doComposite();
    11081099
     
    11381129}
    11391130
    1140 void WebViewImpl::animateAndLayout(double frameBeginTime)
    1141 {
    1142     animate(frameBeginTime);
    1143     layout();
    1144 }
    1145 
    1146 void WebViewImpl::updateLayers()
    1147 {
     1131void WebViewImpl::composite(bool finish)
     1132{
     1133#if USE(ACCELERATED_COMPOSITING)
    11481134    // Update the compositing requirements for all frame in the tree before doing any painting
    11491135    // as the compositing requirements for a RenderLayer within a subframe might change.
     
    11511137        frame->view()->updateCompositingLayers();
    11521138    page()->mainFrame()->view()->syncCompositingStateIncludingSubframes();
    1153 }
    1154 
    1155 void WebViewImpl::composite(bool finish)
    1156 {
    1157 #if USE(ACCELERATED_COMPOSITING)
    1158 #if USE(THREADED_COMPOSITING)
    1159     m_layerRenderer->setNeedsRedraw();
    1160 #else
     1139
    11611140    TRACE_EVENT("WebViewImpl::composite", this, 0);
    1162 
    11631141    if (m_recreatingGraphicsContext) {
    11641142        // reallocateRenderer will request a repaint whether or not it succeeded
     
    11691147    }
    11701148    doComposite();
     1149
     1150    // Finish if requested.
     1151    if (finish)
     1152        m_layerRenderer->finish();
    11711153
    11721154    // Put result onscreen.
     
    11831165        setRootLayerNeedsDisplay();
    11841166    }
    1185 #endif
    11861167#endif
    11871168}
     
    17981779        return;
    17991780
    1800     m_zoomLevel = max(min(zoomLevel, m_maximumZoomLevel), m_minimumZoomLevel);
     1781    m_zoomLevel = std::max(std::min(zoomLevel, m_maximumZoomLevel), m_minimumZoomLevel);
    18011782    m_client->zoomLevelChanged();
    18021783}
     
    18041785double WebView::zoomLevelToZoomFactor(double zoomLevel)
    18051786{
    1806     return pow(textSizeMultiplierRatio, zoomLevel);
     1787    return std::pow(textSizeMultiplierRatio, zoomLevel);
    18071788}
    18081789
     
    24382419void WebViewImpl::setRootLayerNeedsDisplay()
    24392420{
    2440 #if USE(THREADED_COMPOSITING)
    2441     if (m_layerRenderer)
    2442         m_layerRenderer->setNeedsCommitAndRedraw();
    2443 #else
    24442421    m_client->scheduleComposite();
    2445 #endif
    24462422}
    24472423
     
    25152491    } else if (m_layerRenderer) {
    25162492        m_isAcceleratedCompositingActive = true;
    2517         m_layerRenderer->resizeOnscreenContent(WebCore::IntSize(max(1, m_size.width),
    2518                                                                 max(1, m_size.height)));
     2493        m_layerRenderer->resizeOnscreenContent(WebCore::IntSize(std::max(1, m_size.width),
     2494                                                                std::max(1, m_size.height)));
    25192495
    25202496        m_client->didActivateAcceleratedCompositing(true);
    25212497    } else {
    25222498        TRACE_EVENT("WebViewImpl::setIsAcceleratedCompositingActive(true)", this, 0);
    2523 
    2524         m_layerRenderer = LayerRendererChromium::create(this, WebViewImplContentPainter::create(this), m_page->settings()->acceleratedDrawingEnabled());
     2499        RefPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release();
     2500        if (!context) {
     2501            context = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
     2502            if (context)
     2503                context->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
     2504        }
     2505
     2506
     2507        m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this), m_page->settings()->acceleratedDrawingEnabled());
    25252508        if (m_layerRenderer) {
    2526             updateLayerRendererSettings();
    25272509            m_client->didActivateAcceleratedCompositing(true);
    25282510            m_isAcceleratedCompositingActive = true;
     
    25522534        return;
    25532535
     2536    m_layerRenderer->setCompositeOffscreen(settings()->compositeToTextureEnabled());
     2537
     2538    CCHeadsUpDisplay* hud = m_layerRenderer->headsUpDisplay();
     2539    hud->setShowFPSCounter(settings()->showFPSCounter());
     2540    hud->setShowPlatformLayerTree(settings()->showPlatformLayerTree());
     2541
    25542542    if (m_pageOverlay)
    25552543        m_pageOverlay->update();
    25562544
    2557     m_layerRenderer->updateLayers();
    2558     m_layerRenderer->drawLayers();
    2559 }
    2560 
    2561 PassRefPtr<GraphicsContext3D> WebViewImpl::createLayerTreeHostContext3D()
    2562 {
    2563     RefPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release();
    2564     if (!context) {
    2565         context = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
    2566         if (context)
    2567             context->reshape(max(1, m_size.width), max(1, m_size.height));
    2568     }
    2569     return context;
     2545    m_layerRenderer->updateAndDrawLayers();
    25702546}
    25712547
    25722548void WebViewImpl::reallocateRenderer()
    25732549{
     2550    RefPtr<GraphicsContext3D> newContext = m_temporaryOnscreenGraphicsContext3D.get();
     2551    WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(newContext.get());
     2552    if (!newContext || !webContext || webContext->isContextLost())
     2553        newContext = GraphicsContext3D::create(
     2554            getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
    25742555    // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0.
    2575     RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(this, WebViewImplContentPainter::create(this), m_page->settings()->acceleratedDrawingEnabled());
     2556    RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this), m_page->settings()->acceleratedDrawingEnabled());
    25762557
    25772558    // Reattach the root layer.  Child layers will get reattached as a side effect of updateLayersRecursive.
     
    25792560        m_layerRenderer->transferRootLayer(layerRenderer.get());
    25802561        m_layerRenderer = layerRenderer;
    2581         updateLayerRendererSettings();
    2582 
    25832562        // FIXME: In MacOS newContext->reshape method needs to be called to
    25842563        // allocate IOSurfaces. All calls to create a context followed by
     
    25862565        // immediately obvious that GraphicsContext3D object will not
    25872566        // function properly until its reshape method is called.
    2588         layerRenderer->context()->reshape(max(1, m_size.width), max(1, m_size.height));
     2567        newContext->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
    25892568        setRootPlatformLayer(m_layerRenderer->rootLayer());
    2590 
    25912569        // Forces ViewHostMsg_DidActivateAcceleratedCompositing to be sent so
    25922570        // that the browser process can reacquire surfaces.
     
    25992577#endif
    26002578
    2601 void WebViewImpl::updateLayerRendererSettings()
     2579void WebViewImpl::updateLayerRendererViewport()
    26022580{
    26032581    ASSERT(m_layerRenderer);
    2604     m_layerRenderer->setCompositeOffscreen(settings()->compositeToTextureEnabled());
    2605 
    2606     CCHeadsUpDisplay* hud = m_layerRenderer->headsUpDisplay();
    2607     hud->setShowFPSCounter(settings()->showFPSCounter());
    2608     hud->setShowPlatformLayerTree(settings()->showPlatformLayerTree());
    2609 }
    2610 
    2611 void WebViewImpl::updateLayerRendererViewport()
    2612 {
     2582
    26132583    if (!page())
    26142584        return;
     
    26382608        m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
    26392609        if (m_temporaryOnscreenGraphicsContext3D)
    2640             m_temporaryOnscreenGraphicsContext3D->reshape(max(1, m_size.width), max(1, m_size.height));
     2610            m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
    26412611        return GraphicsContext3DInternal::extractWebGraphicsContext3D(m_temporaryOnscreenGraphicsContext3D.get());
    26422612    }
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r89694 r89700  
    5757class DocumentLoader;
    5858class Frame;
    59 class GraphicsContext3D;
    6059class HistoryItem;
    6160class HitTestResult;
     
    8988class WebTouchEvent;
    9089
    91 class WebViewImpl : public WebView, public WebCore::CCLayerTreeHostClient, public RefCounted<WebViewImpl> {
     90class WebViewImpl : public WebView, public RefCounted<WebViewImpl> {
    9291public:
    9392    // WebWidget methods:
     
    9796    virtual void resize(const WebSize&);
    9897    virtual void willEndLiveResize();
    99     virtual void animate(double frameBeginTime);
     98    virtual void animate();
    10099    virtual void layout();
    101100    virtual void paint(WebCanvas*, const WebRect&);
     
    204203    virtual void performCustomContextMenuAction(unsigned action);
    205204
    206     // CCLayerTreeHostClient
    207     virtual void animateAndLayout(double frameBeginTime);
    208     virtual PassRefPtr<WebCore::GraphicsContext3D> createLayerTreeHostContext3D();
    209     virtual void updateLayers();
    210 
    211205    // WebViewImpl
    212206
     
    363357    void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect);
    364358    void invalidateRootLayerRect(const WebCore::IntRect&);
    365     void doUpdateAndComposite();
    366359#endif
    367360
     
    431424    void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&);
    432425    void reallocateRenderer();
    433     void updateLayerRendererSettings();
    434426    void updateLayerRendererViewport();
    435427#endif
  • trunk/Source/WebKit/chromium/tests/CCThreadTest.cpp

    r89694 r89700  
    5454    PingPongUsingCondition target;
    5555    CCCompletionEvent completion;
    56     thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping,
     56    thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping, 
    5757                                        AllowCrossThreadAccess(&completion)));
    5858    completion.wait();
  • trunk/Tools/ChangeLog

    r89698 r89700  
     12011-06-24  Nat Duca  <nduca@chromium.org>
     2
     3        Unreviewed, rolling out r89694.
     4        http://trac.webkit.org/changeset/89694
     5        https://bugs.webkit.org/show_bug.cgi?id=58408
     6
     7        Test shell still not ready for animate changes.
     8
     9        * DumpRenderTree/chromium/WebViewHost.cpp:
     10        (WebViewHost::paintInvalidatedRegion):
     11
    1122011-06-24  Adam Roben  <aroben@apple.com>
    213
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r89694 r89700  
    14871487{
    14881488#if ENABLE(REQUEST_ANIMATION_FRAME)
    1489     webWidget()->animate(0.0);
     1489    webWidget()->animate();
    14901490#endif
    14911491    webWidget()->layout();
Note: See TracChangeset for help on using the changeset viewer.