diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-24 08:29:43 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-24 08:29:43 +0200 |
commit | 2e2ba8ff45915f40ed3e014101269c175f2a89a0 (patch) | |
tree | 3b94a9a9fa83efa384b8dac611cf8c6495532a62 /Source/WebKit | |
parent | f53e6f8e798362ed712d4a51633b0d0b03dbc213 (diff) | |
download | qtwebkit-2e2ba8ff45915f40ed3e014101269c175f2a89a0.tar.gz |
Imported WebKit commit bf0b0213bbf3886c96610020602012ca7d11b084 (http://svn.webkit.org/repository/webkit/trunk@126545)
New snapshot with clang and python build fixes
Diffstat (limited to 'Source/WebKit')
67 files changed, 1644 insertions, 998 deletions
diff --git a/Source/WebKit/blackberry/Api/BackingStore.cpp b/Source/WebKit/blackberry/Api/BackingStore.cpp index 878665054..b86cc5d11 100644 --- a/Source/WebKit/blackberry/Api/BackingStore.cpp +++ b/Source/WebKit/blackberry/Api/BackingStore.cpp @@ -75,7 +75,6 @@ using BlackBerry::Platform::IntSize; namespace BlackBerry { namespace WebKit { -const int s_renderTimerTimeout = 1.0; WebPage* BackingStorePrivate::s_currentBackingStoreOwner = 0; typedef std::pair<int, int> Divisor; @@ -217,8 +216,6 @@ BackingStorePrivate::BackingStorePrivate() m_frontState = reinterpret_cast<unsigned>(new BackingStoreGeometry); m_backState = reinterpret_cast<unsigned>(new BackingStoreGeometry); - m_renderTimer = adoptPtr(new Timer<BackingStorePrivate>(this, &BackingStorePrivate::renderOnTimer)); - // Need a recursive mutex to achieve a global lock. pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); @@ -500,62 +497,27 @@ bool BackingStorePrivate::shouldPerformRegularRenderJobs() const return shouldPerformRenderJobs() && !m_suspendRegularRenderJobs; } -void BackingStorePrivate::startRenderTimer() -{ - // Called when render queue has a new job added. - if (m_renderTimer->isActive() || m_renderQueue->isEmpty(!m_suspendRegularRenderJobs)) - return; - -#if DEBUG_BACKINGSTORE - BlackBerry::Platform::log(BlackBerry::Platform::LogLevelCritical, "BackingStorePrivate::startRenderTimer time=%f", WTF::currentTime()); -#endif - m_renderTimer->startOneShot(s_renderTimerTimeout); -} - -void BackingStorePrivate::stopRenderTimer() +static const BlackBerry::Platform::Message::Type RenderJobMessageType = BlackBerry::Platform::Message::generateUniqueMessageType(); +class RenderJobMessage : public BlackBerry::Platform::ExecutableMessage { - if (!m_renderTimer->isActive()) - return; - - // Called when we render something to restart. -#if DEBUG_BACKINGSTORE - BlackBerry::Platform::log(BlackBerry::Platform::LogLevelCritical, "BackingStorePrivate::stopRenderTimer time=%f", WTF::currentTime()); -#endif - m_renderTimer->stop(); -} +public: + RenderJobMessage(BlackBerry::Platform::MessageDelegate* delegate) + : BlackBerry::Platform::ExecutableMessage(delegate, BlackBerry::Platform::ExecutableMessage::UniqueCoalescing, RenderJobMessageType) + { } +}; -void BackingStorePrivate::renderOnTimer(WebCore::Timer<BackingStorePrivate>*) +void BackingStorePrivate::dispatchRenderJob() { - // This timer is a third method of starting a render operation that is a catch-all. If more - // than s_renderTimerTimeout elapses with no rendering taking place and render jobs in the queue, then - // renderOnTimer will be called which will actually render. - if (!shouldPerformRenderJobs()) - return; - -#if DEBUG_BACKINGSTORE - BlackBerry::Platform::log(BlackBerry::Platform::LogLevelCritical, "BackingStorePrivate::renderOnTimer time=%f", WTF::currentTime()); -#endif - while (m_renderQueue->hasCurrentVisibleZoomJob() || m_renderQueue->hasCurrentVisibleScrollJob()) - m_renderQueue->render(!m_suspendRegularRenderJobs); - - if (shouldPerformRegularRenderJobs() && m_renderQueue->hasCurrentRegularRenderJob()) - m_renderQueue->renderAllCurrentRegularRenderJobs(); - -#if USE(ACCELERATED_COMPOSITING) - drawLayersOnCommitIfNeeded(); -#endif + BlackBerry::Platform::MessageDelegate* messageDelegate = BlackBerry::Platform::createMethodDelegate(&BackingStorePrivate::renderJob, this); + BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage(new RenderJobMessage(messageDelegate)); } -void BackingStorePrivate::renderOnIdle() +void BackingStorePrivate::renderJob() { ASSERT(shouldPerformRenderJobs()); - // Let the render queue know that we entered a new event queue cycle - // so it can determine if it is under pressure. - m_renderQueue->eventQueueCycled(); - #if DEBUG_BACKINGSTORE - BlackBerry::Platform::log(BlackBerry::Platform::LogLevelCritical, "BackingStorePrivate::renderOnIdle"); + BlackBerry::Platform::logAlways(BlackBerry::Platform::LogLevelCritical, "BackingStorePrivate::renderJob"); #endif m_renderQueue->render(!m_suspendRegularRenderJobs); @@ -563,41 +525,9 @@ void BackingStorePrivate::renderOnIdle() #if USE(ACCELERATED_COMPOSITING) drawLayersOnCommitIfNeeded(); #endif -} - -bool BackingStorePrivate::willFireTimer() -{ - // Let the render queue know that we entered a new event queue cycle - // so it can determine if it is under pressure. - m_renderQueue->eventQueueCycled(); - - if (!shouldPerformRegularRenderJobs() || !m_renderQueue->hasCurrentRegularRenderJob() || !m_renderQueue->currentRegularRenderJobBatchUnderPressure()) - return true; - -#if DEBUG_BACKINGSTORE - BlackBerry::Platform::log(BlackBerry::Platform::LogLevelCritical, "BackingStorePrivate::willFireTimer"); -#endif - - // We've detected that the regular render jobs are coming under pressure likely - // due to timers firing producing invalidation jobs and our efforts to break them - // up into bite size pieces has produced a situation where we can not complete - // a batch of them before receiving more that intersect them which causes us - // to start the batch over. To mitigate this we have to empty the current batch - // when this is detected. - - // We still want to perform priority jobs first to avoid redundant paints. - while (m_renderQueue->hasCurrentVisibleZoomJob() || m_renderQueue->hasCurrentVisibleScrollJob()) - m_renderQueue->render(!m_suspendRegularRenderJobs); - - if (m_renderQueue->hasCurrentRegularRenderJob()) - m_renderQueue->renderAllCurrentRegularRenderJobs(); -#if USE(ACCELERATED_COMPOSITING) - drawLayersOnCommitIfNeeded(); -#endif - - // Let the caller yield and reschedule the timer. - return false; + if (shouldPerformRenderJobs()) + dispatchRenderJob(); } Platform::IntRect BackingStorePrivate::expandedContentsRect() const @@ -2790,16 +2720,6 @@ void BackingStore::repaint(int x, int y, int width, int height, d->repaint(Platform::IntRect(x, y, width, height), contentChanged, immediate); } -bool BackingStore::hasRenderJobs() const -{ - return d->shouldPerformRenderJobs(); -} - -void BackingStore::renderOnIdle() -{ - d->renderOnIdle(); -} - bool BackingStore::isDirectRenderingToWindow() const { BackingStoreMutexLocker locker(d); diff --git a/Source/WebKit/blackberry/Api/BackingStore.h b/Source/WebKit/blackberry/Api/BackingStore.h index 6ac9c38fa..c3185dc44 100644 --- a/Source/WebKit/blackberry/Api/BackingStore.h +++ b/Source/WebKit/blackberry/Api/BackingStore.h @@ -63,9 +63,6 @@ public: void blitContents(const BlackBerry::Platform::IntRect& dstRect, const BlackBerry::Platform::IntRect& contents); void repaint(int x, int y, int width, int height, bool contentChanged, bool immediate); - bool hasRenderJobs() const; - void renderOnIdle(); - // In the defers blit mode, any blit requests will just return early, and // a blit job will be queued that is executed by calling blitOnIdle(). bool defersBlit() const; diff --git a/Source/WebKit/blackberry/Api/BackingStore_p.h b/Source/WebKit/blackberry/Api/BackingStore_p.h index c29684717..77eeab951 100644 --- a/Source/WebKit/blackberry/Api/BackingStore_p.h +++ b/Source/WebKit/blackberry/Api/BackingStore_p.h @@ -131,11 +131,8 @@ public: bool shouldSuppressNonVisibleRegularRenderJobs() const; bool shouldPerformRenderJobs() const; bool shouldPerformRegularRenderJobs() const; - void startRenderTimer(); - void stopRenderTimer(); - void renderOnTimer(WebCore::Timer<BackingStorePrivate>*); - void renderOnIdle(); - bool willFireTimer(); + void dispatchRenderJob(); + void renderJob(); // Set of helper methods for the scrollBackingStore() method. Platform::IntRect contentsRect() const; @@ -364,9 +361,6 @@ public: Platform::IntRect m_visibleTileBufferRect; - // Last resort timer for rendering. - OwnPtr<WebCore::Timer<BackingStorePrivate> > m_renderTimer; - pthread_mutex_t m_mutex; #if USE(ACCELERATED_COMPOSITING) diff --git a/Source/WebKit/blackberry/Api/InRegionScroller.cpp b/Source/WebKit/blackberry/Api/InRegionScroller.cpp index 205ef898b..aaf40168c 100644 --- a/Source/WebKit/blackberry/Api/InRegionScroller.cpp +++ b/Source/WebKit/blackberry/Api/InRegionScroller.cpp @@ -33,6 +33,7 @@ #include "RenderLayerBacking.h" #include "RenderObject.h" #include "RenderView.h" +#include "SelectionHandler.h" #include "WebPage_p.h" using namespace WebCore; @@ -65,12 +66,12 @@ bool InRegionScroller::setScrollPositionCompositingThread(unsigned camouflagedLa return d->setScrollPositionCompositingThread(camouflagedLayer, d->m_webPage->mapFromTransformed(scrollPosition)); } -bool InRegionScroller::setScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& scrollPosition) +bool InRegionScroller::setScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& scrollPosition, bool supportsAcceleratedScrolling) { ASSERT(Platform::webKitThreadMessageClient()->isCurrentThread()); // FIXME: Negative values won't work with map{To,From}Transform methods. - return d->setScrollPositionWebKitThread(camouflagedLayer, d->m_webPage->mapFromTransformed(scrollPosition)); + return d->setScrollPositionWebKitThread(camouflagedLayer, d->m_webPage->mapFromTransformed(scrollPosition), supportsAcceleratedScrolling); } InRegionScrollerPrivate::InRegionScrollerPrivate(WebPagePrivate* webPagePrivate) @@ -118,16 +119,25 @@ bool InRegionScrollerPrivate::setScrollPositionCompositingThread(unsigned camouf return true; } -bool InRegionScrollerPrivate::setScrollPositionWebKitThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition) +bool InRegionScrollerPrivate::setScrollPositionWebKitThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition, bool supportsAcceleratedScrolling) { RenderLayer* layer = 0; - LayerWebKitThread* layerWebKitThread = reinterpret_cast<LayerWebKitThread*>(camouflagedLayer); - ASSERT(layerWebKitThread); - if (layerWebKitThread->owner()) { - GraphicsLayer* graphicsLayer = layerWebKitThread->owner(); - RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(graphicsLayer->client()); - layer = backing->owningLayer(); + if (supportsAcceleratedScrolling) { + LayerWebKitThread* layerWebKitThread = reinterpret_cast<LayerWebKitThread*>(camouflagedLayer); + ASSERT(layerWebKitThread); + if (layerWebKitThread->owner()) { + GraphicsLayer* graphicsLayer = layerWebKitThread->owner(); + RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(graphicsLayer->client()); + layer = backing->owningLayer(); + } + } else { + Node* node = reinterpret_cast<Node*>(camouflagedLayer); + ASSERT(node); + if (!node->renderer()) + return false; + + layer = node->renderer()->enclosingLayer(); } if (!layer) @@ -137,16 +147,6 @@ bool InRegionScrollerPrivate::setScrollPositionWebKitThread(unsigned camouflaged return setLayerScrollPosition(layer, scrollPosition); } -bool InRegionScrollerPrivate::scrollBy(const Platform::IntSize& delta) -{ - ASSERT(Platform::webkitThreadMessageClient()->isCurrentThread()); - - if (!canScroll()) - return false; - - return scrollNodeRecursively(node(), delta); -} - void InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint(const WebCore::IntPoint& point) { ASSERT(m_activeInRegionScrollableAreas.empty()); @@ -243,8 +243,23 @@ bool InRegionScrollerPrivate::setLayerScrollPosition(RenderLayer* layer, const I Frame* frame = view->frame(); ASSERT_UNUSED(frame, frame); + ASSERT(canScrollInnerFrame(frame)); + + view->setCanBlitOnScroll(false); + + BackingStoreClient* backingStoreClient = m_webPage->backingStoreClientForFrame(view->frame()); + if (backingStoreClient) { + backingStoreClient->setIsClientGeneratedScroll(true); + backingStoreClient->setIsScrollNotificationSuppressed(true); + } view->setScrollPosition(scrollPosition); + + if (backingStoreClient) { + backingStoreClient->setIsClientGeneratedScroll(false); + backingStoreClient->setIsScrollNotificationSuppressed(false); + } + return true; } @@ -252,104 +267,13 @@ bool InRegionScrollerPrivate::setLayerScrollPosition(RenderLayer* layer, const I layer->scrollToOffset(scrollPosition.x(), scrollPosition.y()); // FIXME_agomes: Please recheck if it is needed still! layer->renderer()->repaint(true); - return true; -} - -bool InRegionScrollerPrivate::scrollNodeRecursively(WebCore::Node* node, const WebCore::IntSize& delta) -{ - if (delta.isZero()) - return true; - - if (!node) - return false; - - RenderObject* renderer = node->renderer(); - if (!renderer) - return false; - - FrameView* view = renderer->view()->frameView(); - if (!view) - return false; - - // Try scrolling the renderer. - if (scrollRenderer(renderer, delta)) - return true; - // We've hit the page, don't scroll it and return false. - if (view == m_webPage->m_mainFrame->view()) - return false; - - // Try scrolling the FrameView. - if (canScrollInnerFrame(view->frame())) { - IntSize viewDelta = delta; - IntPoint newViewOffset = view->scrollPosition(); - IntPoint maxViewOffset = view->maximumScrollPosition(); - adjustScrollDelta(maxViewOffset, newViewOffset, viewDelta); - - if (!viewDelta.isZero()) { - view->setCanBlitOnScroll(false); - - BackingStoreClient* backingStoreClient = m_webPage->backingStoreClientForFrame(view->frame()); - if (backingStoreClient) { - backingStoreClient->setIsClientGeneratedScroll(true); - backingStoreClient->setIsScrollNotificationSuppressed(true); - } - - setNode(view->frame()->document()); - - view->scrollBy(viewDelta); - - if (backingStoreClient) { - backingStoreClient->setIsClientGeneratedScroll(false); - backingStoreClient->setIsScrollNotificationSuppressed(false); - } - - return true; - } - } - - // Try scrolling the node of the enclosing frame. - Frame* frame = node->document()->frame(); - if (frame) { - Node* ownerNode = frame->ownerElement(); - if (scrollNodeRecursively(ownerNode, delta)) - return true; - } - - return false; -} - -bool InRegionScrollerPrivate::scrollRenderer(WebCore::RenderObject* renderer, const WebCore::IntSize& delta) -{ - RenderLayer* layer = renderer->enclosingLayer(); - if (!layer) - return false; - - // Try to scroll layer. - bool restrictedByLineClamp = false; - if (renderer->parent()) - restrictedByLineClamp = !renderer->parent()->style()->lineClamp().isNone(); - - if (renderer->hasOverflowClip() && !restrictedByLineClamp) { - IntSize layerDelta = delta; - IntPoint maxOffset(layer->scrollWidth() - layer->renderBox()->clientWidth(), layer->scrollHeight() - layer->renderBox()->clientHeight()); - IntPoint currentOffset(layer->scrollXOffset(), layer->scrollYOffset()); - adjustScrollDelta(maxOffset, currentOffset, layerDelta); - if (!layerDelta.isZero()) { - setNode(enclosingLayerNode(layer)); - IntPoint newOffset = currentOffset + layerDelta; - layer->scrollToOffset(IntSize(newOffset.x(), newOffset.y())); - renderer->repaint(true); - return true; - } - } - - while (layer = layer->parent()) { - if (canScrollRenderBox(layer->renderBox())) - return scrollRenderer(layer->renderBox(), delta); - } - - return false; + m_webPage->m_selectionHandler->selectionPositionChanged(); + // FIXME: We have code in place to handle scrolling and clipping tap highlight + // on in-region scrolling. As soon as it is fast enough (i.e. we have it backed by + // a backing store), we can reliably make use of it in the real world. + // m_touchEventHandler->drawTapHighlight(); + return true; } void InRegionScrollerPrivate::adjustScrollDelta(const WebCore::IntPoint& maxOffset, const WebCore::IntPoint& currentOffset, WebCore::IntSize& delta) const diff --git a/Source/WebKit/blackberry/Api/InRegionScroller.h b/Source/WebKit/blackberry/Api/InRegionScroller.h index bbdd94fff..3291f9759 100644 --- a/Source/WebKit/blackberry/Api/InRegionScroller.h +++ b/Source/WebKit/blackberry/Api/InRegionScroller.h @@ -36,7 +36,7 @@ public: ~InRegionScroller(); bool setScrollPositionCompositingThread(unsigned camouflagedLayer, const Platform::IntPoint& /*scrollPosition*/); - bool setScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& /*scrollPosition*/); + bool setScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& /*scrollPosition*/, bool acceleratedScrolling); private: friend class WebPagePrivate; diff --git a/Source/WebKit/blackberry/Api/InRegionScroller_p.h b/Source/WebKit/blackberry/Api/InRegionScroller_p.h index 080766a3f..d9e0ebab1 100644 --- a/Source/WebKit/blackberry/Api/InRegionScroller_p.h +++ b/Source/WebKit/blackberry/Api/InRegionScroller_p.h @@ -49,10 +49,8 @@ public: bool canScroll() const; bool hasNode() const; - bool scrollBy(const Platform::IntSize& delta); - bool setScrollPositionCompositingThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition); - bool setScrollPositionWebKitThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition); + bool setScrollPositionWebKitThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition, bool supportsAcceleratedScrolling); void calculateInRegionScrollableAreasForPoint(const WebCore::IntPoint&); const std::vector<Platform::ScrollViewBase*>& activeInRegionScrollableAreas() const; @@ -64,9 +62,6 @@ private: void pushBackInRegionScrollable(InRegionScrollableArea*); - // Obsolete codepath. - bool scrollNodeRecursively(WebCore::Node*, const WebCore::IntSize& delta); - bool scrollRenderer(WebCore::RenderObject*, const WebCore::IntSize& delta); void adjustScrollDelta(const WebCore::IntPoint& maxOffset, const WebCore::IntPoint& currentOffset, WebCore::IntSize& delta) const; RefPtr<WebCore::Node> m_inRegionScrollStartingNode; diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp index 7eb7e5904..2e34c366c 100644 --- a/Source/WebKit/blackberry/Api/WebPage.cpp +++ b/Source/WebKit/blackberry/Api/WebPage.cpp @@ -1467,40 +1467,17 @@ void WebPagePrivate::deferredTasksTimerFired(WebCore::Timer<WebPagePrivate>*) task->perform(this); } -bool WebPagePrivate::scrollBy(int deltaX, int deltaY, bool scrollMainFrame) +void WebPagePrivate::scrollBy(int deltaX, int deltaY) { IntSize delta(deltaX, deltaY); - if (!scrollMainFrame) { - // We need to work around the fact that ::map{To,From}Transformed do not - // work well with negative values, like a negative width or height of an IntSize. - IntSize copiedDelta(IntSize(abs(delta.width()), abs(delta.height()))); - IntSize untransformedCopiedDelta = mapFromTransformed(copiedDelta); - delta = IntSize( - delta.width() < 0 ? -untransformedCopiedDelta.width() : untransformedCopiedDelta.width(), - delta.height() < 0 ? -untransformedCopiedDelta.height(): untransformedCopiedDelta.height()); - - if (m_inRegionScroller->d->scrollBy(delta)) { - m_selectionHandler->selectionPositionChanged(); - // FIXME: We have code in place to handle scrolling and clipping tap highlight - // on in-region scrolling. As soon as it is fast enough (i.e. we have it backed by - // a backing store), we can reliably make use of it in the real world. - // m_touchEventHandler->drawTapHighlight(); - return true; - } - - return false; - } - setScrollPosition(scrollPosition() + delta); - return true; } -bool WebPage::scrollBy(const Platform::IntSize& delta, bool scrollMainFrame) +void WebPage::scrollBy(const Platform::IntSize& delta) { d->m_backingStoreClient->setIsClientGeneratedScroll(true); - bool b = d->scrollBy(delta.width(), delta.height(), scrollMainFrame); + d->scrollBy(delta.width(), delta.height()); d->m_backingStoreClient->setIsClientGeneratedScroll(false); - return b; } void WebPagePrivate::notifyInRegionScrollStopped() @@ -2488,8 +2465,8 @@ IntSize WebPagePrivate::fixedLayoutSize(bool snapToIncrement) const const int defaultLayoutHeight = m_defaultLayoutSize.height(); int minWidth = defaultLayoutWidth; - int maxWidth = defaultMaxLayoutSize().width(); - int maxHeight = defaultMaxLayoutSize().height(); + int maxWidth = DEFAULT_MAX_LAYOUT_WIDTH; + int maxHeight = DEFAULT_MAX_LAYOUT_HEIGHT; // If the load state is none then we haven't actually got anything yet, but we need to layout // the entire page so that the user sees the entire page (unrendered) instead of just part of it. @@ -3500,7 +3477,7 @@ IntSize WebPagePrivate::recomputeVirtualViewportFromViewportArguments() if (m_viewportArguments == defaultViewportArguments) return IntSize(); - int desktopWidth = defaultMaxLayoutSize().width(); + int desktopWidth = DEFAULT_MAX_LAYOUT_WIDTH; int deviceWidth = Platform::Graphics::Screen::primaryScreen()->width(); int deviceHeight = Platform::Graphics::Screen::primaryScreen()->height(); ViewportAttributes result = computeViewportAttributes(m_viewportArguments, desktopWidth, deviceWidth, deviceHeight, m_webSettings->devicePixelRatio(), m_defaultLayoutSize); @@ -5292,14 +5269,6 @@ bool WebPage::defersLoading() const return d->m_page->defersLoading(); } -bool WebPage::willFireTimer() -{ - if (d->isLoading()) - return true; - - return d->m_backingStore->d->willFireTimer(); -} - void WebPage::notifyPagePause() { FOR_EACH_PLUGINVIEW(d->m_pluginViews) @@ -6203,16 +6172,6 @@ void WebPagePrivate::didChangeSettings(WebSettings* webSettings) } } -IntSize WebPagePrivate::defaultMaxLayoutSize() -{ - static IntSize size; - if (size.isEmpty()) - size = IntSize(std::max(1024, Platform::Graphics::Screen::primaryScreen()->landscapeWidth()), - std::max(768, Platform::Graphics::Screen::primaryScreen()->landscapeHeight())); - - return size; -} - WebString WebPage::textHasAttribute(const WebString& query) const { if (Document* doc = d->m_page->focusController()->focusedOrMainFrame()->document()) diff --git a/Source/WebKit/blackberry/Api/WebPage.h b/Source/WebKit/blackberry/Api/WebPage.h index dc4cf165d..14d57a65f 100644 --- a/Source/WebKit/blackberry/Api/WebPage.h +++ b/Source/WebKit/blackberry/Api/WebPage.h @@ -175,7 +175,7 @@ public: Platform::IntPoint scrollPosition() const; // Scroll position provided should be in transformed coordinates. void setScrollPosition(const Platform::IntPoint&); - bool scrollBy(const Platform::IntSize&, bool scrollMainFrame = true); + void scrollBy(const Platform::IntSize&); void notifyInRegionScrollStopped(); void setScrollOriginPoint(const Platform::IntPoint&); @@ -322,8 +322,6 @@ public: bool defersLoading() const; - bool willFireTimer(); - bool isEnableLocalAccessToAllCookies() const; void setEnableLocalAccessToAllCookies(bool); diff --git a/Source/WebKit/blackberry/Api/WebPage_p.h b/Source/WebKit/blackberry/Api/WebPage_p.h index a005d81b6..1e5af0bce 100644 --- a/Source/WebKit/blackberry/Api/WebPage_p.h +++ b/Source/WebKit/blackberry/Api/WebPage_p.h @@ -41,6 +41,9 @@ #include <BlackBerryPlatformMessage.h> +#define DEFAULT_MAX_LAYOUT_WIDTH 1024 +#define DEFAULT_MAX_LAYOUT_HEIGHT 768 + namespace WebCore { class AutofillManager; class DOMWrapperWorld; @@ -147,7 +150,7 @@ public: WebCore::IntPoint scrollPosition() const; WebCore::IntPoint maximumScrollPosition() const; void setScrollPosition(const WebCore::IntPoint&); - bool scrollBy(int deltaX, int deltaY, bool scrollMainFrame = true); + void scrollBy(int deltaX, int deltaY); void enqueueRenderingOfClippedContentOfScrollableNodeAfterInRegionScrolling(WebCore::Node*); void notifyInRegionScrollStopped(); @@ -446,7 +449,6 @@ public: static WebCore::RenderLayer* enclosingPositionedAncestorOrSelfIfPositioned(WebCore::RenderLayer*); static WebCore::RenderLayer* enclosingFixedPositionedAncestorOrSelfIfFixedPositioned(WebCore::RenderLayer*); - static WebCore::IntSize defaultMaxLayoutSize(); static const String& defaultUserAgent(); void setVisible(bool); diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog index 1059181c0..a7715af0a 100644 --- a/Source/WebKit/blackberry/ChangeLog +++ b/Source/WebKit/blackberry/ChangeLog @@ -1,3 +1,148 @@ +2012-08-23 Antonio Gomes <agomes@rim.com> + + [BlackBerry] Obsolete the in-region scroll codepath prior to BB10's + https://bugs.webkit.org/show_bug.cgi?id=94839 + PR #197775 + + Reviewed by George Staikos. + + This codepath is not needed anymore, so lets let it RIP. + + The only code addition is due to some code I've moved from WebPagePrivate::scrollNodeRecursively + and WebPagePrivate::scrollBy to InRegionScrollerPrivate::setLayerScrollPosition. + Rest is code removal ... + + * Api/InRegionScroller.cpp: + (BlackBerry::WebKit::InRegionScrollerPrivate::setLayerScrollPosition): + * Api/InRegionScroller_p.h: + (InRegionScrollerPrivate): + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::scrollBy): + (BlackBerry::WebKit::WebPage::scrollBy): + * Api/WebPage.h: + * Api/WebPage_p.h: + (WebPagePrivate): + +2012-08-23 Adam Treat <atreat@rim.com> + + [BlackBerry] Replace the three different rendering mechanisms for clearing the render queue + https://bugs.webkit.org/show_bug.cgi?id=94837 + + Reviewed by George Staikos. + + PR 197738 + + Currently, we have three different mechanisms for clearing the render queue. + The first mechanism is render on idle. Whenever the webkit thread becomes idle + (read: no more events in its queue) we render the next job in the render queue. + This is the primary means we use for clearing the render queue. However, this + mechanism has a flaw, it is such a low priority mechanism that sometimes the + queue grows so fast due to higher priority events adding rects to the queue + that this mechanism can't possibly keep up. That is what leads to the second + mechanism: rendering right before a timer is fired when we discover that the + render queue is under pressure and rendering on idle can't keep up. However, + there are still degenerate cases where even this mechanism does not allow us to + keep up. That brings us to the third mechanism: rendering based on a timer + that is a catch-all. + + The second and third mechanisms lead to very large render jobs as they try and + clear the queue faster when it comes under pressure. These very large render + jobs end up keeping the webkit thread busy with a message that can take large + fractions of a second to resolve. + + These three mechanisms were put in place when the backingstore had a different + overall design that was not truly asynchronous. This patch replaces these + three mechanisms with a single one that uses the platform messaging classes to + full purpose - a uniquely coalescing message that has a higher priority level + than timers making sure the render queue can never come under pressure. + + * Api/BackingStore.cpp: + (BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate): + (WebKit): + (RenderJobMessage): + (BlackBerry::WebKit::RenderJobMessage::RenderJobMessage): + (BlackBerry::WebKit::BackingStorePrivate::dispatchRenderJob): + (BlackBerry::WebKit::BackingStorePrivate::renderJob): + (BlackBerry::WebKit::BackingStore::blitContents): + * Api/BackingStore.h: + * Api/BackingStore_p.h: + (BackingStorePrivate): + * Api/WebPage.cpp: + * Api/WebPage.h: + * WebKitSupport/RenderQueue.cpp: + (BlackBerry::WebKit::RenderQueue::reset): + (BlackBerry::WebKit::RenderQueue::addToRegularQueue): + (BlackBerry::WebKit::RenderQueue::addToScrollZoomQueue): + (BlackBerry::WebKit::RenderQueue::clear): + (BlackBerry::WebKit::RenderQueue::clearVisibleZoom): + (BlackBerry::WebKit::RenderQueue::render): + +2012-08-23 Antonio Gomes <agomes@rim.com> + + [BlackBerry] Unify slow and fast in-region scrolling code paths + https://bugs.webkit.org/show_bug.cgi?id=94834 + PR #197662 + + Reviewed by Rob Buis. + + Internally reviewed by Arvid Nilsson. + + In order to be able to remove a bunch of obsolete code from + InRegionScroller.cpp, we need to unify the codepaths for slow + and fast in-region scrolling. + + This patch caches the root scrollable node of each scrollable block + in InRegionScrollableArea also for the non-composited-scrolling case now too + (analogly to the way we cache LayerWebKitThread for the composited scrolling case). + + Now the client (libwebview) can dispatch an in-region scrolling with one single code path, + making use of a boolean (argh!) to inform if the scroll of the given + layer supports compositing or not. Later on, this boolean is used to casting the proper element. + + * Api/InRegionScroller.cpp: + (BlackBerry::WebKit::InRegionScroller::setScrollPositionWebKitThread): + (BlackBerry::WebKit::InRegionScrollerPrivate::setScrollPositionWebKitThread): + * Api/InRegionScroller.h: + * Api/InRegionScroller_p.h: + (InRegionScrollerPrivate): + * WebKitSupport/InRegionScrollableArea.cpp: + (WebKit): + (BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea): + (BlackBerry::WebKit::enclosingLayerNode): + * WebKitSupport/InRegionScrollableArea.h: + (WebCore): + (InRegionScrollableArea): + +2012-08-23 Jacky Jiang <zhajiang@rim.com> + + [BlackBerry] Web pages are zoomed out to much on initial load + https://bugs.webkit.org/show_bug.cgi?id=94830 + + Reviewed by Adam Treat. + + PR: 193943 + Browser continuously adds paddings to the left and right sides of the + main contents which makes the main contents even smaller. + The issue can be reproduced on the desktop websites such as + huffingtonpost.ca, bloomberg.com, online.wsj.com, nytimes.com, + yahoo.com, thestar.com, sina.com.cn, sohu.com and so on. + The root cause is that we layout those contents at the width of 1280 + although the fixed width of the main contents of those websites is + less than 1000, which results in adding the paddings. + To fix this, we need to get back to the default max layout size + 1024 * 768, which will make the main contents of those popular websites + take full advantage of the screen real estate and look much better. + + Internally reviewed by Adam Treat. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::fixedLayoutSize): + (BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments): + * Api/WebPage_p.h: + (WebPagePrivate): + * WebKitSupport/RenderQueue.cpp: + (BlackBerry::WebKit::RenderQueue::splittingFactor): + 2012-08-22 Crystal Zhang <haizhang@rim.com> [BlackBerry] Make all pickers non-zoomable diff --git a/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp b/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp index 44e7b49a9..f1141c336 100644 --- a/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.cpp @@ -46,6 +46,17 @@ InRegionScrollableArea::~InRegionScrollableArea() m_cachedCompositedScrollableLayer->clearOverride(); } +// FIXME: Make RenderLayer::enclosingElement public so this one can be removed. +static Node* enclosingLayerNode(RenderLayer* layer) +{ + for (RenderObject* r = layer->renderer(); r; r = r->parent()) { + if (Node* e = r->node()) + return e; + } + ASSERT_NOT_REACHED(); + return 0; +} + InRegionScrollableArea::InRegionScrollableArea(WebPagePrivate* webPage, RenderLayer* layer) : m_webPage(webPage) , m_layer(layer) @@ -92,11 +103,17 @@ InRegionScrollableArea::InRegionScrollableArea(WebPagePrivate* webPage, RenderLa m_scrollsHorizontally = box->scrollWidth() != box->clientWidth() && box->scrollsOverflowX(); m_scrollsVertically = box->scrollHeight() != box->clientHeight() && box->scrollsOverflowY(); + // Both caches below are self-exclusive. if (m_layer->usesCompositedScrolling()) { m_supportsCompositedScrolling = true; ASSERT(m_layer->backing()->hasScrollingLayer()); m_camouflagedCompositedScrollableLayer = reinterpret_cast<unsigned>(m_layer->backing()->scrollingLayer()->platformLayer()); m_cachedCompositedScrollableLayer = m_layer->backing()->scrollingLayer()->platformLayer(); + ASSERT(!m_cachedNonCompositedScrollableNode); + } else { + m_camouflagedCompositedScrollableLayer = reinterpret_cast<unsigned>(enclosingLayerNode(m_layer)); + m_cachedNonCompositedScrollableNode = enclosingLayerNode(m_layer); + ASSERT(!m_cachedCompositedScrollableLayer); } m_overscrollLimitFactor = 0.0; diff --git a/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.h b/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.h index 679e490b5..443b94f5a 100644 --- a/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.h +++ b/Source/WebKit/blackberry/WebKitSupport/InRegionScrollableArea.h @@ -25,6 +25,7 @@ namespace WebCore { class LayerWebKitThread; +class Node; class RenderLayer; } @@ -49,7 +50,10 @@ private: WebPagePrivate* m_webPage; WebCore::RenderLayer* m_layer; + // We either cache one here: in case of a composited scrollable layer + // cache the LayerWebKitThread. Otherwise, the Node. RefPtr<WebCore::LayerWebKitThread> m_cachedCompositedScrollableLayer; + RefPtr<WebCore::Node> m_cachedNonCompositedScrollableNode; bool m_hasWindowVisibleRectCalculated; }; diff --git a/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp b/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp index 1f320b9a8..3460bd8f0 100644 --- a/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp @@ -231,7 +231,6 @@ void RenderQueue::reset() m_currentRegularRenderJobsBatch.clear(); m_currentRegularRenderJobsBatchRegion = Platform::IntRectRegion(); m_regularRenderJobsNotRenderedRegion = Platform::IntRectRegion(); - m_parent->stopRenderTimer(); ASSERT(isEmpty()); } @@ -244,8 +243,7 @@ int RenderQueue::splittingFactor(const Platform::IntRect& rect) const // rendered in any one pass should stay fixed with regard to the zoom level. Platform::IntRect untransformedRect = m_parent->m_webPage->d->mapFromTransformed(rect); double rectArea = untransformedRect.width() * untransformedRect.height(); - Platform::IntSize defaultMaxLayoutSize = WebPagePrivate::defaultMaxLayoutSize(); - double maxArea = defaultMaxLayoutSize.width() * defaultMaxLayoutSize.height(); + double maxArea = DEFAULT_MAX_LAYOUT_WIDTH * DEFAULT_MAX_LAYOUT_HEIGHT; // Defined in WebPage_p.h. const unsigned splitFactor = 1 << 0; double renderRectArea = maxArea / splitFactor; @@ -376,7 +374,7 @@ void RenderQueue::addToRegularQueue(const Platform::IntRect& rect) m_regularRenderJobsRegion = Platform::IntRectRegion::unionRegions(m_regularRenderJobsRegion, rect); if (!isEmpty()) - m_parent->startRenderTimer(); // Start the render timer since we could have some stale content here... + m_parent->dispatchRenderJob(); } void RenderQueue::addToScrollZoomQueue(const RenderRect& rect, RenderRectList* rectList) @@ -391,7 +389,7 @@ void RenderQueue::addToScrollZoomQueue(const RenderRect& rect, RenderRectList* r rectList->push_back(rect); if (!isEmpty()) - m_parent->startRenderTimer(); // Start the render timer since we know we could have some checkerboard here... + m_parent->dispatchRenderJob(); } void RenderQueue::quickSort(RenderRectList* queue) @@ -528,9 +526,6 @@ void RenderQueue::clear(const Platform::IntRect& rect, bool clearRegularRenderJo if (m_nonVisibleScrollJobs.empty() && !m_nonVisibleScrollJobsCompleted.empty()) nonVisibleScrollJobsCompleted(); - - if (isEmpty()) - m_parent->stopRenderTimer(); } void RenderQueue::clearRegularRenderJobs(const Platform::IntRect& rect) @@ -549,8 +544,6 @@ void RenderQueue::clearRegularRenderJobs(const Platform::IntRect& rect) void RenderQueue::clearVisibleZoom() { m_visibleZoomJobs.clear(); - if (isEmpty()) - m_parent->stopRenderTimer(); } bool RenderQueue::regularRenderJobsPreviouslyAttemptedButNotRendered(const Platform::IntRect& rect) @@ -591,9 +584,6 @@ void RenderQueue::render(bool shouldPerformRegularRenderJobs) renderRegularRenderJob(); } else if (!m_nonVisibleScrollJobs.empty()) renderNonVisibleScrollJob(); - - if (isEmpty()) - m_parent->stopRenderTimer(); } void RenderQueue::renderAllCurrentRegularRenderJobs() diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index 396cc1114..2e08a17ed 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,332 @@ +2012-08-23 Antoine Labour <piman@chromium.org> + + [chromium] Fix lost context when textures are evicted + https://bugs.webkit.org/show_bug.cgi?id=94892 + + Reviewed by James Robinson. + + After eviction, the CCPrioritizedTextureManager is in a limbo state + where all its resources are invalid. If we try to release them we will + double-destroy them. + + New test: CCLayerTreeHostTestLostContextAfterEvictTextures. + + * tests/CCLayerTreeHostTest.cpp: + (CCLayerTreeHostTestLostContextAfterEvictTextures): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::CCLayerTreeHostTestLostContextAfterEvictTextures): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::beginTest): + (EvictTexturesAndLoseContextTask): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::EvictTexturesAndLoseContextTask::EvictTexturesAndLoseContextTask): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::EvictTexturesAndLoseContextTask::~EvictTexturesAndLoseContextTask): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::EvictTexturesAndLoseContextTask::run): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::postEvictTexturesAndLoseContext): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::didCommitAndDrawFrame): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::commitCompleteOnCCThread): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::didRecreateOutputSurface): + (WTF::CCLayerTreeHostTestLostContextAfterEvictTextures::afterTest): + (WTF): + (WTF::TEST_F): + +2012-08-23 Antoine Labour <piman@chromium.org> + + [chromium] Add OVERRIDEs in test code + https://bugs.webkit.org/show_bug.cgi?id=94894 + + Reviewed by James Robinson. + + * tests/CCLayerTreeHostTest.cpp: + +2012-08-23 Joshua Bell <jsbell@chromium.org> + + IndexedDB: Expose mechanism for database to force a connection to close + https://bugs.webkit.org/show_bug.cgi?id=91010 + + Reviewed by Tony Chang. + + In Chromium, the browsing data deleter has a WebIDBDatabase handle which + it can use to terminate a connection. This handles forcefully closing + the front end connections and the back end, to unblock disk cleanup. + + * public/WebIDBDatabase.h: + (WebKit::WebIDBDatabase::forceClose): Entry point. + * public/WebIDBDatabaseCallbacks.h: + (WebKit::WebIDBDatabaseCallbacks::onForcedClose): Plumbing back to front. + * src/IDBDatabaseCallbacksProxy.cpp: + (WebKit::IDBDatabaseCallbacksProxy::onForcedClose): Plumbing back to front. + (WebKit): + * src/IDBDatabaseCallbacksProxy.h: + (IDBDatabaseCallbacksProxy): Plumbing. + * src/WebIDBDatabaseCallbacksImpl.cpp: + (WebKit::WebIDBDatabaseCallbacksImpl::onForcedClose): Plumbing back to front. + (WebKit): + * src/WebIDBDatabaseCallbacksImpl.h: + (WebIDBDatabaseCallbacksImpl): Plumbing back to front. + * src/WebIDBDatabaseImpl.cpp: + (WebKit::WebIDBDatabaseImpl::close): Tidy up dropping the callback reference. + (WebKit): + (WebKit::WebIDBDatabaseImpl::forceClose): Terminate the connection by notifying + the back end and the front end, while avoid re-entrant badness. + * src/WebIDBDatabaseImpl.h: Header tweak for unit test. + (WebIDBDatabaseImpl): + * tests/IDBDatabaseBackendTest.cpp: Added unit test to exercise connections. + +2012-08-23 James Robinson <jamesr@chromium.org> + + [chromium] Convert WebAnimationCurve subtypes into pure virtual + https://bugs.webkit.org/show_bug.cgi?id=94068 + + Reviewed by Adrienne Walker. + + Updates the implementations, some callers and tests of Web*AnimationCurve to its new interface. + + * WebKit.gyp: + * src/WebAnimation.cpp: + (WebKit::WebAnimation::initialize): + * src/WebFloatAnimationCurveImpl.cpp: Renamed from Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp. + (WebKit): + (WebKit::WebFloatAnimationCurve::create): + (WebKit::WebFloatAnimationCurveImpl::WebFloatAnimationCurveImpl): + (WebKit::WebFloatAnimationCurveImpl::~WebFloatAnimationCurveImpl): + (WebKit::WebFloatAnimationCurveImpl::type): + (WebKit::WebFloatAnimationCurveImpl::add): + (WebKit::WebFloatAnimationCurveImpl::getValue): + (WebKit::WebFloatAnimationCurveImpl::cloneToCCAnimationCurve): + * src/WebTransformAnimationCurve.cpp: Removed. + * tests/WebAnimationTest.cpp: + (WebKit::TEST): + * tests/WebFloatAnimationCurveTest.cpp: + (WebKit::TEST): + * tests/WebTransformAnimationCurveTest.cpp: + (WebKit::TEST): + +2012-08-23 Kentaro Hara <haraken@chromium.org> + + [V8] Remove V8Proxy.{h,cpp} + https://bugs.webkit.org/show_bug.cgi?id=94794 + + Reviewed by Dimitri Glazkov. + + Now V8Proxy is no longer used. We can completely remove V8Proxy from the codebase. + + No tests. No change in behavior. + + * src/ChromeClientImpl.cpp: + * src/WebBindings.cpp: + * src/WebDOMMessageEvent.cpp: + * src/WebDevToolsAgentImpl.cpp: + * src/WebMediaPlayerClientImpl.cpp: + +2012-08-23 Dana Jansens <danakj@chromium.org> + + [chromium] Don't require a RenderSurface* in order to create a RenderPass + https://bugs.webkit.org/show_bug.cgi?id=94862 + + Reviewed by Adrienne Walker. + + * tests/CCLayerTreeHostImplTest.cpp: + * tests/CCRendererGLTest.cpp: + (FakeCCRendererClient::FakeCCRendererClient): + +2012-08-22 James Robinson <jamesr@chromium.org> + + [chromium] Remove WebLayer::setChildren API + https://bugs.webkit.org/show_bug.cgi?id=94749 + + Reviewed by Adrienne Walker. + + * src/WebLayer.cpp: + +2012-08-23 Dana Jansens <danakj@chromium.org> + + [chromium] Create sharedQuadState at same time as creating quads and give them to the quadSink + https://bugs.webkit.org/show_bug.cgi?id=94752 + + Reviewed by Adrienne Walker. + + * tests/CCLayerTreeHostImplTest.cpp: + * tests/CCLayerTreeHostTest.cpp: + (WTF::EvictionTestLayerImpl::appendQuads): + * tests/CCQuadCullerTest.cpp: + * tests/CCRenderSurfaceTest.cpp: + * tests/CCSolidColorLayerImplTest.cpp: + (CCLayerTestCommon::TEST): + * tests/CCTiledLayerImplTest.cpp: + (CCLayerTestCommon::TEST): + (CCLayerTestCommon::getQuads): + (CCLayerTestCommon::coverageVisibleRectOnTileBoundaries): + (CCLayerTestCommon::coverageVisibleRectIntersectsTiles): + (CCLayerTestCommon::coverageVisibleRectIntersectsBounds): + * tests/MockCCQuadCuller.h: + (WebCore::MockCCQuadCuller::MockCCQuadCuller): + (MockCCQuadCuller): + (WebCore::MockCCQuadCuller::quadList): + (WebCore::MockCCQuadCuller::sharedQuadStateList): + +2012-08-23 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed - fixing input list for timeline inspector module. + https://bugs.webkit.org/show_bug.cgi?id=94829 + + * WebKit.gyp: + +2012-08-23 Alexandre Elias <aelias@chromium.org> + + [chromium] Rename LayerRendererChromium to GL-specific name + https://bugs.webkit.org/show_bug.cgi?id=94835 + + Reviewed by James Robinson. + + Over time, LayerRendererChromium has evolved to be a GL-specific + subclass of CCRenderer that has no awareness of layers (as it operates + only with drawQuads). + + This patch renames LayerRendererChromium to CCRendererGL, replaces all + instances of "layerRenderer" with just "renderer", and removes a + few unnecessary includes of LayerRendererChromium.h. + + * WebKit.gypi: + * tests/CCLayerTreeHostImplTest.cpp: + * tests/CCLayerTreeHostTest.cpp: + (WTF::CCLayerTreeHostTestLayerOcclusion::beginTest): + (WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest): + (WTF::CCLayerTreeHostTestManySurfaces::beginTest): + (WTF::CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit::drawLayersOnCCThread): + * tests/CCRendererGLTest.cpp: Renamed from Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp. + (FrameCountingMemoryAllocationSettingContext): + (FrameCountingMemoryAllocationSettingContext::FrameCountingMemoryAllocationSettingContext): + (FrameCountingMemoryAllocationSettingContext::prepareTexture): + (FrameCountingMemoryAllocationSettingContext::setMemoryAllocationChangedCallbackCHROMIUM): + (FrameCountingMemoryAllocationSettingContext::getString): + (FrameCountingMemoryAllocationSettingContext::frameCount): + (FrameCountingMemoryAllocationSettingContext::setMemoryAllocation): + (FakeCCRendererClient): + (FakeCCRendererClient::FakeCCRendererClient): + (FakeCCRendererClient::setFullRootLayerDamageCount): + (FakeCCRendererClient::rootRenderPass): + (FakeCCRendererClient::renderPassesInDrawOrder): + (FakeCCRendererClient::renderPasses): + (FakeCCRendererClient::memoryAllocationLimitBytes): + (FakeCCRendererGL): + (FakeCCRendererGL::FakeCCRendererGL): + (CCRendererGLTest): + (CCRendererGLTest::CCRendererGLTest): + (CCRendererGLTest::SetUp): + (CCRendererGLTest::TearDown): + (CCRendererGLTest::swapBuffers): + (CCRendererGLTest::context): + (TEST_F): + (ForbidSynchronousCallContext): + (ForbidSynchronousCallContext::ForbidSynchronousCallContext): + (ForbidSynchronousCallContext::getActiveAttrib): + (ForbidSynchronousCallContext::getActiveUniform): + (ForbidSynchronousCallContext::getAttachedShaders): + (ForbidSynchronousCallContext::getAttribLocation): + (ForbidSynchronousCallContext::getBooleanv): + (ForbidSynchronousCallContext::getBufferParameteriv): + (ForbidSynchronousCallContext::getContextAttributes): + (ForbidSynchronousCallContext::getError): + (ForbidSynchronousCallContext::getFloatv): + (ForbidSynchronousCallContext::getFramebufferAttachmentParameteriv): + (ForbidSynchronousCallContext::getIntegerv): + (ForbidSynchronousCallContext::getProgramiv): + (ForbidSynchronousCallContext::getShaderiv): + (ForbidSynchronousCallContext::getString): + (ForbidSynchronousCallContext::getProgramInfoLog): + (ForbidSynchronousCallContext::getRenderbufferParameteriv): + (ForbidSynchronousCallContext::getShaderInfoLog): + (ForbidSynchronousCallContext::getShaderPrecisionFormat): + (ForbidSynchronousCallContext::getShaderSource): + (ForbidSynchronousCallContext::getTexParameterfv): + (ForbidSynchronousCallContext::getTexParameteriv): + (ForbidSynchronousCallContext::getUniformfv): + (ForbidSynchronousCallContext::getUniformiv): + (ForbidSynchronousCallContext::getUniformLocation): + (ForbidSynchronousCallContext::getVertexAttribfv): + (ForbidSynchronousCallContext::getVertexAttribiv): + (ForbidSynchronousCallContext::getVertexAttribOffset): + (TEST): + (LoseContextOnFirstGetContext): + (LoseContextOnFirstGetContext::LoseContextOnFirstGetContext): + (ContextThatDoesNotSupportMemoryManagmentExtensions): + (ContextThatDoesNotSupportMemoryManagmentExtensions::ContextThatDoesNotSupportMemoryManagmentExtensions): + (ContextThatDoesNotSupportMemoryManagmentExtensions::prepareTexture): + (ContextThatDoesNotSupportMemoryManagmentExtensions::setMemoryAllocationChangedCallbackCHROMIUM): + (ContextThatDoesNotSupportMemoryManagmentExtensions::getString): + (ClearCountingContext): + (ClearCountingContext::ClearCountingContext): + (ClearCountingContext::clear): + (ClearCountingContext::clearCount): + * tests/TiledLayerChromiumTest.cpp: + +2012-08-23 Stephen White <senorblanco@chromium.org> + + Unreviewed. Rolled DEPS. + + * DEPS: + +2012-08-23 Wei Jia <wjia@chromium.org> + + create different WebKit::WebMediaPlayer based on URL + https://bugs.webkit.org/show_bug.cgi?id=91301 + + Reviewed by Adam Barth. + + Pass URL to WebFrameClient::createMediaPlayer(). This allows creation + of different WebMediaPlayer implementations based on the URL. + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::createMediaPlayer): add URL as additional argument. + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::createWebMediaPlayer): add URL as additional argument. + (WebKit::WebMediaPlayerClientImpl::loadInternal): + +2012-08-23 Joshua Bell <jsbell@chromium.org> + + IndexedDB: Move onSuccess(IDBDatabaseBackendInterface) to IDBOpenDBRequest + https://bugs.webkit.org/show_bug.cgi?id=94757 + + Reviewed by Tony Chang. + + Drop onSuccess(IDBDatabaseBackendImpl) overload from test, as it is no longer + implemented by IDBRequest. + + * tests/IDBRequestTest.cpp: + (WebCore::TEST): + +2012-08-23 Kenneth Russell <kbr@google.com> + + Convert ScrollableArea ASSERT_NOT_REACHED virtuals into pure virtuals + https://bugs.webkit.org/show_bug.cgi?id=93306 + + Unreviewed build fix. + + * src/ScrollbarGroup.h: + +2012-08-23 Adrienne Walker <enne@google.com> + + Convert ScrollableArea ASSERT_NOT_REACHED virtuals + https://bugs.webkit.org/show_bug.cgi?id=93306 + + Reviewed by Darin Adler. + + Add implementations where necessary to make derived classes concrete. + Add OVERRIDE for ScrollableArea functions. + + * src/ScrollbarGroup.h: + (ScrollbarGroup): + (WebKit::ScrollbarGroup::scrollCornerRect): + * tests/ScrollAnimatorNoneTest.cpp: + (MockScrollableArea): + +2012-08-23 David Reveman <reveman@chromium.org> + + [Chromium] Unnecessary delay when starting to update resources with an inactive vsync timer. + https://bugs.webkit.org/show_bug.cgi?id=94719 + + Reviewed by James Robinson. + + * tests/CCSchedulerTestCommon.h: + 2012-08-23 Peter Beverloo <peter@chromium.org> Unreviewed. Rolled DEPS. diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS index 6322e4843..479de4270 100644 --- a/Source/WebKit/chromium/DEPS +++ b/Source/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '152985' + 'chromium_rev': '153032' } deps = { diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp index 1a46375fa..1fd2164bc 100644 --- a/Source/WebKit/chromium/WebKit.gyp +++ b/Source/WebKit/chromium/WebKit.gyp @@ -1177,7 +1177,7 @@ 'input_file': '../../WebCore/inspector/front-end/TimelinePanel.js', 'inputs': [ '<@(_script_name)', - '<@(webinspector_resources_js_files)', + '<@(webinspector_timeline_js_files)', ], 'search_path': '../../WebCore/inspector/front-end', 'outputs': ['<(PRODUCT_DIR)/resources/inspector/TimelinePanel.js'], diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi index fc86f83b3..890b3f675 100644 --- a/Source/WebKit/chromium/WebKit.gypi +++ b/Source/WebKit/chromium/WebKit.gypi @@ -125,7 +125,7 @@ 'tests/KeyboardTest.cpp', 'tests/KURLTest.cpp', 'tests/LayerChromiumTest.cpp', - 'tests/LayerRendererChromiumTest.cpp', + 'tests/CCRendererGLTest.cpp', 'tests/LevelDBTest.cpp', 'tests/LinkHighlightTest.cpp', 'tests/ListenerLeakTest.cpp', @@ -187,7 +187,8 @@ 'src/WebContentLayerImpl.h', 'src/WebExternalTextureLayerImpl.cpp', 'src/WebExternalTextureLayerImpl.h', - 'src/WebFloatAnimationCurve.cpp', + 'src/WebFloatAnimationCurveImpl.cpp', + 'src/WebFloatAnimationCurveImpl.h', 'src/WebIOSurfaceLayerImpl.cpp', 'src/WebIOSurfaceLayerImpl.h', 'src/WebImageLayerImpl.cpp', @@ -201,7 +202,8 @@ 'src/WebScrollbarLayerImpl.h', 'src/WebSolidColorLayerImpl.cpp', 'src/WebSolidColorLayerImpl.h', - 'src/WebTransformAnimationCurve.cpp', + 'src/WebTransformAnimationCurveImpl.cpp', + 'src/WebTransformAnimationCurveImpl.h', 'src/WebVideoLayerImpl.cpp', 'src/WebVideoLayerImpl.h', ], diff --git a/Source/WebKit/chromium/public/WebFrameClient.h b/Source/WebKit/chromium/public/WebFrameClient.h index cc8923d80..b4fccebc2 100644 --- a/Source/WebKit/chromium/public/WebFrameClient.h +++ b/Source/WebKit/chromium/public/WebFrameClient.h @@ -88,7 +88,7 @@ public: virtual WebSharedWorker* createSharedWorker(WebFrame*, const WebURL&, const WebString&, unsigned long long) { return 0; } // May return null. - virtual WebMediaPlayer* createMediaPlayer(WebFrame*, WebMediaPlayerClient*) { return 0; } + virtual WebMediaPlayer* createMediaPlayer(WebFrame*, const WebURL&, WebMediaPlayerClient*) { return 0; } // May return null. virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebApplicationCacheHostClient*) { return 0; } diff --git a/Source/WebKit/chromium/public/WebIDBDatabase.h b/Source/WebKit/chromium/public/WebIDBDatabase.h index 3eb1ecb74..a8b035c72 100644 --- a/Source/WebKit/chromium/public/WebIDBDatabase.h +++ b/Source/WebKit/chromium/public/WebIDBDatabase.h @@ -64,6 +64,7 @@ public: return 0; } virtual void close() { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void forceClose() { WEBKIT_ASSERT_NOT_REACHED(); } virtual void open(WebIDBDatabaseCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } diff --git a/Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h b/Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h index 0907b8bf0..12da7e0b4 100644 --- a/Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h +++ b/Source/WebKit/chromium/public/WebIDBDatabaseCallbacks.h @@ -35,6 +35,7 @@ class WebIDBDatabaseCallbacks { public: virtual ~WebIDBDatabaseCallbacks() { } + virtual void onForcedClose() { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onVersionChange(long long oldVersion, long long newVersion) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onVersionChange(const WebString& requestedVersion) { WEBKIT_ASSERT_NOT_REACHED(); } }; diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 329a99f19..d73654578 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -71,9 +71,6 @@ #include "SecurityOrigin.h" #include "Settings.h" #include "TextFieldDecorationElement.h" -#if USE(V8) -#include "V8Proxy.h" -#endif #include "WebAccessibilityObject.h" #if ENABLE(INPUT_TYPE_COLOR) #include "WebColorChooser.h" diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp index 019e59ba0..31897da9e 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp @@ -48,6 +48,11 @@ IDBDatabaseCallbacksProxy::~IDBDatabaseCallbacksProxy() { } +void IDBDatabaseCallbacksProxy::onForcedClose() +{ + m_callbacks->onForcedClose(); +} + void IDBDatabaseCallbacksProxy::onVersionChange(int64_t oldVersion, int64_t newVersion) { m_callbacks->onVersionChange(oldVersion, newVersion); diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h index 9995abd2b..cb1ddb346 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h @@ -40,6 +40,7 @@ public: static PassRefPtr<IDBDatabaseCallbacksProxy> create(PassOwnPtr<WebIDBDatabaseCallbacks>); virtual ~IDBDatabaseCallbacksProxy(); + virtual void onForcedClose(); virtual void onVersionChange(const String& requestedVersion); virtual void onVersionChange(int64_t oldVersion, int64_t newVersion); diff --git a/Source/WebKit/chromium/src/LinkHighlight.cpp b/Source/WebKit/chromium/src/LinkHighlight.cpp index fa34d1d0d..2c804a8cd 100644 --- a/Source/WebKit/chromium/src/LinkHighlight.cpp +++ b/Source/WebKit/chromium/src/LinkHighlight.cpp @@ -200,13 +200,13 @@ void LinkHighlight::startHighlightAnimation() m_contentLayer->layer()->setOpacity(startOpacity); - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, startOpacity)); - curve.add(WebFloatKeyframe(duration / 2, startOpacity)); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, startOpacity)); + curve->add(WebFloatKeyframe(duration / 2, startOpacity)); // For layout tests we don't fade out. - curve.add(WebFloatKeyframe(duration, WebKit::layoutTestMode() ? startOpacity : 0)); + curve->add(WebFloatKeyframe(duration, WebKit::layoutTestMode() ? startOpacity : 0)); - m_animation = adoptPtr(WebAnimation::create(curve, WebAnimation::TargetPropertyOpacity)); + m_animation = adoptPtr(WebAnimation::create(*curve, WebAnimation::TargetPropertyOpacity)); m_contentLayer->layer()->setDrawsContent(true); m_contentLayer->layer()->addAnimation(m_animation.get()); diff --git a/Source/WebKit/chromium/src/ScrollbarGroup.h b/Source/WebKit/chromium/src/ScrollbarGroup.h index a0479c206..b2df772f4 100644 --- a/Source/WebKit/chromium/src/ScrollbarGroup.h +++ b/Source/WebKit/chromium/src/ScrollbarGroup.h @@ -49,31 +49,31 @@ public: void setFrameRect(const WebCore::IntRect&); // WebCore::ScrollableArea methods - virtual int scrollSize(WebCore::ScrollbarOrientation) const; - virtual int scrollPosition(WebCore::Scrollbar*) const; - virtual void setScrollOffset(const WebCore::IntPoint&); - virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&); - virtual void invalidateScrollCornerRect(const WebCore::IntRect&); - virtual bool isActive() const; - virtual ScrollableArea* enclosingScrollableArea() const; - virtual WebCore::IntRect scrollCornerRect() const { return WebCore::IntRect(); } - virtual bool isScrollCornerVisible() const; - virtual void getTickmarks(Vector<WebCore::IntRect>&) const; - virtual WebCore::IntPoint convertFromContainingViewToScrollbar(const WebCore::Scrollbar*, const WebCore::IntPoint& parentPoint) const; - virtual WebCore::Scrollbar* horizontalScrollbar() const; - virtual WebCore::Scrollbar* verticalScrollbar() const; - virtual WebCore::IntPoint scrollPosition() const; - virtual WebCore::IntPoint minimumScrollPosition() const; - virtual WebCore::IntPoint maximumScrollPosition() const; - virtual int visibleHeight() const; - virtual int visibleWidth() const; - virtual WebCore::IntSize contentsSize() const; - virtual WebCore::IntSize overhangAmount() const; - virtual WebCore::IntPoint currentMousePosition() const; - virtual bool shouldSuspendScrollAnimations() const; - virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate); - virtual bool isOnActivePage() const; - virtual WebCore::IntRect scrollableAreaBoundingBox() const; + virtual int scrollSize(WebCore::ScrollbarOrientation) const OVERRIDE; + virtual int scrollPosition(WebCore::Scrollbar*) const OVERRIDE; + virtual void setScrollOffset(const WebCore::IntPoint&) OVERRIDE; + virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&) OVERRIDE; + virtual void invalidateScrollCornerRect(const WebCore::IntRect&) OVERRIDE; + virtual bool isActive() const OVERRIDE; + virtual ScrollableArea* enclosingScrollableArea() const OVERRIDE; + virtual WebCore::IntRect scrollCornerRect() const OVERRIDE { return WebCore::IntRect(); } + virtual bool isScrollCornerVisible() const OVERRIDE; + virtual void getTickmarks(Vector<WebCore::IntRect>&) const OVERRIDE; + virtual WebCore::IntPoint convertFromContainingViewToScrollbar(const WebCore::Scrollbar*, const WebCore::IntPoint& parentPoint) const OVERRIDE; + virtual WebCore::Scrollbar* horizontalScrollbar() const OVERRIDE; + virtual WebCore::Scrollbar* verticalScrollbar() const OVERRIDE; + virtual WebCore::IntPoint scrollPosition() const OVERRIDE; + virtual WebCore::IntPoint minimumScrollPosition() const OVERRIDE; + virtual WebCore::IntPoint maximumScrollPosition() const OVERRIDE; + virtual int visibleHeight() const OVERRIDE; + virtual int visibleWidth() const OVERRIDE; + virtual WebCore::IntSize contentsSize() const OVERRIDE; + virtual WebCore::IntSize overhangAmount() const OVERRIDE; + virtual WebCore::IntPoint currentMousePosition() const OVERRIDE; + virtual bool shouldSuspendScrollAnimations() const OVERRIDE; + virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) OVERRIDE; + virtual bool isOnActivePage() const OVERRIDE; + virtual WebCore::IntRect scrollableAreaBoundingBox() const OVERRIDE; private: WebCore::FrameView* m_frameView; diff --git a/Source/WebKit/chromium/src/WebAnimationImpl.cpp b/Source/WebKit/chromium/src/WebAnimationImpl.cpp index 187272ef2..e5d9ef2a3 100644 --- a/Source/WebKit/chromium/src/WebAnimationImpl.cpp +++ b/Source/WebKit/chromium/src/WebAnimationImpl.cpp @@ -29,6 +29,8 @@ #include "AnimationIdVendor.h" #include "CCActiveAnimation.h" #include "CCAnimationCurve.h" +#include "WebFloatAnimationCurveImpl.h" +#include "WebTransformAnimationCurveImpl.h" #include <public/WebAnimation.h> #include <public/WebAnimationCurve.h> #include <wtf/OwnPtr.h> @@ -46,7 +48,30 @@ WebAnimation* WebAnimation::create(const WebAnimationCurve& curve, TargetPropert WebAnimation* WebAnimation::create(const WebAnimationCurve& curve, int animationId, int groupId, TargetProperty targetProperty) { - return new WebAnimationImpl(CCActiveAnimation::create(curve, animationId, groupId, static_cast<WebCore::CCActiveAnimation::TargetProperty>(targetProperty))); + return new WebAnimationImpl(curve, animationId, groupId, targetProperty); +} + +WebAnimationImpl::WebAnimationImpl(const WebAnimationCurve& webCurve, int animationId, int groupId, TargetProperty targetProperty) +{ + WebAnimationCurve::AnimationCurveType curveType = webCurve.type(); + OwnPtr<WebCore::CCAnimationCurve> curve; + switch (curveType) { + case WebAnimationCurve::AnimationCurveTypeFloat: { + const WebFloatAnimationCurveImpl* floatCurveImpl = static_cast<const WebFloatAnimationCurveImpl*>(&webCurve); + curve = floatCurveImpl->cloneToCCAnimationCurve(); + break; + } + case WebAnimationCurve::AnimationCurveTypeTransform: { + const WebTransformAnimationCurveImpl* transformCurveImpl = static_cast<const WebTransformAnimationCurveImpl*>(&webCurve); + curve = transformCurveImpl->cloneToCCAnimationCurve(); + break; + } + } + m_animation = CCActiveAnimation::create(curve.release(), animationId, groupId, static_cast<WebCore::CCActiveAnimation::TargetProperty>(targetProperty)); +} + +WebAnimationImpl::~WebAnimationImpl() +{ } WebAnimation::TargetProperty WebAnimationImpl::targetProperty() const diff --git a/Source/WebKit/chromium/src/WebAnimationImpl.h b/Source/WebKit/chromium/src/WebAnimationImpl.h index 8677b9c60..d7ceba51f 100644 --- a/Source/WebKit/chromium/src/WebAnimationImpl.h +++ b/Source/WebKit/chromium/src/WebAnimationImpl.h @@ -37,11 +37,8 @@ namespace WebKit { class WebAnimationImpl : public WebAnimation { public: - explicit WebAnimationImpl(PassOwnPtr<WebCore::CCActiveAnimation> animation) - : m_animation(animation) - { - } - virtual ~WebAnimationImpl() { } + WebAnimationImpl(const WebAnimationCurve&, int animationId, int groupId, TargetProperty); + virtual ~WebAnimationImpl(); // WebAnimation implementation virtual TargetProperty targetProperty() const OVERRIDE; diff --git a/Source/WebKit/chromium/src/WebBindings.cpp b/Source/WebKit/chromium/src/WebBindings.cpp index 71a74db1b..c44dc429e 100644 --- a/Source/WebKit/chromium/src/WebBindings.cpp +++ b/Source/WebKit/chromium/src/WebBindings.cpp @@ -45,7 +45,6 @@ #include "V8DOMWrapper.h" #include "V8Element.h" #include "V8NPUtils.h" -#include "V8Proxy.h" #include "V8Range.h" #include <wtf/ArrayBufferView.h> // FIXME: Remove the USE(JSC) ifdefs because we don't support USE(JSC) anymore. diff --git a/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp b/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp index 06cf66fc5..383c7de21 100644 --- a/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp +++ b/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp @@ -42,10 +42,6 @@ #include "platform/WebSerializedScriptValue.h" #include "platform/WebString.h" -#if USE(V8) -#include "V8Proxy.h" -#endif - using namespace WebCore; namespace WebKit { diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index e3a80e0d4..c639f674d 100644 --- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -51,7 +51,6 @@ #include "ResourceRequest.h" #include "ResourceResponse.h" #include "V8Binding.h" -#include "V8Proxy.h" #include "V8Utilities.h" #include "WebDataSource.h" #include "WebDevToolsAgentClient.h" diff --git a/Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp b/Source/WebKit/chromium/src/WebFloatAnimationCurveImpl.cpp index e8cf7c2d2..9f5665cb8 100644 --- a/Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp +++ b/Source/WebKit/chromium/src/WebFloatAnimationCurveImpl.cpp @@ -24,8 +24,9 @@ #include "config.h" -#include <public/WebFloatAnimationCurve.h> +#include "WebFloatAnimationCurveImpl.h" +#include "CCAnimationCurve.h" #include "CCKeyframedAnimationCurve.h" #include "CCTimingFunction.h" #include "WebAnimationCurveCommon.h" @@ -34,39 +35,48 @@ namespace WebKit { -void WebFloatAnimationCurve::add(const WebFloatKeyframe& keyframe) +WebFloatAnimationCurve* WebFloatAnimationCurve::create() +{ + return new WebFloatAnimationCurveImpl(WebCore::CCKeyframedFloatAnimationCurve::create()); +} + +WebFloatAnimationCurveImpl::WebFloatAnimationCurveImpl(PassOwnPtr<WebCore::CCKeyframedFloatAnimationCurve> curve) + : m_curve(curve) { - add(keyframe, TimingFunctionTypeEase); } -void WebFloatAnimationCurve::add(const WebFloatKeyframe& keyframe, TimingFunctionType type) +WebFloatAnimationCurveImpl::~WebFloatAnimationCurveImpl() { - m_private->addKeyframe(WebCore::CCFloatKeyframe::create(keyframe.time, keyframe.value, createTimingFunction(type))); } -void WebFloatAnimationCurve::add(const WebFloatKeyframe& keyframe, double x1, double y1, double x2, double y2) +WebAnimationCurve::AnimationCurveType WebFloatAnimationCurveImpl::type() const { - m_private->addKeyframe(WebCore::CCFloatKeyframe::create(keyframe.time, keyframe.value, WebCore::CCCubicBezierTimingFunction::create(x1, y1, x2, y2))); + return WebAnimationCurve::AnimationCurveTypeFloat; +} + +void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe) +{ + add(keyframe, TimingFunctionTypeEase); } -float WebFloatAnimationCurve::getValue(double time) const +void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe, TimingFunctionType type) { - return m_private->getValue(time); + m_curve->addKeyframe(WebCore::CCFloatKeyframe::create(keyframe.time, keyframe.value, createTimingFunction(type))); } -WebFloatAnimationCurve::operator PassOwnPtr<WebCore::CCAnimationCurve>() const +void WebFloatAnimationCurveImpl::add(const WebFloatKeyframe& keyframe, double x1, double y1, double x2, double y2) { - return m_private->clone(); + m_curve->addKeyframe(WebCore::CCFloatKeyframe::create(keyframe.time, keyframe.value, WebCore::CCCubicBezierTimingFunction::create(x1, y1, x2, y2))); } -void WebFloatAnimationCurve::initialize() +float WebFloatAnimationCurveImpl::getValue(double time) const { - m_private.reset(WebCore::CCKeyframedFloatAnimationCurve::create().leakPtr()); + return m_curve->getValue(time); } -void WebFloatAnimationCurve::destroy() +PassOwnPtr<WebCore::CCAnimationCurve> WebFloatAnimationCurveImpl::cloneToCCAnimationCurve() const { - m_private.reset(0); + return m_curve->clone(); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebFloatAnimationCurveImpl.h b/Source/WebKit/chromium/src/WebFloatAnimationCurveImpl.h new file mode 100644 index 000000000..e8f1620d6 --- /dev/null +++ b/Source/WebKit/chromium/src/WebFloatAnimationCurveImpl.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebFloatAnimationCurveImpl_h +#define WebFloatAnimationCurveImpl_h + +#include <public/WebFloatAnimationCurve.h> +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +namespace WebCore { +class CCAnimationCurve; +class CCKeyframedFloatAnimationCurve; +} + +namespace WebKit { + +class WebFloatAnimationCurveImpl : public WebFloatAnimationCurve { +public: + explicit WebFloatAnimationCurveImpl(PassOwnPtr<WebCore::CCKeyframedFloatAnimationCurve>); + virtual ~WebFloatAnimationCurveImpl(); + + // WebAnimationCurve implementation. + virtual AnimationCurveType type() const OVERRIDE; + + // WebFloatAnimationCurve implementation. + virtual void add(const WebFloatKeyframe&) OVERRIDE; + virtual void add(const WebFloatKeyframe&, TimingFunctionType) OVERRIDE; + virtual void add(const WebFloatKeyframe&, double x1, double y1, double x2, double y2) OVERRIDE; + + virtual float getValue(double time) const OVERRIDE; + + PassOwnPtr<WebCore::CCAnimationCurve> cloneToCCAnimationCurve() const; + +private: + OwnPtr<WebCore::CCKeyframedFloatAnimationCurve> m_curve; +}; + +} + +#endif // WebFloatAnimationCurveImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp index 14757bac6..5ae86a679 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp @@ -44,6 +44,11 @@ WebIDBDatabaseCallbacksImpl::~WebIDBDatabaseCallbacksImpl() { } +void WebIDBDatabaseCallbacksImpl::onForcedClose() +{ + m_callbacks->onForcedClose(); +} + void WebIDBDatabaseCallbacksImpl::onVersionChange(long long oldVersion, long long newVersion) { m_callbacks->onVersionChange(oldVersion, newVersion); diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h index 1857ca658..b0737eeb2 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h @@ -43,6 +43,7 @@ public: WebIDBDatabaseCallbacksImpl(PassRefPtr<WebCore::IDBDatabaseCallbacks>); virtual ~WebIDBDatabaseCallbacksImpl(); + virtual void onForcedClose(); virtual void onVersionChange(long long oldVersion, long long newVersion); virtual void onVersionChange(const WebString& version); diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index 9343281cf..0d142bc02 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -99,8 +99,18 @@ void WebIDBDatabaseImpl::close() m_closePending = true; return; } - m_databaseBackend->close(m_databaseCallbacks); - m_databaseCallbacks = 0; + m_databaseBackend->close(m_databaseCallbacks.release()); +} + +void WebIDBDatabaseImpl::forceClose() +{ + if (!m_databaseCallbacks) { + m_closePending = true; + return; + } + RefPtr<IDBDatabaseCallbacksProxy> callbacks = m_databaseCallbacks.release(); + m_databaseBackend->close(callbacks); + callbacks->onForcedClose(); } void WebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks) diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h index 1409cb65f..4a8284ce5 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -28,6 +28,7 @@ #if ENABLE(INDEXED_DATABASE) +#include "IDBDatabaseCallbacksProxy.h" #include "platform/WebCommon.h" #include "WebExceptionCode.h" #include "WebIDBDatabase.h" @@ -38,7 +39,6 @@ namespace WebCore { class IDBDatabaseBackendInterface; } namespace WebKit { -class IDBDatabaseCallbacksProxy; class WebIDBDatabaseCallbacks; class WebIDBDatabaseMetadata; class WebIDBObjectStore; @@ -56,6 +56,7 @@ public: virtual void deleteObjectStore(const WebString& name, const WebIDBTransaction&, WebExceptionCode&); virtual void setVersion(const WebString& version, WebIDBCallbacks*, WebExceptionCode&); virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, WebExceptionCode&); + virtual void forceClose(); virtual void close(); // FIXME: Rename "open" to registerFrontendCallbacks. diff --git a/Source/WebKit/chromium/src/WebLayerImpl.cpp b/Source/WebKit/chromium/src/WebLayerImpl.cpp index 40ced485d..bf64a8f2a 100644 --- a/Source/WebKit/chromium/src/WebLayerImpl.cpp +++ b/Source/WebKit/chromium/src/WebLayerImpl.cpp @@ -123,14 +123,6 @@ void WebLayerImpl::replaceChild(WebLayer* reference, WebLayer* newLayer) m_layer->replaceChild(static_cast<WebLayerImpl*>(reference)->layer(), static_cast<WebLayerImpl*>(newLayer)->layer()); } -void WebLayerImpl::setChildren(const WebVector<WebLayer*>& webChildren) -{ - Vector<RefPtr<LayerChromium> > children(webChildren.size()); - for (size_t i = 0; i < webChildren.size(); ++i) - children[i] = static_cast<WebLayerImpl*>(webChildren[i])->layer(); - m_layer->setChildren(children); -} - void WebLayerImpl::removeFromParent() { m_layer->removeFromParent(); diff --git a/Source/WebKit/chromium/src/WebLayerImpl.h b/Source/WebKit/chromium/src/WebLayerImpl.h index 7e3b533bc..0a61826a5 100644 --- a/Source/WebKit/chromium/src/WebLayerImpl.h +++ b/Source/WebKit/chromium/src/WebLayerImpl.h @@ -47,7 +47,6 @@ public: virtual void addChild(WebLayer*) OVERRIDE; virtual void insertChild(WebLayer*, size_t index) OVERRIDE; virtual void replaceChild(WebLayer* reference, WebLayer* newLayer) OVERRIDE; - virtual void setChildren(const WebVector<WebLayer*>&) OVERRIDE; virtual void removeFromParent() OVERRIDE; virtual void removeAllChildren() OVERRIDE; virtual void setAnchorPoint(const WebFloatPoint&) OVERRIDE; diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index cb756233e..72e871637 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -7,6 +7,7 @@ #if ENABLE(VIDEO) +#include "AudioBus.h" #include "AudioSourceProvider.h" #include "AudioSourceProviderClient.h" #include "Frame.h" @@ -45,13 +46,13 @@ using namespace WebCore; namespace WebKit { -static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* client, Frame* frame) +static PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(WebMediaPlayerClient* client, const WebURL& url, Frame* frame) { WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame); if (!webFrame->client()) return nullptr; - return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, client)); + return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, url, client)); } bool WebMediaPlayerClientImpl::m_isEnabled = false; @@ -321,7 +322,7 @@ void WebMediaPlayerClientImpl::loadInternal() #endif Frame* frame = static_cast<HTMLMediaElement*>(m_mediaPlayer->mediaPlayerClient())->document()->frame(); - m_webMediaPlayer = createWebMediaPlayer(this, frame); + m_webMediaPlayer = createWebMediaPlayer(this, KURL(ParsedURLString, m_url), frame); if (m_webMediaPlayer) { #if ENABLE(WEB_AUDIO) // Make sure if we create/re-create the WebMediaPlayer that we update our wrapper. diff --git a/Source/WebKit/chromium/src/WebTransformAnimationCurveImpl.cpp b/Source/WebKit/chromium/src/WebTransformAnimationCurveImpl.cpp new file mode 100644 index 000000000..201042e95 --- /dev/null +++ b/Source/WebKit/chromium/src/WebTransformAnimationCurveImpl.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "WebTransformAnimationCurveImpl.h" + +#include "CCKeyframedAnimationCurve.h" +#include "CCTimingFunction.h" +#include "WebAnimationCurveCommon.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +namespace WebKit { + +WebTransformAnimationCurve* WebTransformAnimationCurve::create() +{ + return new WebTransformAnimationCurveImpl(WebCore::CCKeyframedTransformAnimationCurve::create()); +} + +WebTransformAnimationCurveImpl::WebTransformAnimationCurveImpl(PassOwnPtr<WebCore::CCKeyframedTransformAnimationCurve> curve) + : m_curve(curve) +{ +} + +WebTransformAnimationCurveImpl::~WebTransformAnimationCurveImpl() +{ +} + +WebAnimationCurve::AnimationCurveType WebTransformAnimationCurveImpl::type() const +{ + return WebAnimationCurve::AnimationCurveTypeTransform; +} + +void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe) +{ + add(keyframe, TimingFunctionTypeEase); +} + +void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, TimingFunctionType type) +{ + m_curve->addKeyframe(WebCore::CCTransformKeyframe::create(keyframe.time, keyframe.value, createTimingFunction(type))); +} + +void WebTransformAnimationCurveImpl::add(const WebTransformKeyframe& keyframe, double x1, double y1, double x2, double y2) +{ + m_curve->addKeyframe(WebCore::CCTransformKeyframe::create(keyframe.time, keyframe.value, WebCore::CCCubicBezierTimingFunction::create(x1, y1, x2, y2))); +} + +WebTransformationMatrix WebTransformAnimationCurveImpl::getValue(double time) const +{ + return m_curve->getValue(time); +} + +PassOwnPtr<WebCore::CCAnimationCurve> WebTransformAnimationCurveImpl::cloneToCCAnimationCurve() const +{ + return m_curve->clone(); +} + +} // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp b/Source/WebKit/chromium/src/WebTransformAnimationCurveImpl.h index dad084987..45a03ef06 100644 --- a/Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp +++ b/Source/WebKit/chromium/src/WebTransformAnimationCurveImpl.h @@ -22,51 +22,41 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" +#ifndef WebTransformAnimationCurveImpl_h +#define WebTransformAnimationCurveImpl_h #include <public/WebTransformAnimationCurve.h> - -#include "CCKeyframedAnimationCurve.h" -#include "CCTimingFunction.h" -#include "WebAnimationCurveCommon.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> +namespace WebCore { +class CCAnimationCurve; +class CCKeyframedTransformAnimationCurve; +} + namespace WebKit { -void WebTransformAnimationCurve::add(const WebTransformKeyframe& keyframe) -{ - add(keyframe, TimingFunctionTypeEase); -} +class WebTransformAnimationCurveImpl : public WebTransformAnimationCurve { +public: + explicit WebTransformAnimationCurveImpl(PassOwnPtr<WebCore::CCKeyframedTransformAnimationCurve>); + virtual ~WebTransformAnimationCurveImpl(); -void WebTransformAnimationCurve::add(const WebTransformKeyframe& keyframe, TimingFunctionType type) -{ - m_private->addKeyframe(WebCore::CCTransformKeyframe::create(keyframe.time, keyframe.value, createTimingFunction(type))); -} + // WebAnimationCurve implementation. + virtual AnimationCurveType type() const OVERRIDE; -void WebTransformAnimationCurve::add(const WebTransformKeyframe& keyframe, double x1, double y1, double x2, double y2) -{ - m_private->addKeyframe(WebCore::CCTransformKeyframe::create(keyframe.time, keyframe.value, WebCore::CCCubicBezierTimingFunction::create(x1, y1, x2, y2))); -} + // WebTransformAnimationCurve implementation. + virtual void add(const WebTransformKeyframe&) OVERRIDE; + virtual void add(const WebTransformKeyframe&, TimingFunctionType) OVERRIDE; + virtual void add(const WebTransformKeyframe&, double x1, double y1, double x2, double y2) OVERRIDE; -WebTransformationMatrix WebTransformAnimationCurve::getValue(double time) const -{ - return m_private->getValue(time); -} + virtual WebTransformationMatrix getValue(double time) const OVERRIDE; -WebTransformAnimationCurve::operator PassOwnPtr<WebCore::CCAnimationCurve>() const -{ - return m_private->clone(); -} + PassOwnPtr<WebCore::CCAnimationCurve> cloneToCCAnimationCurve() const; -void WebTransformAnimationCurve::initialize() -{ - m_private.reset(WebCore::CCKeyframedTransformAnimationCurve::create().leakPtr()); -} +private: + OwnPtr<WebCore::CCKeyframedTransformAnimationCurve> m_curve; +}; -void WebTransformAnimationCurve::destroy() -{ - m_private.reset(0); } -} // namespace WebKit +#endif // WebTransformAnimationCurveImpl_h diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp index 6ec0ce5d7..a715f5b9a 100644 --- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp +++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp @@ -35,6 +35,7 @@ #include "CCLayerTreeTestCommon.h" #include "CCQuadCuller.h" #include "CCRenderPassDrawQuad.h" +#include "CCRendererGL.h" #include "CCScrollbarLayerImpl.h" #include "CCSettings.h" #include "CCSingleThreadProxy.h" @@ -47,7 +48,6 @@ #include "FakeWebCompositorOutputSurface.h" #include "FakeWebGraphicsContext3D.h" #include "FakeWebScrollbarThemeGeometry.h" -#include "LayerRendererChromium.h" #include <gmock/gmock.h> #include <gtest/gtest.h> #include <public/WebVideoFrame.h> @@ -76,7 +76,7 @@ public: settings.minimumOcclusionTrackingSize = IntSize(); m_hostImpl = CCLayerTreeHostImpl::create(settings, this); - m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader); + m_hostImpl->initializeRenderer(createContext(), UnthrottledUploader); m_hostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10)); } @@ -96,7 +96,7 @@ public: OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this); - myHostImpl->initializeLayerRenderer(graphicsContext, UnthrottledUploader); + myHostImpl->initializeRenderer(graphicsContext, UnthrottledUploader); myHostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10)); OwnPtr<CCLayerImpl> root = rootPtr; @@ -165,9 +165,9 @@ public: return layer.release(); } - void initializeLayerRendererAndDrawFrame() + void initializeRendererAndDrawFrame() { - m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader); + m_hostImpl->initializeRenderer(createContext(), UnthrottledUploader); CCLayerTreeHostImpl::FrameData frame; EXPECT_TRUE(m_hostImpl->prepareToDraw(frame)); m_hostImpl->drawLayers(frame); @@ -265,7 +265,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootCallsCommitAndRedraw) { setupScrollAndContentsLayers(IntSize(100, 100)); m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted); m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10)); @@ -286,7 +286,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollWithoutRenderer) m_hostImpl = CCLayerTreeHostImpl::create(settings, this); // Initialization will fail here. - m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader); + m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader); m_hostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10)); setupScrollAndContentsLayers(IntSize(100, 100)); @@ -301,7 +301,7 @@ TEST_F(CCLayerTreeHostImplTest, replaceTreeWhileScrolling) setupScrollAndContentsLayers(IntSize(100, 100)); m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); // We should not crash if the tree is replaced while we are scrolling. EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted); @@ -321,7 +321,7 @@ TEST_F(CCLayerTreeHostImplTest, clearRootRenderSurfaceAndScroll) { setupScrollAndContentsLayers(IntSize(100, 100)); m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); // We should be able to scroll even if the root layer loses its render surface after the most // recent render. @@ -333,7 +333,7 @@ TEST_F(CCLayerTreeHostImplTest, wheelEventHandlers) { setupScrollAndContentsLayers(IntSize(100, 100)); m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); CCLayerImpl* root = m_hostImpl->rootLayer(); root->setHaveWheelEventHandlers(true); @@ -349,7 +349,7 @@ TEST_F(CCLayerTreeHostImplTest, shouldScrollOnMainThread) { setupScrollAndContentsLayers(IntSize(100, 100)); m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); CCLayerImpl* root = m_hostImpl->rootLayer(); root->setShouldScrollOnMainThread(true); @@ -362,7 +362,7 @@ TEST_F(CCLayerTreeHostImplTest, nonFastScrollableRegionBasic) { setupScrollAndContentsLayers(IntSize(200, 200)); m_hostImpl->setViewportSize(IntSize(100, 100), IntSize(100, 100)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); CCLayerImpl* root = m_hostImpl->rootLayer(); root->setNonFastScrollableRegion(IntRect(0, 0, 50, 50)); @@ -388,7 +388,7 @@ TEST_F(CCLayerTreeHostImplTest, nonFastScrollableRegionWithOffset) root->setNonFastScrollableRegion(IntRect(0, 0, 50, 50)); root->setPosition(FloatPoint(-25, 0)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); // This point would fall into the non-fast scrollable region except that we've moved the layer down by 25 pixels. EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(40, 10), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted); @@ -403,7 +403,7 @@ TEST_F(CCLayerTreeHostImplTest, pinchGesture) { setupScrollAndContentsLayers(IntSize(100, 100)); m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer(); ASSERT(scrollLayer); @@ -484,7 +484,7 @@ TEST_F(CCLayerTreeHostImplTest, pageScaleAnimation) { setupScrollAndContentsLayers(IntSize(100, 100)); m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer(); ASSERT(scrollLayer); @@ -534,7 +534,7 @@ TEST_F(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZoomin { setupScrollAndContentsLayers(IntSize(100, 100)); m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer(); ASSERT(scrollLayer); @@ -588,7 +588,7 @@ TEST_F(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPa { setupScrollAndContentsLayers(IntSize(100, 100)); m_hostImpl->setViewportSize(IntSize(50, 50), IntSize(50, 50)); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer(); ASSERT(scrollLayer); @@ -849,7 +849,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootIgnored) OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); root->setScrollable(false); m_hostImpl->setRootLayer(root.release()); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); // Scroll event is ignored because layer is not scrollable. EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollIgnored); @@ -882,7 +882,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollNonCompositedRoot) m_hostImpl->setRootLayer(scrollLayer.release()); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted); m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10)); @@ -900,7 +900,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildCallsCommitAndRedraw) root->addChild(createScrollableLayer(2, surfaceSize)); m_hostImpl->setRootLayer(root.release()); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted); m_hostImpl->scrollBy(IntPoint(), IntSize(0, 10)); @@ -916,7 +916,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollMissesChild) root->addChild(createScrollableLayer(2, surfaceSize)); m_hostImpl->setRootLayer(root.release()); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); // Scroll event is ignored because the input coordinate is outside the layer boundaries. EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(15, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollIgnored); @@ -938,7 +938,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollMissesBackfacingChild) root->addChild(child.release()); m_hostImpl->setRootLayer(root.release()); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); // Scroll event is ignored because the scrollable layer is not facing the viewer and there is // nothing scrollable behind it. @@ -959,7 +959,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollBlockedByContentLayer) m_hostImpl->setRootLayer(scrollLayer.release()); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); // Scrolling fails because the content layer is asking to be scrolled on the main thread. EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollOnMainThread); @@ -972,7 +972,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread) OwnPtr<CCLayerImpl> root = createScrollableLayer(1, surfaceSize); m_hostImpl->setRootLayer(root.release()); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); IntSize scrollDelta(0, 10); IntSize expectedScrollDelta(scrollDelta); @@ -1004,7 +1004,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread) m_hostImpl->setRootLayer(root.release()); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); IntSize scrollDelta(0, 10); IntSize expectedScrollDelta(scrollDelta); @@ -1081,7 +1081,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread) root->addChild(createScrollableLayer(scrollLayerId, surfaceSize)); m_hostImpl->setRootLayer(root.release()); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); CCLayerImpl* child = m_hostImpl->rootLayer()->children()[0].get(); @@ -1125,7 +1125,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollChildBeyondLimit) root->addChild(child.release()); m_hostImpl->setRootLayer(root.release()); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); { IntSize scrollDelta(-8, -7); EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted); @@ -1157,7 +1157,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollEventBubbling) m_hostImpl->setRootLayer(root.release()); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); { IntSize scrollDelta(0, 4); EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(5, 5), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollStarted); @@ -1179,7 +1179,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollBeforeRedraw) m_hostImpl->setViewportSize(surfaceSize, surfaceSize); // Draw one frame and then immediately rebuild the layer tree to mimic a tree synchronization. - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); m_hostImpl->detachLayerTree(); m_hostImpl->setRootLayer(createScrollableLayer(2, surfaceSize)); @@ -1198,7 +1198,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollAxisAlignedRotatedLayer) IntSize surfaceSize(50, 50); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); // Scroll to the right in screen coordinates with a gesture. IntSize gestureScrollDelta(10, 0); @@ -1242,7 +1242,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollNonAxisAlignedRotatedLayer) IntSize surfaceSize(50, 50); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); { // Scroll down in screen coordinates with a gesture. @@ -1295,7 +1295,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollScaledLayer) IntSize surfaceSize(50, 50); m_hostImpl->setViewportSize(surfaceSize, surfaceSize); - initializeLayerRendererAndDrawFrame(); + initializeRendererAndDrawFrame(); // Scroll down in screen coordinates with a gesture. IntSize scrollDelta(0, 10); @@ -1345,7 +1345,7 @@ class BlendStateCheckLayer : public CCLayerImpl { public: static PassOwnPtr<BlendStateCheckLayer> create(int id, CCResourceProvider* resourceProvider) { return adoptPtr(new BlendStateCheckLayer(id, resourceProvider)); } - virtual void appendQuads(CCQuadSink& quadList, const CCSharedQuadState* sharedQuadState, bool&) OVERRIDE + virtual void appendQuads(CCQuadSink& quadSink, bool&) OVERRIDE { m_quadsAppended = true; @@ -1354,11 +1354,13 @@ public: opaqueRect = m_quadRect; else opaqueRect = m_opaqueContentRect; + + CCSharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQuadState()); OwnPtr<CCDrawQuad> testBlendingDrawQuad = CCTileDrawQuad::create(sharedQuadState, m_quadRect, opaqueRect, m_resourceId, IntPoint(), IntSize(1, 1), 0, false, false, false, false, false); testBlendingDrawQuad->setQuadVisibleRect(m_quadVisibleRect); EXPECT_EQ(m_blend, testBlendingDrawQuad->needsBlending()); EXPECT_EQ(m_hasRenderSurface, !!renderSurface()); - quadList.append(testBlendingDrawQuad.release()); + quadSink.append(testBlendingDrawQuad.release()); } void setExpectation(bool blend, bool hasRenderSurface) @@ -1622,7 +1624,7 @@ TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers) TEST_F(CCLayerTreeHostImplTest, viewportCovered) { - m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader); + m_hostImpl->initializeRenderer(createContext(), UnthrottledUploader); m_hostImpl->setBackgroundColor(SK_ColorGRAY); IntSize viewportSize(1000, 1000); @@ -1733,7 +1735,7 @@ TEST_F(CCLayerTreeHostImplTest, reshapeNotCalledUntilDraw) { OwnPtr<CCGraphicsContext> ccContext = FakeWebCompositorOutputSurface::create(adoptPtr(new ReshapeTrackerContext)); ReshapeTrackerContext* reshapeTracker = static_cast<ReshapeTrackerContext*>(ccContext->context3D()); - m_hostImpl->initializeLayerRenderer(ccContext.release(), UnthrottledUploader); + m_hostImpl->initializeRenderer(ccContext.release(), UnthrottledUploader); CCLayerImpl* root = new FakeDrawableCCLayerImpl(1); root->setAnchorPoint(FloatPoint(0, 0)); @@ -1782,7 +1784,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect) CCLayerTreeSettings settings; CCSettings::setPartialSwapEnabled(true); OwnPtr<CCLayerTreeHostImpl> layerTreeHostImpl = CCLayerTreeHostImpl::create(settings, this); - layerTreeHostImpl->initializeLayerRenderer(ccContext.release(), UnthrottledUploader); + layerTreeHostImpl->initializeRenderer(ccContext.release(), UnthrottledUploader); layerTreeHostImpl->setViewportSize(IntSize(500, 500), IntSize(500, 500)); CCLayerImpl* root = new FakeDrawableCCLayerImpl(1); @@ -1877,12 +1879,14 @@ class FakeLayerWithQuads : public CCLayerImpl { public: static PassOwnPtr<FakeLayerWithQuads> create(int id) { return adoptPtr(new FakeLayerWithQuads(id)); } - virtual void appendQuads(CCQuadSink& quadList, const CCSharedQuadState* sharedQuadState, bool&) OVERRIDE + virtual void appendQuads(CCQuadSink& quadSink, bool&) OVERRIDE { + CCSharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQuadState()); + SkColor gray = SkColorSetRGB(100, 100, 100); IntRect quadRect(IntPoint(0, 0), contentBounds()); OwnPtr<CCDrawQuad> myQuad = CCSolidColorDrawQuad::create(sharedQuadState, quadRect, gray); - quadList.append(myQuad.release()); + quadSink.append(myQuad.release()); } private: @@ -2067,7 +2071,7 @@ static PassOwnPtr<CCLayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, C CCLayerTreeSettings settings; OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, client); - myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + myHostImpl->initializeRenderer(context.release(), UnthrottledUploader); myHostImpl->setViewportSize(IntSize(100, 100), IntSize(100, 100)); /* @@ -2206,7 +2210,7 @@ TEST_F(CCLayerTreeHostImplTest, contextLostAndRestoredNotificationSentToAllLayer EXPECT_FALSE(layer1->didLoseContextCalled()); EXPECT_FALSE(layer2->didLoseContextCalled()); - m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader); + m_hostImpl->initializeRenderer(createContext(), UnthrottledUploader); EXPECT_TRUE(root->didLoseContextCalled()); EXPECT_TRUE(layer1->didLoseContextCalled()); @@ -2219,7 +2223,7 @@ TEST_F(CCLayerTreeHostImplTest, finishAllRenderingAfterContextLost) m_hostImpl = CCLayerTreeHostImpl::create(settings, this); // The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects. - m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader); + m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader); m_hostImpl->finishAllRendering(); } @@ -2501,7 +2505,7 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) rootLayer->addChild(scrollbarLayer.release()); // Use a context that supports IOSurfaces - m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DWithIOSurface)), UnthrottledUploader); + m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DWithIOSurface)), UnthrottledUploader); hwVideoFrame.setTextureId(m_hostImpl->resourceProvider()->graphicsContext3D()->createTexture()); @@ -2517,7 +2521,7 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) // Lose the context, replacing it with a StrictWebGraphicsContext3DWithIOSurface, // that will warn if any resource from the previous context gets used. - m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new StrictWebGraphicsContext3DWithIOSurface)), UnthrottledUploader); + m_hostImpl->initializeRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new StrictWebGraphicsContext3DWithIOSurface)), UnthrottledUploader); // Create dummy resources so that looking up an old resource will get an // invalid texture id mapping. @@ -2630,7 +2634,7 @@ TEST_F(CCLayerTreeHostImplTest, layersFreeTextures) // Lose the context, replacing it with a TrackingWebGraphicsContext3D (which the CCLayerTreeHostImpl takes ownership of). OwnPtr<CCGraphicsContext> ccContext(FakeWebCompositorOutputSurface::create(adoptPtr(new TrackingWebGraphicsContext3D))); TrackingWebGraphicsContext3D* trackingWebGraphicsContext = static_cast<TrackingWebGraphicsContext3D*>(ccContext->context3D()); - m_hostImpl->initializeLayerRenderer(ccContext.release(), UnthrottledUploader); + m_hostImpl->initializeRenderer(ccContext.release(), UnthrottledUploader); m_hostImpl->setRootLayer(rootLayer.release()); @@ -2702,7 +2706,7 @@ static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl, { OwnPtr<CCGraphicsContext> context = FakeWebCompositorOutputSurface::create(adoptPtr(new PartialSwapContext)); - layerTreeHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + layerTreeHostImpl->initializeRenderer(context.release(), UnthrottledUploader); layerTreeHostImpl->setViewportSize(rootSize, rootSize); OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); @@ -2728,9 +2732,9 @@ static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl, addDrawingLayerTo(surfaceLayerPtr, 4, IntRect(5, 5, rootSize.width() - 25, rootSize.height() - 25), &childPtr); } -class LayerRendererChromiumWithReleaseTextures : public LayerRendererChromium { +class CCRendererGLWithReleaseTextures : public CCRendererGL { public: - using LayerRendererChromium::releaseRenderPassTextures; + using CCRendererGL::releaseRenderPassTextures; }; TEST_F(CCLayerTreeHostImplTest, textureCachingWithClipping) @@ -2748,7 +2752,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithClipping) IntSize rootSize(100, 100); - myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + myHostImpl->initializeRenderer(context.release(), UnthrottledUploader); myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height())); OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); @@ -2860,7 +2864,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusion) IntSize rootSize(1000, 1000); - myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + myHostImpl->initializeRenderer(context.release(), UnthrottledUploader); myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height())); OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); @@ -2973,7 +2977,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut) IntSize rootSize(1000, 1000); - myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + myHostImpl->initializeRenderer(context.release(), UnthrottledUploader); myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height())); OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); @@ -3087,7 +3091,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal) IntSize rootSize(1000, 1000); - myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + myHostImpl->initializeRenderer(context.release(), UnthrottledUploader); myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height())); OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); @@ -3170,7 +3174,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned) IntSize rootSize(1000, 1000); - myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + myHostImpl->initializeRenderer(context.release(), UnthrottledUploader); myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height())); OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); @@ -3255,7 +3259,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap) IntSize rootSize(1000, 1000); - myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + myHostImpl->initializeRenderer(context.release(), UnthrottledUploader); myHostImpl->setViewportSize(IntSize(rootSize.width(), rootSize.height()), IntSize(rootSize.width(), rootSize.height())); OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); @@ -3373,7 +3377,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor) IntRect grandChildRect(5, 5, 150, 150); OwnPtr<CCGraphicsContext> context = FakeWebCompositorOutputSurface::create(adoptPtr(new PartialSwapContext)); - myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + myHostImpl->initializeRenderer(context.release(), UnthrottledUploader); root->setAnchorPoint(FloatPoint(0, 0)); root->setPosition(FloatPoint(rootRect.x(), rootRect.y())); @@ -3408,7 +3412,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor) myHostImpl->setRootLayer(root.release()); myHostImpl->setViewportSize(rootRect.size(), rootRect.size()); - EXPECT_FALSE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(childPtr->id())); + EXPECT_FALSE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPtr->id())); { CCLayerTreeHostImpl::FrameData frame; @@ -3418,7 +3422,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor) } // We should have cached textures for surface 2. - EXPECT_TRUE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(childPtr->id())); + EXPECT_TRUE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPtr->id())); { CCLayerTreeHostImpl::FrameData frame; @@ -3428,7 +3432,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor) } // We should still have cached textures for surface 2 after drawing with no damage. - EXPECT_TRUE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(childPtr->id())); + EXPECT_TRUE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPtr->id())); // Damage a single tile of surface 2. childPtr->setUpdateRect(IntRect(10, 10, 10, 10)); @@ -3441,7 +3445,7 @@ TEST_F(CCLayerTreeHostImplTest, textureCachingWithScissor) } // We should have a cached texture for surface 2 again even though it was damaged. - EXPECT_TRUE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(childPtr->id())); + EXPECT_TRUE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(childPtr->id())); } TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) @@ -3537,7 +3541,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) // Change opacity again, and evict the cached surface texture. surfaceLayerPtr->setOpacity(0.5f); - static_cast<LayerRendererChromiumWithReleaseTextures*>(myHostImpl->layerRenderer())->releaseRenderPassTextures(); + static_cast<CCRendererGLWithReleaseTextures*>(myHostImpl->renderer())->releaseRenderPassTextures(); // Change opacity and draw surfaceLayerPtr->setOpacity(0.6f); @@ -3559,7 +3563,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) EXPECT_TRUE(targetPass->damageRect().isEmpty()); // Was our surface evicted? - EXPECT_FALSE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(targetPass->id())); + EXPECT_FALSE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(targetPass->id())); myHostImpl->drawLayers(frame); myHostImpl->didDrawAllLayers(frame); @@ -3703,7 +3707,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap) // Change opacity again, and evict the cached surface texture. surfaceLayerPtr->setOpacity(0.5f); - static_cast<LayerRendererChromiumWithReleaseTextures*>(myHostImpl->layerRenderer())->releaseRenderPassTextures(); + static_cast<CCRendererGLWithReleaseTextures*>(myHostImpl->renderer())->releaseRenderPassTextures(); // Change opacity and draw surfaceLayerPtr->setOpacity(0.6f); @@ -3725,7 +3729,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap) EXPECT_TRUE(targetPass->damageRect().isEmpty()); // Was our surface evicted? - EXPECT_FALSE(myHostImpl->layerRenderer()->haveCachedResourcesForRenderPassId(targetPass->id())); + EXPECT_FALSE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(targetPass->id())); myHostImpl->drawLayers(frame); myHostImpl->didDrawAllLayers(frame); @@ -3804,22 +3808,20 @@ struct RenderPassCacheEntry { struct RenderPassRemovalTestData : public CCLayerTreeHostImpl::FrameData { std::map<char, RenderPassCacheEntry> renderPassCache; - Vector<OwnPtr<CCRenderSurface> > renderSurfaceStore; - Vector<OwnPtr<CCLayerImpl> > layerStore; OwnPtr<CCSharedQuadState> sharedQuadState; }; class CCTestRenderPass: public CCRenderPass { public: - static PassOwnPtr<CCRenderPass> create(CCRenderSurface* renderSurface, int id) { return adoptPtr(new CCTestRenderPass(renderSurface, id)); } + static PassOwnPtr<CCRenderPass> create(int id, IntRect outputRect, const WebTransformationMatrix& rootTransform) { return adoptPtr(new CCTestRenderPass(id, outputRect, rootTransform)); } void appendQuad(PassOwnPtr<CCDrawQuad> quad) { m_quadList.append(quad); } protected: - CCTestRenderPass(CCRenderSurface* renderSurface, int id) : CCRenderPass(renderSurface, id) { } + CCTestRenderPass(int id, IntRect outputRect, const WebTransformationMatrix& rootTransform) : CCRenderPass(id, outputRect, rootTransform) { } }; -class CCTestRenderer : public LayerRendererChromium, public CCRendererClient { +class CCTestRenderer : public CCRendererGL, public CCRendererClient { public: static PassOwnPtr<CCTestRenderer> create(CCResourceProvider* resourceProvider) { @@ -3845,7 +3847,7 @@ public: virtual void setMemoryAllocationLimitBytes(size_t) OVERRIDE { } protected: - CCTestRenderer(CCResourceProvider* resourceProvider) : LayerRendererChromium(this, resourceProvider, UnthrottledUploader) { } + CCTestRenderer(CCResourceProvider* resourceProvider) : CCRendererGL(this, resourceProvider, UnthrottledUploader) { } private: CCLayerTreeSettings m_settings; @@ -3853,29 +3855,18 @@ private: HashSet<int> m_textures; }; -static PassOwnPtr<CCRenderPass> createDummyRenderPass(RenderPassRemovalTestData& testData, int id) -{ - OwnPtr<CCLayerImpl> layerImpl(CCLayerImpl::create(id)); - OwnPtr<CCRenderSurface> renderSurface(adoptPtr(new CCRenderSurface(layerImpl.get()))); - OwnPtr<CCRenderPass> renderPassPtr(CCTestRenderPass::create(renderSurface.get(), layerImpl->id())); - - testData.renderSurfaceStore.append(renderSurface.release()); - testData.layerStore.append(layerImpl.release()); - return renderPassPtr.release(); -} - static void configureRenderPassTestData(const char* testScript, RenderPassRemovalTestData& testData, CCTestRenderer* renderer) { renderer->clearCachedTextures(); // One shared state for all quads - we don't need the correct details - testData.sharedQuadState = CCSharedQuadState::create(0, WebTransformationMatrix(), IntRect(), IntRect(), 1.0, true); + testData.sharedQuadState = CCSharedQuadState::create(WebTransformationMatrix(), IntRect(), IntRect(), 1.0, true); const char* currentChar = testScript; // Pre-create root pass char rootRenderPassId = testScript[0]; - OwnPtr<CCRenderPass> rootRenderPass = createDummyRenderPass(testData, rootRenderPassId); + OwnPtr<CCRenderPass> rootRenderPass = CCTestRenderPass::create(rootRenderPassId, IntRect(), WebTransformationMatrix()); testData.renderPassCache.insert(std::pair<char, RenderPassCacheEntry>(rootRenderPassId, RenderPassCacheEntry(rootRenderPass.release()))); while (*currentChar) { char renderPassId = currentChar[0]; @@ -3926,7 +3917,7 @@ static void configureRenderPassTestData(const char* testScript, RenderPassRemova if (hasTexture) renderer->setHaveCachedResourcesForRenderPassId(newRenderPassId); - OwnPtr<CCRenderPass> renderPass = createDummyRenderPass(testData, newRenderPassId); + OwnPtr<CCRenderPass> renderPass = CCTestRenderPass::create(newRenderPassId, IntRect(), WebTransformationMatrix()); testData.renderPassCache.insert(std::pair<char, RenderPassCacheEntry>(newRenderPassId, RenderPassCacheEntry(renderPass.release()))); } diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp index 5202208b9..c026bd4f5 100644 --- a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp +++ b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp @@ -30,6 +30,7 @@ #include "CCLayerTreeHostImpl.h" #include "CCOcclusionTrackerTestCommon.h" #include "CCSettings.h" +#include "CCSingleThreadProxy.h" #include "CCTextureUpdateQueue.h" #include "CCThreadedTest.h" #include "CCTimingFunction.h" @@ -61,7 +62,7 @@ class CCLayerTreeHostTestShortlived1 : public CCLayerTreeHostTest { public: CCLayerTreeHostTestShortlived1() { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { // Kill the layerTreeHost immediately. m_layerTreeHost->setRootLayer(0); @@ -70,7 +71,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -80,7 +81,7 @@ class CCLayerTreeHostTestShortlived2 : public CCLayerTreeHostTest { public: CCLayerTreeHostTestShortlived2() { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsCommitToMainThread(); @@ -91,7 +92,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -103,7 +104,7 @@ class CCLayerTreeHostTestShortlived3 : public CCLayerTreeHostTest { public: CCLayerTreeHostTestShortlived3() { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsRedrawToMainThread(); @@ -114,7 +115,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -130,19 +131,19 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsCommitToMainThread(); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { m_numCompleteCommits++; if (m_numCompleteCommits == 2) endTest(); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl*) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { if (m_numDraws == 1) postSetNeedsCommitToMainThread(); @@ -150,7 +151,7 @@ public: postSetNeedsRedrawToMainThread(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -174,25 +175,25 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsCommitToMainThread(); postSetNeedsCommitToMainThread(); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { m_numDraws++; if (!impl->sourceFrameNumber()) endTest(); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { m_numCommits++; } - virtual void afterTest() + virtual void afterTest() OVERRIDE { EXPECT_GE(1, m_numCommits); EXPECT_GE(1, m_numDraws); @@ -218,12 +219,12 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsCommitToMainThread(); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { if (!impl->sourceFrameNumber()) postSetNeedsCommitToMainThread(); @@ -231,12 +232,12 @@ public: endTest(); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { m_numCommits++; } - virtual void afterTest() + virtual void afterTest() OVERRIDE { EXPECT_EQ(2, m_numCommits); EXPECT_GE(2, m_numDraws); @@ -267,12 +268,12 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsCommitToMainThread(); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { EXPECT_EQ(0, impl->sourceFrameNumber()); if (!m_numDraws) @@ -282,13 +283,13 @@ public: m_numDraws++; } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { EXPECT_EQ(0, m_numDraws); m_numCommits++; } - virtual void afterTest() + virtual void afterTest() OVERRIDE { EXPECT_GE(2, m_numDraws); EXPECT_EQ(1, m_numCommits); @@ -312,19 +313,19 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsCommitToMainThread(); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { // Only the initial draw should bring us here. EXPECT_TRUE(impl->canDraw()); EXPECT_EQ(0, impl->sourceFrameNumber()); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { if (m_numCommits >= 1) { // After the first commit, we should not be able to draw. @@ -332,7 +333,7 @@ public: } } - virtual void didCommit() + virtual void didCommit() OVERRIDE { m_numCommits++; if (m_numCommits == 1) { @@ -348,7 +349,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -367,26 +368,26 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postAcquireLayerTextures(); postSetNeedsRedrawToMainThread(); // should be inhibited without blocking postSetNeedsCommitToMainThread(); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { m_numDraws++; EXPECT_EQ(m_numDraws, m_numCommits); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { m_numCommits++; endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { EXPECT_EQ(1, m_numCommits); } @@ -413,12 +414,12 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsCommitToMainThread(); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { m_numCommits++; if (m_numCommits == 2) @@ -431,7 +432,7 @@ public: } } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -452,11 +453,11 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { } - virtual void didCommitAndDrawFrame() + virtual void didCommitAndDrawFrame() OVERRIDE { m_numCommits++; if (m_numCommits == 1) { @@ -470,7 +471,7 @@ public: } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -489,7 +490,7 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { // Request a commit (from the main thread), which will trigger the commit flow from the impl side. m_layerTreeHost->setNeedsCommit(); @@ -505,7 +506,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -530,12 +531,12 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsAnimateToMainThread(); } - virtual void updateAnimations(double) + virtual void updateAnimations(double) OVERRIDE { if (!m_numAnimates) { m_layerTreeHost->setNeedsAnimate(); @@ -545,7 +546,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -570,12 +571,12 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postAddInstantAnimationToMainThread(); } - virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) + virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE { if (!m_numAnimates) { // The animation had zero duration so layerTreeHostImpl should no @@ -592,13 +593,13 @@ public: endTest(); } - virtual void notifyAnimationStarted(double wallClockTime) + virtual void notifyAnimationStarted(double wallClockTime) OVERRIDE { m_receivedAnimationStartedNotification = true; m_startTime = wallClockTime; } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -623,27 +624,27 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postAddAnimationToMainThread(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } - virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) + virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE { m_startedAnimating = true; } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl*) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { if (m_startedAnimating) endTest(); } - virtual bool prepareToDrawOnCCThread(CCLayerTreeHostImpl*) + virtual bool prepareToDrawOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { return false; } @@ -666,7 +667,7 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postAddAnimationToMainThread(); } @@ -674,7 +675,7 @@ public: // Use willAnimateLayers to set visible false before the animation runs and // causes a commit, so we block the second visible animate in single-thread // mode. - virtual void willAnimateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) + virtual void willAnimateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE { if (m_numAnimates < 2) { if (!m_numAnimates) { @@ -687,7 +688,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -704,12 +705,12 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postAddAnimationToMainThread(); } - virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) + virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE { const CCActiveAnimation* animation = m_layerTreeHost->rootLayer()->layerAnimationController()->getActiveAnimation(0, CCActiveAnimation::Opacity); if (!animation) @@ -726,7 +727,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -742,7 +743,7 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->rootLayer()->setDrawOpacity(1); m_layerTreeHost->setViewportSize(IntSize(10, 10), IntSize(10, 10)); @@ -750,7 +751,7 @@ public: postAddAnimationToMainThread(); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { // If the subtree was skipped when preparing to draw, the layer's draw opacity // will not have been updated. It should be set to 0 due to the animation. @@ -759,7 +760,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -782,18 +783,18 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postAddAnimationToMainThread(); } // This is guaranteed to be called before CCLayerTreeHostImpl::animateLayers. - virtual void willAnimateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) + virtual void willAnimateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) OVERRIDE { m_layerTreeHostImpl = layerTreeHostImpl; } - virtual void notifyAnimationStarted(double time) + virtual void notifyAnimationStarted(double time) OVERRIDE { EXPECT_TRUE(m_layerTreeHostImpl); @@ -807,7 +808,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -824,17 +825,17 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postAddInstantAnimationToMainThread(); } - virtual void notifyAnimationFinished(double time) + virtual void notifyAnimationFinished(double time) OVERRIDE { endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -853,14 +854,14 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->rootLayer()->setScrollable(true); m_layerTreeHost->rootLayer()->setScrollPosition(m_initialScroll); postSetNeedsCommitToMainThread(); } - virtual void layout() + virtual void layout() OVERRIDE { LayerChromium* root = m_layerTreeHost->rootLayer(); if (!m_layerTreeHost->commitNumber()) @@ -873,7 +874,7 @@ public: } } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { CCLayerImpl* root = impl->rootLayer(); EXPECT_EQ(root->scrollDelta(), IntSize()); @@ -893,14 +894,14 @@ public: } } - virtual void applyScrollAndScale(const IntSize& scrollDelta, float scale) + virtual void applyScrollAndScale(const IntSize& scrollDelta, float scale) OVERRIDE { IntPoint position = m_layerTreeHost->rootLayer()->scrollPosition(); m_layerTreeHost->rootLayer()->setScrollPosition(position + scrollDelta); m_scrolls++; } - virtual void afterTest() + virtual void afterTest() OVERRIDE { EXPECT_EQ(1, m_scrolls); } @@ -925,14 +926,14 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->rootLayer()->setScrollable(true); m_layerTreeHost->rootLayer()->setScrollPosition(m_initialScroll); postSetNeedsCommitToMainThread(); } - virtual void beginCommitOnCCThread(CCLayerTreeHostImpl* impl) + virtual void beginCommitOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { LayerChromium* root = m_layerTreeHost->rootLayer(); if (!impl->sourceFrameNumber()) @@ -943,7 +944,7 @@ public: EXPECT_EQ(root->scrollPosition(), m_initialScroll + m_scrollAmount + m_scrollAmount); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { CCLayerImpl* root = impl->rootLayer(); root->setScrollable(true); @@ -974,14 +975,14 @@ public: } } - virtual void applyScrollAndScale(const IntSize& scrollDelta, float scale) + virtual void applyScrollAndScale(const IntSize& scrollDelta, float scale) OVERRIDE { IntPoint position = m_layerTreeHost->rootLayer()->scrollPosition(); m_layerTreeHost->rootLayer()->setScrollPosition(position + scrollDelta); m_scrolls++; } - virtual void afterTest() + virtual void afterTest() OVERRIDE { EXPECT_EQ(1, m_scrolls); } @@ -1002,7 +1003,7 @@ public: CCLayerTreeHostTestCommit() { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->setViewportSize(IntSize(20, 20), IntSize(20, 20)); m_layerTreeHost->setBackgroundColor(SK_ColorGRAY); @@ -1011,7 +1012,7 @@ public: postSetNeedsCommitToMainThread(); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { EXPECT_EQ(IntSize(20, 20), impl->layoutViewportSize()); EXPECT_EQ(SK_ColorGRAY, impl->backgroundColor()); @@ -1020,7 +1021,7 @@ public: endTest(); } - virtual void afterTest() { } + virtual void afterTest() OVERRIDE { } }; TEST_F(CCLayerTreeHostTestCommit, runTest) @@ -1038,7 +1039,7 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->rootLayer()->setScrollable(true); m_layerTreeHost->rootLayer()->setScrollPosition(IntPoint()); @@ -1052,7 +1053,7 @@ public: test->layerTreeHost()->startPageScaleAnimation(IntSize(), false, 1.25, 0); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { impl->rootLayer()->setScrollable(true); impl->rootLayer()->setScrollPosition(IntPoint()); @@ -1065,14 +1066,14 @@ public: } } - virtual void applyScrollAndScale(const IntSize& scrollDelta, float scale) + virtual void applyScrollAndScale(const IntSize& scrollDelta, float scale) OVERRIDE { IntPoint position = m_layerTreeHost->rootLayer()->scrollPosition(); m_layerTreeHost->rootLayer()->setScrollPosition(position + scrollDelta); m_layerTreeHost->setPageScaleFactorAndLimits(scale, 0.5, 2); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { impl->processScrollDeltas(); // We get one commit before the first draw, and the animation doesn't happen until the second draw. @@ -1083,7 +1084,7 @@ public: postSetNeedsRedrawToMainThread(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -1104,21 +1105,21 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetVisibleToMainThread(false); postSetNeedsRedrawToMainThread(); // This is suppressed while we're invisible. postSetVisibleToMainThread(true); // Triggers the redraw. } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { EXPECT_TRUE(impl->visible()); ++m_numDraws; endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { EXPECT_EQ(1, m_numDraws); } @@ -1145,8 +1146,6 @@ public: m_test->layerTreeHost()->rootLayer()->setOpacity(0); } - virtual bool preserves3D() { return false; } - private: CCLayerTreeHostTest* m_test; }; @@ -1186,7 +1185,7 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->setRootLayer(m_updateCheckLayer); m_layerTreeHost->setViewportSize(IntSize(10, 10), IntSize(10, 10)); @@ -1194,12 +1193,12 @@ public: postSetNeedsCommitToMainThread(); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl*) OVERRIDE { endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { // update() should have been called once. EXPECT_EQ(1, m_updateCheckLayer->paintContentsCount()); @@ -1235,7 +1234,7 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->setViewportSize(IntSize(40, 40), IntSize(60, 60)); m_layerTreeHost->setDeviceScaleFactor(1.5); @@ -1256,7 +1255,7 @@ public: m_layerTreeHost->setRootLayer(m_rootLayer); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { // Get access to protected methods. MockLayerTreeHostImpl* mockImpl = static_cast<MockLayerTreeHostImpl*>(impl); @@ -1314,7 +1313,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { m_rootLayer.clear(); m_childLayer.clear(); @@ -1341,7 +1340,7 @@ public: m_settings.maxPartialTextureUpdates = 0; } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->setRootLayer(m_layer); m_layerTreeHost->setViewportSize(IntSize(10, 10), IntSize(10, 10)); @@ -1350,7 +1349,7 @@ public: postSetNeedsRedrawToMainThread(); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->context()->context3D()); @@ -1384,7 +1383,7 @@ public: } } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->context()->context3D()); @@ -1399,12 +1398,12 @@ public: endTest(); } - virtual void layout() + virtual void layout() OVERRIDE { m_layer->setNeedsDisplay(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -1441,7 +1440,7 @@ public: m_settings.maxPartialTextureUpdates = 1; } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->setRootLayer(m_parent); m_layerTreeHost->setViewportSize(IntSize(10, 20), IntSize(10, 20)); @@ -1454,7 +1453,7 @@ public: postSetNeedsRedrawToMainThread(); } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->context()->context3D()); @@ -1506,7 +1505,7 @@ public: } } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { CompositorFakeWebGraphicsContext3DWithTextureTracking* context = static_cast<CompositorFakeWebGraphicsContext3DWithTextureTracking*>(impl->context()->context3D()); @@ -1525,7 +1524,7 @@ public: endTest(); } - virtual void layout() + virtual void layout() OVERRIDE { switch (m_numCommits++) { case 0: @@ -1551,7 +1550,7 @@ public: } } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -1599,7 +1598,7 @@ class CCLayerTreeHostTestLayerOcclusion : public CCLayerTreeHostTest { public: CCLayerTreeHostTestLayerOcclusion() { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { RefPtr<TestLayerChromium> rootLayer = TestLayerChromium::create(); RefPtr<TestLayerChromium> child = TestLayerChromium::create(); @@ -1625,7 +1624,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds(), rootLayer->bounds()); - ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); + ASSERT_TRUE(m_layerTreeHost->initializeRendererIfNeeded()); CCTextureUpdateQueue queue; m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); @@ -1791,7 +1790,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -1802,7 +1801,7 @@ class CCLayerTreeHostTestLayerOcclusionWithFilters : public CCLayerTreeHostTest public: CCLayerTreeHostTestLayerOcclusionWithFilters() { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { RefPtr<TestLayerChromium> rootLayer = TestLayerChromium::create(); RefPtr<TestLayerChromium> child = TestLayerChromium::create(); @@ -1833,7 +1832,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds(), rootLayer->bounds()); - ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); + ASSERT_TRUE(m_layerTreeHost->initializeRendererIfNeeded()); CCTextureUpdateQueue queue; m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); @@ -1882,7 +1881,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -1893,7 +1892,7 @@ class CCLayerTreeHostTestManySurfaces : public CCLayerTreeHostTest { public: CCLayerTreeHostTestManySurfaces() { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { // We create enough RenderSurfaces that it will trigger Vector reallocation while computing occlusion. Region occluded; @@ -1922,7 +1921,7 @@ public: m_layerTreeHost->setRootLayer(layers[0].get()); m_layerTreeHost->setViewportSize(layers[0]->bounds(), layers[0]->bounds()); - ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); + ASSERT_TRUE(m_layerTreeHost->initializeRendererIfNeeded()); CCTextureUpdateQueue queue; m_layerTreeHost->updateLayers(queue, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); @@ -1941,7 +1940,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -1955,23 +1954,23 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsCommitToMainThread(); } - virtual void didCommitAndDrawFrame() + virtual void didCommitAndDrawFrame() OVERRIDE { m_layerTreeHost->loseContext(1); } - virtual void didRecreateOutputSurface(bool succeeded) + virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE { EXPECT_TRUE(succeeded); endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -1989,24 +1988,24 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { postSetNeedsCommitToMainThread(); } - virtual void didCommitAndDrawFrame() + virtual void didCommitAndDrawFrame() OVERRIDE { m_layerTreeHost->loseContext(10); } - virtual void didRecreateOutputSurface(bool succeeded) + virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE { EXPECT_FALSE(succeeded); m_layerTreeHost->finishAllRendering(); endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -2023,13 +2022,13 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->rootLayer()->setScrollable(true); postSetNeedsCommitToMainThread(); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { CCLayerImpl* root = impl->rootLayer(); root->setMaxScrollPosition(IntSize(100, 100)); @@ -2051,13 +2050,13 @@ public: root->scrollBy(m_scrollAmount); } - virtual void applyScrollAndScale(const IntSize& scrollDelta, float scale) + virtual void applyScrollAndScale(const IntSize& scrollDelta, float scale) OVERRIDE { IntPoint position = m_layerTreeHost->rootLayer()->scrollPosition(); m_layerTreeHost->rootLayer()->setScrollPosition(position + scrollDelta); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } private: @@ -2078,12 +2077,12 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->setNeedsRedraw(); } - virtual void didCommitAndDrawFrame() + virtual void didCommitAndDrawFrame() OVERRIDE { if (m_once) return; @@ -2102,13 +2101,13 @@ public: endTest(); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { Locker<Mutex> lock(m_mutex); ++m_drawCount; } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } private: @@ -2129,7 +2128,7 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { EXPECT_FALSE(m_addedAnimation); @@ -2148,12 +2147,12 @@ public: endTest(); } - virtual void didAddAnimation() + virtual void didAddAnimation() OVERRIDE { m_addedAnimation = true; } - virtual void afterTest() { } + virtual void afterTest() OVERRIDE { } private: bool m_addedAnimation; @@ -2249,7 +2248,7 @@ class CCLayerTreeHostTestCompositeAndReadbackCleanup : public CCLayerTreeHostTes public: CCLayerTreeHostTestCompositeAndReadbackCleanup() { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { LayerChromium* rootLayer = m_layerTreeHost->rootLayer(); @@ -2260,7 +2259,7 @@ public: endTest(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } }; @@ -2278,7 +2277,7 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->setViewportSize(IntSize(100, 100), IntSize(100, 100)); @@ -2298,9 +2297,9 @@ public: m_layerTreeHost->setRootLayer(m_rootLayer); } - virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* hostImpl) + virtual void drawLayersOnCCThread(CCLayerTreeHostImpl* hostImpl) OVERRIDE { - CCRenderer* renderer = hostImpl->layerRenderer(); + CCRenderer* renderer = hostImpl->renderer(); unsigned surface1RenderPassId = hostImpl->rootLayer()->children()[0]->id(); unsigned surface2RenderPassId = hostImpl->rootLayer()->children()[0]->children()[0]->id(); @@ -2322,7 +2321,7 @@ public: } } - virtual void afterTest() + virtual void afterTest() OVERRIDE { EXPECT_EQ(2, m_rootLayer->paintContentsCount()); EXPECT_EQ(2, m_surfaceLayer1->paintContentsCount()); @@ -2409,7 +2408,7 @@ public: return adoptPtr(new EvictionTestLayerImpl(id)); } virtual ~EvictionTestLayerImpl() { } - virtual void appendQuads(CCQuadSink&, const CCSharedQuadState*, bool& hadMissingTiles) + virtual void appendQuads(CCQuadSink&, bool& hadMissingTiles) OVERRIDE { ASSERT_TRUE(m_hasTexture); ASSERT_NE(0u, layerTreeHostImpl()->resourceProvider()->numResources()); @@ -2464,7 +2463,7 @@ public: { } - virtual void beginTest() + virtual void beginTest() OVERRIDE { m_layerTreeHost->setRootLayer(m_layer); m_layerTreeHost->setViewportSize(IntSize(10, 20), IntSize(10, 20)); @@ -2477,7 +2476,7 @@ public: public: EvictTexturesTask(CCLayerTreeHostTestEvictTextures* test) : m_test(test) { } virtual ~EvictTexturesTask() { } - virtual void run() + virtual void run() OVERRIDE { ASSERT(m_test->m_implForEvictTextures); m_test->m_implForEvictTextures->releaseContentsTextures(); @@ -2515,7 +2514,7 @@ public: // the beginFrame/commit pair. // Commits 5+6 test the path where an eviction happens during the eviction // recovery path. - virtual void didCommitAndDrawFrame() + virtual void didCommitAndDrawFrame() OVERRIDE { switch (m_numCommits) { case 1: @@ -2544,12 +2543,12 @@ public: } } - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE { m_implForEvictTextures = impl; } - virtual void layout() + virtual void layout() OVERRIDE { ++m_numCommits; switch (m_numCommits) { @@ -2578,7 +2577,7 @@ public: m_layer->resetUpdated(); } - virtual void afterTest() + virtual void afterTest() OVERRIDE { } @@ -2594,4 +2593,97 @@ TEST_F(CCLayerTreeHostTestEvictTextures, runMultiThread) runTest(true); } +class CCLayerTreeHostTestLostContextAfterEvictTextures : public CCLayerTreeHostTest { +public: + CCLayerTreeHostTestLostContextAfterEvictTextures() + : m_layer(EvictionTestLayer::create()) + , m_implForEvictTextures(0) + , m_numCommits(0) + { + } + + virtual void beginTest() OVERRIDE + { + m_layerTreeHost->setRootLayer(m_layer); + m_layerTreeHost->setViewportSize(IntSize(10, 20), IntSize(10, 20)); + + WebTransformationMatrix identityMatrix; + setLayerPropertiesForTesting(m_layer.get(), 0, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(10, 20), true); + } + + class EvictTexturesTask : public WebKit::WebThread::Task { + public: + EvictTexturesTask(CCLayerTreeHostTestLostContextAfterEvictTextures* test) : m_test(test) { } + virtual ~EvictTexturesTask() { } + virtual void run() OVERRIDE + { + m_test->evictTexturesOnImplThread(); + } + + private: + CCLayerTreeHostTestLostContextAfterEvictTextures* m_test; + }; + + void postEvictTextures() + { + if (webThread()) + webThread()->postTask(new EvictTexturesTask(this)); + else { + DebugScopedSetImplThread impl; + evictTexturesOnImplThread(); + } + } + + void evictTexturesOnImplThread() + { + ASSERT(m_implForEvictTextures); + m_implForEvictTextures->releaseContentsTextures(); + } + + // Commit 1: Just commit and draw normally, then at the end, set ourselves + // invisible (to prevent a commit that would recreate textures after + // eviction, before the context recovery), and post a task that will evict + // textures, then cause the context to be lost, and then set ourselves + // visible again (to allow commits, since that's what causes context + // recovery in single thread). + virtual void didCommitAndDrawFrame() OVERRIDE + { + ++m_numCommits; + switch (m_numCommits) { + case 1: + EXPECT_TRUE(m_layer->updated()); + m_layerTreeHost->setVisible(false); + postEvictTextures(); + m_layerTreeHost->loseContext(1); + m_layerTreeHost->setVisible(true); + break; + default: + break; + } + } + + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) OVERRIDE + { + m_implForEvictTextures = impl; + } + + virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE + { + EXPECT_TRUE(succeeded); + endTest(); + } + + virtual void afterTest() OVERRIDE + { + } + +private: + MockContentLayerDelegate m_delegate; + RefPtr<EvictionTestLayer> m_layer; + CCLayerTreeHostImpl* m_implForEvictTextures; + int m_numCommits; +}; + +SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestLostContextAfterEvictTextures) + } // namespace diff --git a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp index f732cdc68..2c5e8859c 100644 --- a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp +++ b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp @@ -96,14 +96,12 @@ static PassOwnPtr<CCTiledLayerImpl> makeLayer(CCTiledLayerImpl* parent, const We return layer.release(); } -static void appendQuads(CCQuadList& quadList, Vector<OwnPtr<CCSharedQuadState> >& sharedStateList, CCTiledLayerImpl* layer, CCLayerIteratorType& it, CCOcclusionTrackerImpl& occlusionTracker) +static void appendQuads(CCQuadList& quadList, CCSharedQuadStateList& sharedStateList, CCTiledLayerImpl* layer, CCLayerIteratorType& it, CCOcclusionTrackerImpl& occlusionTracker) { occlusionTracker.enterLayer(it); - CCQuadCuller quadCuller(quadList, layer, &occlusionTracker, false, false); - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); + CCQuadCuller quadCuller(quadList, sharedStateList, layer, &occlusionTracker, false, false); bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); - sharedStateList.append(sharedQuadState.release()); + layer->appendQuads(quadCuller, hadMissingTiles); occlusionTracker.leaveLayer(it); ++it; } @@ -111,9 +109,9 @@ static void appendQuads(CCQuadList& quadList, Vector<OwnPtr<CCSharedQuadState> > #define DECLARE_AND_INITIALIZE_TEST_QUADS \ DebugScopedSetImplThread impl; \ CCQuadList quadList; \ - Vector<OwnPtr<CCSharedQuadState> > sharedStateList; \ + CCSharedQuadStateList sharedStateList; \ Vector<CCLayerImpl*> renderSurfaceLayerList; \ - WebTransformationMatrix childTransform; \ + WebTransformationMatrix childTransform; \ IntSize rootSize = IntSize(300, 300); \ IntRect rootRect = IntRect(IntPoint(), rootSize); \ IntSize childSize = IntSize(200, 200); \ diff --git a/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp b/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp index a6a422e32..05d716641 100644 --- a/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp +++ b/Source/WebKit/chromium/tests/CCRenderSurfaceTest.cpp @@ -29,6 +29,7 @@ #include "CCLayerImpl.h" #include "CCSharedQuadState.h" #include "CCSingleThreadProxy.h" +#include "MockCCQuadCuller.h" #include <gmock/gmock.h> #include <gtest/gtest.h> #include <public/WebTransformationMatrix.h> @@ -115,7 +116,15 @@ TEST(CCRenderSurfaceTest, sanityCheckSurfaceCreatesCorrectSharedQuadState) renderSurface->setClipRect(clipRect); renderSurface->setDrawOpacity(1); - OwnPtr<CCSharedQuadState> sharedQuadState = renderSurface->createSharedQuadState(0); + CCQuadList quadList; + CCSharedQuadStateList sharedStateList; + MockCCQuadCuller mockQuadCuller(quadList, sharedStateList); + + bool forReplica = false; + renderSurface->appendQuads(mockQuadCuller, forReplica, 1); + + ASSERT_EQ(1u, sharedStateList.size()); + CCSharedQuadState* sharedQuadState = sharedStateList[0].get(); EXPECT_EQ(30, sharedQuadState->quadTransform.m41()); EXPECT_EQ(40, sharedQuadState->quadTransform.m42()); diff --git a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp b/Source/WebKit/chromium/tests/CCRendererGLTest.cpp index 36eddc534..2f3fd6a08 100644 --- a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/CCRendererGLTest.cpp @@ -23,7 +23,7 @@ */ #include "config.h" -#include "LayerRendererChromium.h" +#include "CCRendererGL.h" #include "CCDrawQuad.h" #include "CCPrioritizedTextureManager.h" @@ -36,6 +36,7 @@ #include <gmock/gmock.h> #include <gtest/gtest.h> #include <public/WebCompositor.h> +#include <public/WebTransformationMatrix.h> using namespace WebCore; using namespace WebKit; @@ -79,8 +80,7 @@ public: , m_rootLayer(CCLayerImpl::create(1)) , m_memoryAllocationLimitBytes(CCPrioritizedTextureManager::defaultMemoryAllocationLimit()) { - m_rootLayer->createRenderSurface(); - OwnPtr<CCRenderPass> rootRenderPass = CCRenderPass::create(m_rootLayer->renderSurface(), m_rootLayer->id()); + OwnPtr<CCRenderPass> rootRenderPass = CCRenderPass::create(m_rootLayer->id(), IntRect(), WebTransformationMatrix()); m_renderPassesInDrawOrder.append(rootRenderPass.get()); m_renderPasses.set(m_rootLayer->id(), rootRenderPass.release()); } @@ -112,32 +112,32 @@ private: size_t m_memoryAllocationLimitBytes; }; -class FakeLayerRendererChromium : public LayerRendererChromium { +class FakeCCRendererGL : public CCRendererGL { public: - FakeLayerRendererChromium(CCRendererClient* client, CCResourceProvider* resourceProvider) : LayerRendererChromium(client, resourceProvider, UnthrottledUploader) { } + FakeCCRendererGL(CCRendererClient* client, CCResourceProvider* resourceProvider) : CCRendererGL(client, resourceProvider, UnthrottledUploader) { } - // LayerRendererChromium methods. + // CCRendererGL methods. // Changing visibility to public. - using LayerRendererChromium::initialize; - using LayerRendererChromium::isFramebufferDiscarded; + using CCRendererGL::initialize; + using CCRendererGL::isFramebufferDiscarded; }; -class LayerRendererChromiumTest : public testing::Test { +class CCRendererGLTest : public testing::Test { protected: - LayerRendererChromiumTest() + CCRendererGLTest() : m_suggestHaveBackbufferYes(1, true) , m_suggestHaveBackbufferNo(1, false) , m_context(FakeWebCompositorOutputSurface::create(adoptPtr(new FrameCountingMemoryAllocationSettingContext()))) , m_resourceProvider(CCResourceProvider::create(m_context.get())) - , m_layerRendererChromium(&m_mockClient, m_resourceProvider.get()) + , m_renderer(&m_mockClient, m_resourceProvider.get()) { } virtual void SetUp() { WebKit::WebCompositor::initialize(0); - m_layerRendererChromium.initialize(); + m_renderer.initialize(); } virtual void TearDown() @@ -147,7 +147,7 @@ protected: void swapBuffers() { - m_layerRendererChromium.swapBuffers(); + m_renderer.swapBuffers(); } FrameCountingMemoryAllocationSettingContext* context() { return static_cast<FrameCountingMemoryAllocationSettingContext*>(m_context->context3D()); } @@ -158,92 +158,92 @@ protected: OwnPtr<CCGraphicsContext> m_context; FakeCCRendererClient m_mockClient; OwnPtr<CCResourceProvider> m_resourceProvider; - FakeLayerRendererChromium m_layerRendererChromium; + FakeCCRendererGL m_renderer; CCScopedSettings m_scopedSettings; }; -// Test LayerRendererChromium discardFramebuffer functionality: +// Test CCRendererGL discardFramebuffer functionality: // Suggest recreating framebuffer when one already exists. // Expected: it does nothing. -TEST_F(LayerRendererChromiumTest, SuggestBackbufferYesWhenItAlreadyExistsShouldDoNothing) +TEST_F(CCRendererGLTest, SuggestBackbufferYesWhenItAlreadyExistsShouldDoNothing) { context()->setMemoryAllocation(m_suggestHaveBackbufferYes); EXPECT_EQ(0, m_mockClient.setFullRootLayerDamageCount()); - EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded()); + EXPECT_FALSE(m_renderer.isFramebufferDiscarded()); swapBuffers(); EXPECT_EQ(1, context()->frameCount()); } -// Test LayerRendererChromium discardFramebuffer functionality: +// Test CCRendererGL discardFramebuffer functionality: // Suggest discarding framebuffer when one exists and the renderer is not visible. // Expected: it is discarded and damage tracker is reset. -TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoShouldDiscardBackbufferAndDamageRootLayerWhileNotVisible) +TEST_F(CCRendererGLTest, SuggestBackbufferNoShouldDiscardBackbufferAndDamageRootLayerWhileNotVisible) { - m_layerRendererChromium.setVisible(false); + m_renderer.setVisible(false); context()->setMemoryAllocation(m_suggestHaveBackbufferNo); EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount()); - EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); + EXPECT_TRUE(m_renderer.isFramebufferDiscarded()); } -// Test LayerRendererChromium discardFramebuffer functionality: +// Test CCRendererGL discardFramebuffer functionality: // Suggest discarding framebuffer when one exists and the renderer is visible. // Expected: the allocation is ignored. -TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoDoNothingWhenVisible) +TEST_F(CCRendererGLTest, SuggestBackbufferNoDoNothingWhenVisible) { - m_layerRendererChromium.setVisible(true); + m_renderer.setVisible(true); context()->setMemoryAllocation(m_suggestHaveBackbufferNo); EXPECT_EQ(0, m_mockClient.setFullRootLayerDamageCount()); - EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded()); + EXPECT_FALSE(m_renderer.isFramebufferDiscarded()); } -// Test LayerRendererChromium discardFramebuffer functionality: +// Test CCRendererGL discardFramebuffer functionality: // Suggest discarding framebuffer when one does not exist. // Expected: it does nothing. -TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoWhenItDoesntExistShouldDoNothing) +TEST_F(CCRendererGLTest, SuggestBackbufferNoWhenItDoesntExistShouldDoNothing) { - m_layerRendererChromium.setVisible(false); + m_renderer.setVisible(false); context()->setMemoryAllocation(m_suggestHaveBackbufferNo); EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount()); - EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); + EXPECT_TRUE(m_renderer.isFramebufferDiscarded()); context()->setMemoryAllocation(m_suggestHaveBackbufferNo); EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount()); - EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); + EXPECT_TRUE(m_renderer.isFramebufferDiscarded()); } -// Test LayerRendererChromium discardFramebuffer functionality: +// Test CCRendererGL discardFramebuffer functionality: // Begin drawing a frame while a framebuffer is discarded. // Expected: will recreate framebuffer. -TEST_F(LayerRendererChromiumTest, DiscardedBackbufferIsRecreatedForScopeDuration) +TEST_F(CCRendererGLTest, DiscardedBackbufferIsRecreatedForScopeDuration) { - m_layerRendererChromium.setVisible(false); + m_renderer.setVisible(false); context()->setMemoryAllocation(m_suggestHaveBackbufferNo); - EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); + EXPECT_TRUE(m_renderer.isFramebufferDiscarded()); EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount()); - m_layerRendererChromium.setVisible(true); - m_layerRendererChromium.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses()); - EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded()); + m_renderer.setVisible(true); + m_renderer.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses()); + EXPECT_FALSE(m_renderer.isFramebufferDiscarded()); swapBuffers(); EXPECT_EQ(1, context()->frameCount()); } -TEST_F(LayerRendererChromiumTest, FramebufferDiscardedAfterReadbackWhenNotVisible) +TEST_F(CCRendererGLTest, FramebufferDiscardedAfterReadbackWhenNotVisible) { - m_layerRendererChromium.setVisible(false); + m_renderer.setVisible(false); context()->setMemoryAllocation(m_suggestHaveBackbufferNo); - EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); + EXPECT_TRUE(m_renderer.isFramebufferDiscarded()); EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount()); char pixels[4]; - m_layerRendererChromium.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses()); - EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded()); + m_renderer.drawFrame(m_mockClient.renderPassesInDrawOrder(), m_mockClient.renderPasses()); + EXPECT_FALSE(m_renderer.isFramebufferDiscarded()); - m_layerRendererChromium.getFramebufferPixels(pixels, IntRect(0, 0, 1, 1)); - EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); + m_renderer.getFramebufferPixels(pixels, IntRect(0, 0, 1, 1)); + EXPECT_TRUE(m_renderer.isFramebufferDiscarded()); EXPECT_EQ(2, m_mockClient.setFullRootLayerDamageCount()); } @@ -313,16 +313,16 @@ public: virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname) { ADD_FAILURE(); return 0; } }; -// This test isn't using the same fixture as LayerRendererChromiumTest, and you can't mix TEST() and TEST_F() with the same name, hence LRC2. -TEST(LayerRendererChromiumTest2, initializationDoesNotMakeSynchronousCalls) +// This test isn't using the same fixture as CCRendererGLTest, and you can't mix TEST() and TEST_F() with the same name, hence LRC2. +TEST(CCRendererGLTest2, initializationDoesNotMakeSynchronousCalls) { CCScopedSettings scopedSettings; FakeCCRendererClient mockClient; OwnPtr<CCGraphicsContext> context(FakeWebCompositorOutputSurface::create(adoptPtr(new ForbidSynchronousCallContext))); OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(context.get())); - FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get()); + FakeCCRendererGL renderer(&mockClient, resourceProvider.get()); - EXPECT_TRUE(layerRendererChromium.initialize()); + EXPECT_TRUE(renderer.initialize()); } class LoseContextOnFirstGetContext : public FakeWebGraphicsContext3D { @@ -358,15 +358,15 @@ private: bool m_contextLost; }; -TEST(LayerRendererChromiumTest2, initializationWithQuicklyLostContextDoesNotAssert) +TEST(CCRendererGLTest2, initializationWithQuicklyLostContextDoesNotAssert) { CCScopedSettings scopedSettings; FakeCCRendererClient mockClient; OwnPtr<CCGraphicsContext> context(FakeWebCompositorOutputSurface::create(adoptPtr(new LoseContextOnFirstGetContext))); OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(context.get())); - FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get()); + FakeCCRendererGL renderer(&mockClient, resourceProvider.get()); - layerRendererChromium.initialize(); + renderer.initialize(); } class ContextThatDoesNotSupportMemoryManagmentExtensions : public FakeWebGraphicsContext3D { @@ -381,14 +381,14 @@ public: virtual WebString getString(WebKit::WGC3Denum name) { return WebString(); } }; -TEST(LayerRendererChromiumTest2, initializationWithoutGpuMemoryManagerExtensionSupportShouldDefaultToNonZeroAllocation) +TEST(CCRendererGLTest2, initializationWithoutGpuMemoryManagerExtensionSupportShouldDefaultToNonZeroAllocation) { FakeCCRendererClient mockClient; OwnPtr<CCGraphicsContext> context(FakeWebCompositorOutputSurface::create(adoptPtr(new ContextThatDoesNotSupportMemoryManagmentExtensions))); OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(context.get())); - FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get()); + FakeCCRendererGL renderer(&mockClient, resourceProvider.get()); - layerRendererChromium.initialize(); + renderer.initialize(); EXPECT_GT(mockClient.memoryAllocationLimitBytes(), 0ul); } @@ -408,19 +408,19 @@ private: int m_clear; }; -TEST(LayerRendererChromiumTest2, opaqueBackground) +TEST(CCRendererGLTest2, opaqueBackground) { FakeCCRendererClient mockClient; OwnPtr<CCGraphicsContext> ccContext(FakeWebCompositorOutputSurface::create(adoptPtr(new ClearCountingContext))); ClearCountingContext* context = static_cast<ClearCountingContext*>(ccContext->context3D()); OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(ccContext.get())); - FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get()); + FakeCCRendererGL renderer(&mockClient, resourceProvider.get()); mockClient.rootRenderPass()->setHasTransparentBackground(false); - EXPECT_TRUE(layerRendererChromium.initialize()); + EXPECT_TRUE(renderer.initialize()); - layerRendererChromium.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses()); + renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses()); // On DEBUG builds, render passes with opaque background clear to blue to // easily see regions that were not drawn on the screen. @@ -431,19 +431,19 @@ TEST(LayerRendererChromiumTest2, opaqueBackground) #endif } -TEST(LayerRendererChromiumTest2, transparentBackground) +TEST(CCRendererGLTest2, transparentBackground) { FakeCCRendererClient mockClient; OwnPtr<CCGraphicsContext> ccContext(FakeWebCompositorOutputSurface::create(adoptPtr(new ClearCountingContext))); ClearCountingContext* context = static_cast<ClearCountingContext*>(ccContext->context3D()); OwnPtr<CCResourceProvider> resourceProvider(CCResourceProvider::create(ccContext.get())); - FakeLayerRendererChromium layerRendererChromium(&mockClient, resourceProvider.get()); + FakeCCRendererGL renderer(&mockClient, resourceProvider.get()); mockClient.rootRenderPass()->setHasTransparentBackground(true); - EXPECT_TRUE(layerRendererChromium.initialize()); + EXPECT_TRUE(renderer.initialize()); - layerRendererChromium.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses()); + renderer.drawFrame(mockClient.renderPassesInDrawOrder(), mockClient.renderPasses()); EXPECT_EQ(1, context->clearCount()); } diff --git a/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h b/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h index 824af26c7..a504b60bb 100644 --- a/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h +++ b/Source/WebKit/chromium/tests/CCSchedulerTestCommon.h @@ -106,7 +106,7 @@ public: virtual bool active() const OVERRIDE { return m_active; } virtual void setTimebaseAndInterval(double timebase, double interval) OVERRIDE { } virtual double lastTickTime() OVERRIDE { return 0; } - virtual double nextTickTime() OVERRIDE { return 0; } + virtual double nextTickTimeIfActivated() OVERRIDE { return 0; } void tick() { diff --git a/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp b/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp index 1eba991c3..220189b41 100644 --- a/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp +++ b/Source/WebKit/chromium/tests/CCSolidColorLayerImplTest.cpp @@ -53,9 +53,8 @@ TEST(CCSolidColorLayerImplTest, verifyTilingCompleteAndNoOverlap) layer->createRenderSurface(); layer->setRenderTarget(layer.get()); - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); + layer->appendQuads(quadCuller, hadMissingTiles); verifyQuadsExactlyCoverRect(quadCuller.quadList(), visibleContentRect); } @@ -78,9 +77,8 @@ TEST(CCSolidColorLayerImplTest, verifyCorrectBackgroundColorInQuad) layer->createRenderSurface(); layer->setRenderTarget(layer.get()); - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); + layer->appendQuads(quadCuller, hadMissingTiles); ASSERT_EQ(quadCuller.quadList().size(), 1U); EXPECT_EQ(CCSolidColorDrawQuad::materialCast(quadCuller.quadList()[0].get())->color(), testColor); @@ -104,9 +102,8 @@ TEST(CCSolidColorLayerImplTest, verifyCorrectOpacityInQuad) layer->createRenderSurface(); layer->setRenderTarget(layer.get()); - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); + layer->appendQuads(quadCuller, hadMissingTiles); ASSERT_EQ(quadCuller.quadList().size(), 1U); EXPECT_EQ(opacity, CCSolidColorDrawQuad::materialCast(quadCuller.quadList()[0].get())->opacity()); diff --git a/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp b/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp index 62336bb50..8b4bd20e8 100644 --- a/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp +++ b/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp @@ -76,9 +76,8 @@ TEST(CCTiledLayerImplTest, emptyQuadList) { OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels); MockCCQuadCuller quadCuller; - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); + layer->appendQuads(quadCuller, hadMissingTiles); const unsigned numTiles = numTilesX * numTilesY; EXPECT_EQ(quadCuller.quadList().size(), numTiles); } @@ -89,9 +88,8 @@ TEST(CCTiledLayerImplTest, emptyQuadList) layer->setVisibleContentRect(IntRect()); MockCCQuadCuller quadCuller; - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); + layer->appendQuads(quadCuller, hadMissingTiles); EXPECT_EQ(quadCuller.quadList().size(), 0u); } @@ -103,9 +101,8 @@ TEST(CCTiledLayerImplTest, emptyQuadList) layer->setVisibleContentRect(outsideBounds); MockCCQuadCuller quadCuller; - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); + layer->appendQuads(quadCuller, hadMissingTiles); EXPECT_EQ(quadCuller.quadList().size(), 0u); } @@ -115,9 +112,8 @@ TEST(CCTiledLayerImplTest, emptyQuadList) layer->setSkipsDraw(true); MockCCQuadCuller quadCuller; - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); + layer->appendQuads(quadCuller, hadMissingTiles); EXPECT_EQ(quadCuller.quadList().size(), 0u); } } @@ -132,13 +128,12 @@ TEST(CCTiledLayerImplTest, checkerboarding) const IntSize layerSize(tileSize.width() * numTilesX, tileSize.height() * numTilesY); OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, CCLayerTilingData::NoBorderTexels); - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); // No checkerboarding { MockCCQuadCuller quadCuller; bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); + layer->appendQuads(quadCuller, hadMissingTiles); EXPECT_EQ(quadCuller.quadList().size(), 4u); EXPECT_FALSE(hadMissingTiles); @@ -154,7 +149,7 @@ TEST(CCTiledLayerImplTest, checkerboarding) { MockCCQuadCuller quadCuller; bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); + layer->appendQuads(quadCuller, hadMissingTiles); EXPECT_TRUE(hadMissingTiles); EXPECT_EQ(quadCuller.quadList().size(), 4u); for (size_t i = 0; i < quadCuller.quadList().size(); ++i) @@ -162,17 +157,15 @@ TEST(CCTiledLayerImplTest, checkerboarding) } } -static PassOwnPtr<CCSharedQuadState> getQuads(CCQuadList& quads, IntSize tileSize, const IntSize& layerSize, CCLayerTilingData::BorderTexelOption borderTexelOption, const IntRect& visibleContentRect) +static void getQuads(CCQuadList& quads, CCSharedQuadStateList& sharedStates, IntSize tileSize, const IntSize& layerSize, CCLayerTilingData::BorderTexelOption borderTexelOption, const IntRect& visibleContentRect) { OwnPtr<CCTiledLayerImpl> layer = createLayer(tileSize, layerSize, borderTexelOption); layer->setVisibleContentRect(visibleContentRect); layer->setBounds(layerSize); - MockCCQuadCuller quadCuller(quads); - OwnPtr<CCSharedQuadState> sharedQuadState = layer->createSharedQuadState(0); + MockCCQuadCuller quadCuller(quads, sharedStates); bool hadMissingTiles = false; - layer->appendQuads(quadCuller, sharedQuadState.get(), hadMissingTiles); - return sharedQuadState.release(); // The shared data must be owned as long as the quad list exists. + layer->appendQuads(quadCuller, hadMissingTiles); } // Test with both border texels and without. @@ -192,8 +185,8 @@ static void coverageVisibleRectOnTileBoundaries(CCLayerTilingData::BorderTexelOp IntSize layerSize(1000, 1000); CCQuadList quads; - OwnPtr<CCSharedQuadState> sharedState; - sharedState = getQuads(quads, IntSize(100, 100), layerSize, borders, IntRect(IntPoint(), layerSize)); + CCSharedQuadStateList sharedStates; + getQuads(quads, sharedStates, IntSize(100, 100), layerSize, borders, IntRect(IntPoint(), layerSize)); verifyQuadsExactlyCoverRect(quads, IntRect(IntPoint(), layerSize)); } WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectOnTileBoundaries); @@ -209,8 +202,8 @@ static void coverageVisibleRectIntersectsTiles(CCLayerTilingData::BorderTexelOpt IntSize layerSize(250, 250); CCQuadList quads; - OwnPtr<CCSharedQuadState> sharedState; - sharedState = getQuads(quads, IntSize(50, 50), IntSize(250, 250), CCLayerTilingData::NoBorderTexels, visibleContentRect); + CCSharedQuadStateList sharedStates; + getQuads(quads, sharedStates, IntSize(50, 50), IntSize(250, 250), CCLayerTilingData::NoBorderTexels, visibleContentRect); verifyQuadsExactlyCoverRect(quads, visibleContentRect); } WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectIntersectsTiles); @@ -222,8 +215,8 @@ static void coverageVisibleRectIntersectsBounds(CCLayerTilingData::BorderTexelOp IntSize layerSize(220, 210); IntRect visibleContentRect(IntPoint(), layerSize); CCQuadList quads; - OwnPtr<CCSharedQuadState> sharedState; - sharedState = getQuads(quads, IntSize(100, 100), layerSize, CCLayerTilingData::NoBorderTexels, visibleContentRect); + CCSharedQuadStateList sharedStates; + getQuads(quads, sharedStates, IntSize(100, 100), layerSize, CCLayerTilingData::NoBorderTexels, visibleContentRect); verifyQuadsExactlyCoverRect(quads, visibleContentRect); } WITH_AND_WITHOUT_BORDER_TEST(coverageVisibleRectIntersectsBounds); @@ -235,8 +228,8 @@ TEST(CCTiledLayerImplTest, textureInfoForLayerNoBorders) IntSize tileSize(50, 50); IntSize layerSize(250, 250); CCQuadList quads; - OwnPtr<CCSharedQuadState> sharedState; - sharedState = getQuads(quads, tileSize, layerSize, CCLayerTilingData::NoBorderTexels, IntRect(IntPoint(), layerSize)); + CCSharedQuadStateList sharedStates; + getQuads(quads, sharedStates, tileSize, layerSize, CCLayerTilingData::NoBorderTexels, IntRect(IntPoint(), layerSize)); for (size_t i = 0; i < quads.size(); ++i) { ASSERT_EQ(quads[i]->material(), CCDrawQuad::TiledContent) << quadString << i; @@ -256,8 +249,8 @@ TEST(CCTiledLayerImplTest, tileOpaqueRectForLayerNoBorders) IntSize tileSize(50, 50); IntSize layerSize(250, 250); CCQuadList quads; - OwnPtr<CCSharedQuadState> sharedState; - sharedState = getQuads(quads, tileSize, layerSize, CCLayerTilingData::NoBorderTexels, IntRect(IntPoint(), layerSize)); + CCSharedQuadStateList sharedStates; + getQuads(quads, sharedStates, tileSize, layerSize, CCLayerTilingData::NoBorderTexels, IntRect(IntPoint(), layerSize)); for (size_t i = 0; i < quads.size(); ++i) { ASSERT_EQ(quads[i]->material(), CCDrawQuad::TiledContent) << quadString << i; diff --git a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp index 26627ec8d..c0a9cf2ef 100644 --- a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp @@ -96,9 +96,9 @@ TEST_F(GraphicsLayerChromiumTest, updateLayerPreserves3DWithAnimations) { ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0.0, 0.0)); - OwnPtr<WebAnimation> floatAnimation(adoptPtr(WebAnimation::create(curve, 1, 1, WebAnimation::TargetPropertyOpacity))); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0.0, 0.0)); + OwnPtr<WebAnimation> floatAnimation(adoptPtr(WebAnimation::create(*curve, 1, 1, WebAnimation::TargetPropertyOpacity))); ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.get())); ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); diff --git a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp index 8605c0f1a..ead7f9bb9 100644 --- a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp +++ b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp @@ -32,12 +32,17 @@ #include "IDBIndexBackendImpl.h" #include "IDBObjectStoreBackendImpl.h" #include "IDBTransactionCoordinator.h" +#include "WebIDBDatabaseCallbacksImpl.h" +#include "WebIDBDatabaseImpl.h" #include <gtest/gtest.h> #if ENABLE(INDEXED_DATABASE) using namespace WebCore; +using WebKit::WebIDBDatabase; +using WebKit::WebIDBDatabaseCallbacksImpl; +using WebKit::WebIDBDatabaseImpl; namespace { @@ -101,6 +106,7 @@ public: virtual ~FakeIDBDatabaseCallbacks() { } virtual void onVersionChange(const String& version) OVERRIDE { } virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) OVERRIDE { } + virtual void onForcedClose() OVERRIDE { } private: FakeIDBDatabaseCallbacks() { } }; @@ -134,6 +140,72 @@ TEST(IDBDatabaseBackendTest, ConnectionLifecycle) EXPECT_TRUE(backingStore->hasOneRef()); } +class MockIDBDatabaseBackendProxy : public IDBDatabaseBackendInterface { +public: + static PassRefPtr<MockIDBDatabaseBackendProxy> create(WebIDBDatabaseImpl& database) + { + return adoptRef(new MockIDBDatabaseBackendProxy(database)); + } + + ~MockIDBDatabaseBackendProxy() + { + EXPECT_TRUE(m_wasRegisterFrontendCallbacksCalled); + } + + virtual IDBDatabaseMetadata metadata() const { return IDBDatabaseMetadata(); } + virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&) { return 0; } + virtual void deleteObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&) { } + virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, ExceptionCode&) { } + virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode&) { return 0; } + + virtual void close(PassRefPtr<IDBDatabaseCallbacks>) + { + m_wasCloseCalled = true; + m_webDatabase.close(); + } + virtual void registerFrontendCallbacks(PassRefPtr<IDBDatabaseCallbacks> connection) + { + m_wasRegisterFrontendCallbacksCalled = true; + m_webDatabase.open(new WebIDBDatabaseCallbacksImpl(connection)); + } + +private: + MockIDBDatabaseBackendProxy(WebIDBDatabaseImpl& webDatabase) + : m_wasRegisterFrontendCallbacksCalled(false) + , m_wasCloseCalled(false) + , m_webDatabase(webDatabase) { } + + bool m_wasRegisterFrontendCallbacksCalled; + bool m_wasCloseCalled; + + WebIDBDatabaseImpl& m_webDatabase; +}; + +TEST(IDBDatabaseBackendTest, ForcedClose) +{ + RefPtr<IDBFakeBackingStore> backingStore = adoptRef(new IDBFakeBackingStore()); + EXPECT_TRUE(backingStore->hasOneRef()); + + IDBTransactionCoordinator* coordinator = 0; + IDBFactoryBackendImpl* factory = 0; + RefPtr<IDBDatabaseBackendImpl> backend = IDBDatabaseBackendImpl::create("db", backingStore.get(), coordinator, factory, "uniqueid"); + EXPECT_GT(backingStore->refCount(), 1); + + WebIDBDatabaseImpl webDatabase(backend); + + RefPtr<MockIDBCallbacks> request1 = MockIDBCallbacks::create(); + backend->openConnection(request1); + + RefPtr<MockIDBDatabaseBackendProxy> proxy = MockIDBDatabaseBackendProxy::create(webDatabase); + + ScriptExecutionContext* context = 0; + RefPtr<IDBDatabase> idbDatabase = IDBDatabase::create(context, proxy); + idbDatabase->registerFrontendCallbacks(); + + webDatabase.forceClose(); + EXPECT_TRUE(backingStore->hasOneRef()); +} + } // namespace #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/tests/IDBRequestTest.cpp b/Source/WebKit/chromium/tests/IDBRequestTest.cpp index 77757193b..9e2459d39 100644 --- a/Source/WebKit/chromium/tests/IDBRequestTest.cpp +++ b/Source/WebKit/chromium/tests/IDBRequestTest.cpp @@ -50,7 +50,6 @@ TEST(IDBRequestTest, EventsAfterStopping) // Ensure none of the following raise assertions in stopped state: request->onError(IDBDatabaseError::create(IDBDatabaseException::IDB_ABORT_ERR, "Description goes here.")); request->onSuccess(DOMStringList::create()); - request->onSuccess(PassRefPtr<IDBDatabaseBackendInterface>()); request->onSuccess(PassRefPtr<IDBCursorBackendInterface>(), IDBKey::createInvalid(), IDBKey::createInvalid(), SerializedScriptValue::nullValue()); request->onSuccess(IDBKey::createInvalid()); request->onSuccess(PassRefPtr<IDBTransactionBackendInterface>()); diff --git a/Source/WebKit/chromium/tests/MockCCQuadCuller.h b/Source/WebKit/chromium/tests/MockCCQuadCuller.h index 7f6e0f85a..59a0073ce 100644 --- a/Source/WebKit/chromium/tests/MockCCQuadCuller.h +++ b/Source/WebKit/chromium/tests/MockCCQuadCuller.h @@ -32,19 +32,21 @@ namespace WebCore { -class MockCCQuadCuller : public WebCore::CCQuadSink { +class MockCCQuadCuller : public CCQuadSink { public: MockCCQuadCuller() : m_activeQuadList(m_quadListStorage) + , m_activeSharedQuadStateList(m_sharedQuadStateStorage) { } - explicit MockCCQuadCuller(CCQuadList& externalQuadList) + explicit MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateList& externalSharedQuadStateList) : m_activeQuadList(externalQuadList) + , m_activeSharedQuadStateList(externalSharedQuadStateList) { } - virtual bool append(WTF::PassOwnPtr<WebCore::CCDrawQuad> newQuad) + virtual bool append(WTF::PassOwnPtr<CCDrawQuad> newQuad) OVERRIDE { - OwnPtr<WebCore::CCDrawQuad> drawQuad = newQuad; + OwnPtr<CCDrawQuad> drawQuad = newQuad; if (!drawQuad->quadRect().isEmpty()) { m_activeQuadList.append(drawQuad.release()); return true; @@ -52,11 +54,24 @@ public: return false; } - const WebCore::CCQuadList& quadList() const { return m_activeQuadList; }; + virtual CCSharedQuadState* useSharedQuadState(PassOwnPtr<CCSharedQuadState> passSharedQuadState) OVERRIDE + { + OwnPtr<CCSharedQuadState> sharedQuadState(passSharedQuadState); + sharedQuadState->id = m_activeSharedQuadStateList.size(); + + CCSharedQuadState* rawPtr = sharedQuadState.get(); + m_activeSharedQuadStateList.append(sharedQuadState.release()); + return rawPtr; + } + + const CCQuadList& quadList() const { return m_activeQuadList; }; + const CCSharedQuadStateList& sharedQuadStateList() const { return m_activeSharedQuadStateList; }; private: - WebCore::CCQuadList& m_activeQuadList; - WebCore::CCQuadList m_quadListStorage; + CCQuadList& m_activeQuadList; + CCQuadList m_quadListStorage; + CCSharedQuadStateList& m_activeSharedQuadStateList; + CCSharedQuadStateList m_sharedQuadStateStorage; }; } // namespace WebCore diff --git a/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp b/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp index 927d4a9c3..e71846adb 100644 --- a/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp +++ b/Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp @@ -63,12 +63,20 @@ public: MOCK_METHOD1(invalidateScrollCornerRect, void(const IntRect&)); MOCK_METHOD1(setScrollOffsetFromAnimation, void(const IntPoint&)); MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*()); - - virtual IntPoint scrollPosition() const { return IntPoint(); } - virtual int visibleHeight() const { return 768; } - virtual int visibleWidth() const { return 1024; } - - bool scrollAnimatorEnabled() const { return m_scrollAnimatorEnabled; } + MOCK_CONST_METHOD0(minimumScrollPosition, IntPoint()); + MOCK_CONST_METHOD0(maximumScrollPosition, IntPoint()); + MOCK_CONST_METHOD1(visibleContentRect, IntRect(bool)); + MOCK_CONST_METHOD0(contentsSize, IntSize()); + MOCK_CONST_METHOD0(overhangAmount, IntSize()); + MOCK_CONST_METHOD0(isOnActivePage, bool()); + MOCK_CONST_METHOD0(scrollableAreaBoundingBox, IntRect()); + + virtual IntPoint scrollPosition() const OVERRIDE { return IntPoint(); } + virtual int visibleHeight() const OVERRIDE { return 768; } + virtual int visibleWidth() const OVERRIDE { return 1024; } + virtual bool scrollAnimatorEnabled() const OVERRIDE { return m_scrollAnimatorEnabled; } + +private: bool m_scrollAnimatorEnabled; }; diff --git a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp index 2efb8e5dc..00ee28a68 100644 --- a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp @@ -705,7 +705,7 @@ TEST_F(TiledLayerChromiumTest, skipsDrawGetsReset) WebKit::WebCompositor::initialize(0); FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, CCLayerTreeSettings()); - ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded()); + ASSERT_TRUE(ccLayerTreeHost->initializeRendererIfNeeded()); // Create two 300 x 300 tiled layers. IntSize contentBounds(300, 300); @@ -791,7 +791,7 @@ TEST_F(TiledLayerChromiumTest, partialUpdates) FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, settings); - ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded()); + ASSERT_TRUE(ccLayerTreeHost->initializeRendererIfNeeded()); // Create one 300 x 200 tiled layer with 3 x 2 tiles. IntSize contentBounds(300, 200); @@ -1333,7 +1333,7 @@ TEST_F(TiledLayerChromiumTest, dontAllocateContentsWhenTargetSurfaceCantBeAlloca CCLayerTreeSettings settings; FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, settings); - ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded()); + ASSERT_TRUE(ccLayerTreeHost->initializeRendererIfNeeded()); RefPtr<FakeTiledLayerChromium> root = adoptRef(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager())); RefPtr<LayerChromium> surface = LayerChromium::create(); diff --git a/Source/WebKit/chromium/tests/WebAnimationTest.cpp b/Source/WebKit/chromium/tests/WebAnimationTest.cpp index a682ab020..1822ff6a0 100644 --- a/Source/WebKit/chromium/tests/WebAnimationTest.cpp +++ b/Source/WebKit/chromium/tests/WebAnimationTest.cpp @@ -46,8 +46,8 @@ namespace { #endif TEST(WebAnimationTest, MAYBE_DefaultSettings) { - WebFloatAnimationCurve curve; - OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(curve, WebAnimation::TargetPropertyOpacity)); + OwnPtr<WebAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(*curve, WebAnimation::TargetPropertyOpacity)); // Ensure that the defaults are correct. EXPECT_EQ(1, animation->iterations()); @@ -67,8 +67,8 @@ TEST(WebAnimationTest, MAYBE_DefaultSettings) #endif TEST(WebAnimationTest, MAYBE_ModifiedSettings) { - WebFloatAnimationCurve curve; - OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(curve, WebAnimation::TargetPropertyOpacity)); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + OwnPtr<WebAnimation> animation = adoptPtr(WebAnimation::create(*curve, WebAnimation::TargetPropertyOpacity)); animation->setIterations(2); animation->setStartTime(2); animation->setTimeOffset(2); diff --git a/Source/WebKit/chromium/tests/WebFloatAnimationCurveTest.cpp b/Source/WebKit/chromium/tests/WebFloatAnimationCurveTest.cpp index 3cac764b6..7a6a52405 100644 --- a/Source/WebKit/chromium/tests/WebFloatAnimationCurveTest.cpp +++ b/Source/WebKit/chromium/tests/WebFloatAnimationCurveTest.cpp @@ -39,197 +39,197 @@ namespace { // Tests that a float animation with one keyframe works as expected. TEST(WebFloatAnimationCurveTest, OneFloatKeyframe) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); - EXPECT_FLOAT_EQ(2, curve.getValue(-1)); - EXPECT_FLOAT_EQ(2, curve.getValue(0)); - EXPECT_FLOAT_EQ(2, curve.getValue(0.5)); - EXPECT_FLOAT_EQ(2, curve.getValue(1)); - EXPECT_FLOAT_EQ(2, curve.getValue(2)); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); + EXPECT_FLOAT_EQ(2, curve->getValue(-1)); + EXPECT_FLOAT_EQ(2, curve->getValue(0)); + EXPECT_FLOAT_EQ(2, curve->getValue(0.5)); + EXPECT_FLOAT_EQ(2, curve->getValue(1)); + EXPECT_FLOAT_EQ(2, curve->getValue(2)); } // Tests that a float animation with two keyframes works as expected. TEST(WebFloatAnimationCurveTest, TwoFloatKeyframe) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); - EXPECT_FLOAT_EQ(2, curve.getValue(-1)); - EXPECT_FLOAT_EQ(2, curve.getValue(0)); - EXPECT_FLOAT_EQ(3, curve.getValue(0.5)); - EXPECT_FLOAT_EQ(4, curve.getValue(1)); - EXPECT_FLOAT_EQ(4, curve.getValue(2)); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); + EXPECT_FLOAT_EQ(2, curve->getValue(-1)); + EXPECT_FLOAT_EQ(2, curve->getValue(0)); + EXPECT_FLOAT_EQ(3, curve->getValue(0.5)); + EXPECT_FLOAT_EQ(4, curve->getValue(1)); + EXPECT_FLOAT_EQ(4, curve->getValue(2)); } // Tests that a float animation with three keyframes works as expected. TEST(WebFloatAnimationCurveTest, ThreeFloatKeyframe) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebFloatKeyframe(2, 8), WebAnimationCurve::TimingFunctionTypeLinear); - EXPECT_FLOAT_EQ(2, curve.getValue(-1)); - EXPECT_FLOAT_EQ(2, curve.getValue(0)); - EXPECT_FLOAT_EQ(3, curve.getValue(0.5)); - EXPECT_FLOAT_EQ(4, curve.getValue(1)); - EXPECT_FLOAT_EQ(6, curve.getValue(1.5)); - EXPECT_FLOAT_EQ(8, curve.getValue(2)); - EXPECT_FLOAT_EQ(8, curve.getValue(3)); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(2, 8), WebAnimationCurve::TimingFunctionTypeLinear); + EXPECT_FLOAT_EQ(2, curve->getValue(-1)); + EXPECT_FLOAT_EQ(2, curve->getValue(0)); + EXPECT_FLOAT_EQ(3, curve->getValue(0.5)); + EXPECT_FLOAT_EQ(4, curve->getValue(1)); + EXPECT_FLOAT_EQ(6, curve->getValue(1.5)); + EXPECT_FLOAT_EQ(8, curve->getValue(2)); + EXPECT_FLOAT_EQ(8, curve->getValue(3)); } // Tests that a float animation with multiple keys at a given time works sanely. TEST(WebFloatAnimationCurveTest, RepeatedFloatKeyTimes) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 4), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebFloatKeyframe(1, 6), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebFloatKeyframe(2, 6), WebAnimationCurve::TimingFunctionTypeLinear); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 4), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(1, 6), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(2, 6), WebAnimationCurve::TimingFunctionTypeLinear); - EXPECT_FLOAT_EQ(4, curve.getValue(-1)); - EXPECT_FLOAT_EQ(4, curve.getValue(0)); - EXPECT_FLOAT_EQ(4, curve.getValue(0.5)); + EXPECT_FLOAT_EQ(4, curve->getValue(-1)); + EXPECT_FLOAT_EQ(4, curve->getValue(0)); + EXPECT_FLOAT_EQ(4, curve->getValue(0.5)); // There is a discontinuity at 1. Any value between 4 and 6 is valid. - float value = curve.getValue(1); + float value = curve->getValue(1); EXPECT_TRUE(value >= 4 && value <= 6); - EXPECT_FLOAT_EQ(6, curve.getValue(1.5)); - EXPECT_FLOAT_EQ(6, curve.getValue(2)); - EXPECT_FLOAT_EQ(6, curve.getValue(3)); + EXPECT_FLOAT_EQ(6, curve->getValue(1.5)); + EXPECT_FLOAT_EQ(6, curve->getValue(2)); + EXPECT_FLOAT_EQ(6, curve->getValue(3)); } // Tests that the keyframes may be added out of order. TEST(WebFloatAnimationCurveTest, UnsortedKeyframes) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(2, 8), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); - - EXPECT_FLOAT_EQ(2, curve.getValue(-1)); - EXPECT_FLOAT_EQ(2, curve.getValue(0)); - EXPECT_FLOAT_EQ(3, curve.getValue(0.5)); - EXPECT_FLOAT_EQ(4, curve.getValue(1)); - EXPECT_FLOAT_EQ(6, curve.getValue(1.5)); - EXPECT_FLOAT_EQ(8, curve.getValue(2)); - EXPECT_FLOAT_EQ(8, curve.getValue(3)); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(2, 8), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(0, 2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(1, 4), WebAnimationCurve::TimingFunctionTypeLinear); + + EXPECT_FLOAT_EQ(2, curve->getValue(-1)); + EXPECT_FLOAT_EQ(2, curve->getValue(0)); + EXPECT_FLOAT_EQ(3, curve->getValue(0.5)); + EXPECT_FLOAT_EQ(4, curve->getValue(1)); + EXPECT_FLOAT_EQ(6, curve->getValue(1.5)); + EXPECT_FLOAT_EQ(8, curve->getValue(2)); + EXPECT_FLOAT_EQ(8, curve->getValue(3)); } // Tests that a cubic bezier timing function works as expected. TEST(WebFloatAnimationCurveTest, CubicBezierTimingFunction) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 0), 0.25, 0, 0.75, 1); - curve.add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); - - EXPECT_FLOAT_EQ(0, curve.getValue(0)); - EXPECT_LT(0, curve.getValue(0.25)); - EXPECT_GT(0.25, curve.getValue(0.25)); - EXPECT_FLOAT_EQ(0.5, curve.getValue(0.5)); - EXPECT_LT(0.75, curve.getValue(0.75)); - EXPECT_GT(1, curve.getValue(0.75)); - EXPECT_FLOAT_EQ(1, curve.getValue(1)); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 0), 0.25, 0, 0.75, 1); + curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); + + EXPECT_FLOAT_EQ(0, curve->getValue(0)); + EXPECT_LT(0, curve->getValue(0.25)); + EXPECT_GT(0.25, curve->getValue(0.25)); + EXPECT_FLOAT_EQ(0.5, curve->getValue(0.5)); + EXPECT_LT(0.75, curve->getValue(0.75)); + EXPECT_GT(1, curve->getValue(0.75)); + EXPECT_FLOAT_EQ(1, curve->getValue(1)); } // Tests that an ease timing function works as expected. TEST(WebFloatAnimationCurveTest, EaseTimingFunction) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEase); - curve.add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEase); + curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time)); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time)); } } // Tests using a linear timing function. TEST(WebFloatAnimationCurveTest, LinearTimingFunction) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(time, curve.getValue(time)); + EXPECT_FLOAT_EQ(time, curve->getValue(time)); } } // Tests that an ease in timing function works as expected. TEST(WebFloatAnimationCurveTest, EaseInTimingFunction) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEaseIn); - curve.add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEaseIn); + curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseInTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time)); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time)); } } // Tests that an ease in timing function works as expected. TEST(WebFloatAnimationCurveTest, EaseOutTimingFunction) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEaseOut); - curve.add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEaseOut); + curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseOutTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time)); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time)); } } // Tests that an ease in timing function works as expected. TEST(WebFloatAnimationCurveTest, EaseInOutTimingFunction) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEaseInOut); - curve.add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 0), WebAnimationCurve::TimingFunctionTypeEaseInOut); + curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseInOutTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time)); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time)); } } // Tests that an ease in timing function works as expected. TEST(WebFloatAnimationCurveTest, CustomBezierTimingFunction) { - WebFloatAnimationCurve curve; + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); double x1 = 0.3; double y1 = 0.2; double x2 = 0.8; double y2 = 0.7; - curve.add(WebFloatKeyframe(0, 0), x1, y1, x2, y2); - curve.add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebFloatKeyframe(0, 0), x1, y1, x2, y2); + curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCCubicBezierTimingFunction::create(x1, y1, x2, y2)); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time)); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time)); } } // Tests that the default timing function is indeed ease. TEST(WebFloatAnimationCurveTest, DefaultTimingFunction) { - WebFloatAnimationCurve curve; - curve.add(WebFloatKeyframe(0, 0)); - curve.add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); + OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(WebFloatAnimationCurve::create()); + curve->add(WebFloatKeyframe(0, 0)); + curve->add(WebFloatKeyframe(1, 1), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time)); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time)); } } diff --git a/Source/WebKit/chromium/tests/WebTransformAnimationCurveTest.cpp b/Source/WebKit/chromium/tests/WebTransformAnimationCurveTest.cpp index 2f4de73cb..96acb3cc1 100644 --- a/Source/WebKit/chromium/tests/WebTransformAnimationCurveTest.cpp +++ b/Source/WebKit/chromium/tests/WebTransformAnimationCurveTest.cpp @@ -41,62 +41,62 @@ namespace { // Tests that a transform animation with one keyframe works as expected. TEST(WebTransformAnimationCurveTest, OneTransformKeyframe) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations; operations.appendTranslate(2, 0, 0); - curve.add(WebTransformKeyframe(0, operations), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations), WebAnimationCurve::TimingFunctionTypeLinear); - EXPECT_FLOAT_EQ(2, curve.getValue(-1).m41()); - EXPECT_FLOAT_EQ(2, curve.getValue(0).m41()); - EXPECT_FLOAT_EQ(2, curve.getValue(0.5).m41()); - EXPECT_FLOAT_EQ(2, curve.getValue(1).m41()); - EXPECT_FLOAT_EQ(2, curve.getValue(2).m41()); + EXPECT_FLOAT_EQ(2, curve->getValue(-1).m41()); + EXPECT_FLOAT_EQ(2, curve->getValue(0).m41()); + EXPECT_FLOAT_EQ(2, curve->getValue(0.5).m41()); + EXPECT_FLOAT_EQ(2, curve->getValue(1).m41()); + EXPECT_FLOAT_EQ(2, curve->getValue(2).m41()); } // Tests that a transform animation with two keyframes works as expected. TEST(WebTransformAnimationCurveTest, TwoTransformKeyframe) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(2, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(4, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); - EXPECT_FLOAT_EQ(2, curve.getValue(-1).m41()); - EXPECT_FLOAT_EQ(2, curve.getValue(0).m41()); - EXPECT_FLOAT_EQ(3, curve.getValue(0.5).m41()); - EXPECT_FLOAT_EQ(4, curve.getValue(1).m41()); - EXPECT_FLOAT_EQ(4, curve.getValue(2).m41()); + curve->add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + EXPECT_FLOAT_EQ(2, curve->getValue(-1).m41()); + EXPECT_FLOAT_EQ(2, curve->getValue(0).m41()); + EXPECT_FLOAT_EQ(3, curve->getValue(0.5).m41()); + EXPECT_FLOAT_EQ(4, curve->getValue(1).m41()); + EXPECT_FLOAT_EQ(4, curve->getValue(2).m41()); } // Tests that a transform animation with three keyframes works as expected. TEST(WebTransformAnimationCurveTest, ThreeTransformKeyframe) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(2, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(4, 0, 0); WebKit::WebTransformOperations operations3; operations3.appendTranslate(8, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebTransformKeyframe(2, operations3), WebAnimationCurve::TimingFunctionTypeLinear); - EXPECT_FLOAT_EQ(2, curve.getValue(-1).m41()); - EXPECT_FLOAT_EQ(2, curve.getValue(0).m41()); - EXPECT_FLOAT_EQ(3, curve.getValue(0.5).m41()); - EXPECT_FLOAT_EQ(4, curve.getValue(1).m41()); - EXPECT_FLOAT_EQ(6, curve.getValue(1.5).m41()); - EXPECT_FLOAT_EQ(8, curve.getValue(2).m41()); - EXPECT_FLOAT_EQ(8, curve.getValue(3).m41()); + curve->add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(2, operations3), WebAnimationCurve::TimingFunctionTypeLinear); + EXPECT_FLOAT_EQ(2, curve->getValue(-1).m41()); + EXPECT_FLOAT_EQ(2, curve->getValue(0).m41()); + EXPECT_FLOAT_EQ(3, curve->getValue(0.5).m41()); + EXPECT_FLOAT_EQ(4, curve->getValue(1).m41()); + EXPECT_FLOAT_EQ(6, curve->getValue(1.5).m41()); + EXPECT_FLOAT_EQ(8, curve->getValue(2).m41()); + EXPECT_FLOAT_EQ(8, curve->getValue(3).m41()); } // Tests that a transform animation with multiple keys at a given time works sanely. TEST(WebTransformAnimationCurveTest, RepeatedTransformKeyTimes) { // A step function. - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(4, 0, 0); WebKit::WebTransformOperations operations2; @@ -105,159 +105,159 @@ TEST(WebTransformAnimationCurveTest, RepeatedTransformKeyTimes) operations3.appendTranslate(6, 0, 0); WebKit::WebTransformOperations operations4; operations4.appendTranslate(6, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebTransformKeyframe(1, operations3), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebTransformKeyframe(2, operations4), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(1, operations3), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(2, operations4), WebAnimationCurve::TimingFunctionTypeLinear); - EXPECT_FLOAT_EQ(4, curve.getValue(-1).m41()); - EXPECT_FLOAT_EQ(4, curve.getValue(0).m41()); - EXPECT_FLOAT_EQ(4, curve.getValue(0.5).m41()); + EXPECT_FLOAT_EQ(4, curve->getValue(-1).m41()); + EXPECT_FLOAT_EQ(4, curve->getValue(0).m41()); + EXPECT_FLOAT_EQ(4, curve->getValue(0.5).m41()); // There is a discontinuity at 1. Any value between 4 and 6 is valid. - WebTransformationMatrix value = curve.getValue(1); + WebTransformationMatrix value = curve->getValue(1); EXPECT_TRUE(value.m41() >= 4 && value.m41() <= 6); - EXPECT_FLOAT_EQ(6, curve.getValue(1.5).m41()); - EXPECT_FLOAT_EQ(6, curve.getValue(2).m41()); - EXPECT_FLOAT_EQ(6, curve.getValue(3).m41()); + EXPECT_FLOAT_EQ(6, curve->getValue(1.5).m41()); + EXPECT_FLOAT_EQ(6, curve->getValue(2).m41()); + EXPECT_FLOAT_EQ(6, curve->getValue(3).m41()); } // Tests that the keyframes may be added out of order. TEST(WebTransformAnimationCurveTest, UnsortedKeyframes) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(2, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(4, 0, 0); WebKit::WebTransformOperations operations3; operations3.appendTranslate(8, 0, 0); - curve.add(WebTransformKeyframe(2, operations3), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); - - EXPECT_FLOAT_EQ(2, curve.getValue(-1).m41()); - EXPECT_FLOAT_EQ(2, curve.getValue(0).m41()); - EXPECT_FLOAT_EQ(3, curve.getValue(0.5).m41()); - EXPECT_FLOAT_EQ(4, curve.getValue(1).m41()); - EXPECT_FLOAT_EQ(6, curve.getValue(1.5).m41()); - EXPECT_FLOAT_EQ(8, curve.getValue(2).m41()); - EXPECT_FLOAT_EQ(8, curve.getValue(3).m41()); + curve->add(WebTransformKeyframe(2, operations3), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + + EXPECT_FLOAT_EQ(2, curve->getValue(-1).m41()); + EXPECT_FLOAT_EQ(2, curve->getValue(0).m41()); + EXPECT_FLOAT_EQ(3, curve->getValue(0.5).m41()); + EXPECT_FLOAT_EQ(4, curve->getValue(1).m41()); + EXPECT_FLOAT_EQ(6, curve->getValue(1.5).m41()); + EXPECT_FLOAT_EQ(8, curve->getValue(2).m41()); + EXPECT_FLOAT_EQ(8, curve->getValue(3).m41()); } // Tests that a cubic bezier timing function works as expected. TEST(WebTransformAnimationCurveTest, CubicBezierTimingFunction) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(1, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), 0.25, 0, 0.75, 1); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); - EXPECT_FLOAT_EQ(0, curve.getValue(0).m41()); - EXPECT_LT(0, curve.getValue(0.25).m41()); - EXPECT_GT(0.25, curve.getValue(0.25).m41()); - EXPECT_FLOAT_EQ(0.5, curve.getValue(0.5).m41()); - EXPECT_LT(0.75, curve.getValue(0.75).m41()); - EXPECT_GT(1, curve.getValue(0.75).m41()); - EXPECT_FLOAT_EQ(1, curve.getValue(1).m41()); + curve->add(WebTransformKeyframe(0, operations1), 0.25, 0, 0.75, 1); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + EXPECT_FLOAT_EQ(0, curve->getValue(0).m41()); + EXPECT_LT(0, curve->getValue(0.25).m41()); + EXPECT_GT(0.25, curve->getValue(0.25).m41()); + EXPECT_FLOAT_EQ(0.5, curve->getValue(0.5).m41()); + EXPECT_LT(0.75, curve->getValue(0.75).m41()); + EXPECT_GT(1, curve->getValue(0.75).m41()); + EXPECT_FLOAT_EQ(1, curve->getValue(1).m41()); } // Tests that an ease timing function works as expected. TEST(WebTransformAnimationCurveTest, EaseTimingFunction) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(1, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeEase); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeEase); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time).m41()); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time).m41()); } } // Tests using a linear timing function. TEST(WebTransformAnimationCurveTest, LinearTimingFunction) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(1, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(time, curve.getValue(time).m41()); + EXPECT_FLOAT_EQ(time, curve->getValue(time).m41()); } } // Tests that an ease in timing function works as expected. TEST(WebTransformAnimationCurveTest, EaseInTimingFunction) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(1, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeEaseIn); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeEaseIn); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseInTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time).m41()); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time).m41()); } } // Tests that an ease in timing function works as expected. TEST(WebTransformAnimationCurveTest, EaseOutTimingFunction) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(1, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeEaseOut); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeEaseOut); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseOutTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time).m41()); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time).m41()); } } // Tests that an ease in timing function works as expected. TEST(WebTransformAnimationCurveTest, EaseInOutTimingFunction) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(1, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeEaseInOut); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations1), WebAnimationCurve::TimingFunctionTypeEaseInOut); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseInOutTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time).m41()); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time).m41()); } } // Tests that an ease in timing function works as expected. TEST(WebTransformAnimationCurveTest, CustomBezierTimingFunction) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); double x1 = 0.3; double y1 = 0.2; double x2 = 0.8; @@ -266,31 +266,31 @@ TEST(WebTransformAnimationCurveTest, CustomBezierTimingFunction) operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(1, 0, 0); - curve.add(WebTransformKeyframe(0, operations1), x1, y1, x2, y2); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations1), x1, y1, x2, y2); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCCubicBezierTimingFunction::create(x1, y1, x2, y2)); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time).m41()); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time).m41()); } } // Tests that the default timing function is indeed ease. TEST(WebTransformAnimationCurveTest, DefaultTimingFunction) { - WebTransformAnimationCurve curve; + OwnPtr<WebTransformAnimationCurve> curve = adoptPtr(WebTransformAnimationCurve::create()); WebKit::WebTransformOperations operations1; operations1.appendTranslate(0, 0, 0); WebKit::WebTransformOperations operations2; operations2.appendTranslate(1, 0, 0); - curve.add(WebTransformKeyframe(0, operations1)); - curve.add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); + curve->add(WebTransformKeyframe(0, operations1)); + curve->add(WebTransformKeyframe(1, operations2), WebAnimationCurve::TimingFunctionTypeLinear); OwnPtr<WebCore::CCTimingFunction> timingFunction(WebCore::CCEaseTimingFunction::create()); for (int i = 0; i <= 4; ++i) { const double time = i * 0.25; - EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve.getValue(time).m41()); + EXPECT_FLOAT_EQ(timingFunction->getValue(time), curve->getValue(time).m41()); } } diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog index a22e49348..cc655735b 100644 --- a/Source/WebKit/efl/ChangeLog +++ b/Source/WebKit/efl/ChangeLog @@ -1,3 +1,15 @@ +2012-08-23 Ryuan Choi <ryuan.choi@samsung.com> + + [EFL] Remove ewk_tile_matrix_tile_update. + https://bugs.webkit.org/show_bug.cgi?id=63437 + + Reviewed by Gyuyoung Kim. + + * ewk/ewk_tiled_matrix.cpp: + Removed ewk_tile_matrix_tile_update and ewk_tile_matrix_tile_update_full + which are dead code. + * ewk/ewk_tiled_matrix_private.h: Ditto. + 2012-08-21 Kihong Kwon <kihong.kwon@samsung.com> [EFL][GTK][BlackBerry] Fix build error in the DeviceOrientationClient diff --git a/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp b/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp index a14a1d7e5..f93764fe5 100644 --- a/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp +++ b/Source/WebKit/efl/ewk/ewk_tiled_matrix.cpp @@ -523,59 +523,6 @@ Eina_Bool ewk_tile_matrix_tile_put(Ewk_Tile_Matrix* tileMatrix, Ewk_Tile* tile, return ewk_tile_unused_cache_tile_put(tileMatrix->tileUnusedCache, tile, _ewk_tile_matrix_tile_free, tileMatrix); } -Eina_Bool ewk_tile_matrix_tile_update(Ewk_Tile_Matrix* tileMatrix, unsigned long col, unsigned long row, const Eina_Rectangle* update) -{ - Eina_Rectangle newUpdate; - EINA_SAFETY_ON_NULL_RETURN_VAL(tileMatrix, false); - EINA_SAFETY_ON_NULL_RETURN_VAL(update, false); - - memcpy(&newUpdate, update, sizeof(newUpdate)); - // check update is valid, otherwise return false - if (update->x < 0 || update->y < 0 || update->w <= 0 || update->h <= 0) { - ERR("invalid update region."); - return false; - } - - if (update->x + update->w - 1 >= tileMatrix->tile.width) - newUpdate.w = tileMatrix->tile.width - update->x; - if (update->y + update->h - 1 >= tileMatrix->tile.height) - newUpdate.h = tileMatrix->tile.height - update->y; - - Ewk_Tile* tile = static_cast<Ewk_Tile*>(eina_matrixsparse_data_idx_get(tileMatrix->matrix, row, col)); - if (!tile) - return true; - - if (!tile->updates && !tile->stats.full_update) - tileMatrix->updates = eina_list_append(tileMatrix->updates, tile); - ewk_tile_update_area(tile, &newUpdate); - - return true; -} - -Eina_Bool ewk_tile_matrix_tile_update_full(Ewk_Tile_Matrix* tileMatrix, unsigned long column, unsigned long row) -{ - Eina_Matrixsparse_Cell* cell; - EINA_SAFETY_ON_NULL_RETURN_VAL(tileMatrix, false); - - if (!eina_matrixsparse_cell_idx_get(tileMatrix->matrix, row, column, &cell)) - return false; - - if (!cell) - return true; - - Ewk_Tile* tile = static_cast<Ewk_Tile*>(eina_matrixsparse_cell_data_get(cell)); - if (!tile) { - CRITICAL("matrix cell with no tile!"); - return true; - } - - if (!tile->updates && !tile->stats.full_update) - tileMatrix->updates = eina_list_append(tileMatrix->updates, tile); - ewk_tile_update_full(tile); - - return true; -} - void ewk_tile_matrix_tile_updates_clear(Ewk_Tile_Matrix* tileMatrix, Ewk_Tile* tile) { EINA_SAFETY_ON_NULL_RETURN(tileMatrix); diff --git a/Source/WebKit/efl/ewk/ewk_tiled_matrix_private.h b/Source/WebKit/efl/ewk/ewk_tiled_matrix_private.h index b3793b5c7..151ebb0b7 100644 --- a/Source/WebKit/efl/ewk/ewk_tiled_matrix_private.h +++ b/Source/WebKit/efl/ewk/ewk_tiled_matrix_private.h @@ -44,8 +44,6 @@ Ewk_Tile *ewk_tile_matrix_tile_nearest_get(Ewk_Tile_Matrix *tm, unsigned long co Ewk_Tile *ewk_tile_matrix_tile_new(Ewk_Tile_Matrix *tm, Evas *evas, unsigned long col, unsigned long row, float zoom); Eina_Bool ewk_tile_matrix_tile_put(Ewk_Tile_Matrix *tm, Ewk_Tile *t, double last_used); -Eina_Bool ewk_tile_matrix_tile_update(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row, const Eina_Rectangle *update); -Eina_Bool ewk_tile_matrix_tile_update_full(Ewk_Tile_Matrix *tm, unsigned long col, unsigned long row); void ewk_tile_matrix_tile_updates_clear(Ewk_Tile_Matrix *tm, Ewk_Tile *t); Eina_Bool ewk_tile_matrix_update(Ewk_Tile_Matrix *tm, const Eina_Rectangle *update, float zoom); diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog index 53112e658..e156f61d2 100644 --- a/Source/WebKit/mac/ChangeLog +++ b/Source/WebKit/mac/ChangeLog @@ -1,3 +1,20 @@ +2012-08-23 Mark Hahnenberg <mhahnenberg@apple.com> + + Change behavior of MasqueradesAsUndefined to better accommodate DFG changes + https://bugs.webkit.org/show_bug.cgi?id=93884 + + Reviewed by Filip Pizlo. + + With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of + MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines, + we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined + objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject). + For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not + masquerade as undefined within frame B, but it will continue to masquerade in frame A. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::addValueToArray): Passing ExecState to toBoolean call. + 2012-08-22 Beth Dakin <bdakin@apple.com> https://bugs.webkit.org/show_bug.cgi?id=94401 diff --git a/Source/WebKit/mac/Configurations/Version.xcconfig b/Source/WebKit/mac/Configurations/Version.xcconfig index c88c7e97b..ac1a2c149 100644 --- a/Source/WebKit/mac/Configurations/Version.xcconfig +++ b/Source/WebKit/mac/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 537; -MINOR_VERSION = 6; +MINOR_VERSION = 8; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm index 4a7d3d266..91044305f 100644 --- a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm +++ b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm @@ -1271,7 +1271,7 @@ void NetscapePluginInstanceProxy::addValueToArray(NSMutableArray *array, ExecSta [array addObject:[NSNumber numberWithDouble:value.toNumber(exec)]]; } else if (value.isBoolean()) { [array addObject:[NSNumber numberWithInt:BoolValueType]]; - [array addObject:[NSNumber numberWithBool:value.toBoolean()]]; + [array addObject:[NSNumber numberWithBool:value.toBoolean(exec)]]; } else if (value.isNull()) [array addObject:[NSNumber numberWithInt:NullValueType]]; else if (value.isObject()) { diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog index 96ce099ee..319a75ceb 100644 --- a/Source/WebKit/win/ChangeLog +++ b/Source/WebKit/win/ChangeLog @@ -1,3 +1,22 @@ +2012-08-23 Adrienne Walker <enne@google.com> + + Convert ScrollableArea ASSERT_NOT_REACHED virtuals + https://bugs.webkit.org/show_bug.cgi?id=93306 + + Reviewed by Darin Adler. + + Add implementations where necessary to make derived classes concrete. + Add OVERRIDE for ScrollableArea functions. + + * WebScrollBar.cpp: + (WebScrollBar::visibleHeight): + (WebScrollBar::visibleWidth): + (WebScrollBar::contentsSize): + (WebScrollBar::isOnActivePage): + (WebScrollBar::scrollableAreaBoundingBox): + * WebScrollBar.h: + (WebScrollBar): + 2012-08-22 Nikhil Bhargava <nbhargava@google.com> Reduce Font.h includes across project -- improves RenderObject.h compile time diff --git a/Source/WebKit/win/WebScrollBar.cpp b/Source/WebKit/win/WebScrollBar.cpp index d3388c3d9..f172196b3 100644 --- a/Source/WebKit/win/WebScrollBar.cpp +++ b/Source/WebKit/win/WebScrollBar.cpp @@ -284,3 +284,28 @@ Scrollbar* WebScrollBar::verticalScrollbar() const { return m_scrollBar->orientation() == VerticalScrollbar ? m_scrollBar.get() : 0; } + +int WebScrollBar::visibleHeight() const +{ + return m_scrollBar->height(); +} + +int WebScrollBar::visibleWidth() const +{ + return m_scrollBar->width(); +} + +WebCore::IntSize WebScrollBar::contentsSize() const +{ + return m_scrollBar->frameRect().size(); +} + +bool WebScrollBar::isOnActivePage() const +{ + return true; +} + +WebCore::IntRect WebScrollBar::scrollableAreaBoundingBox() const +{ + return m_scrollBar->frameRect(); +} diff --git a/Source/WebKit/win/WebScrollBar.h b/Source/WebKit/win/WebScrollBar.h index c97d0d701..dfd1ef040 100644 --- a/Source/WebKit/win/WebScrollBar.h +++ b/Source/WebKit/win/WebScrollBar.h @@ -117,6 +117,11 @@ protected: virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&); virtual void invalidateScrollCornerRect(const WebCore::IntRect&) { } virtual WebCore::ScrollableArea* enclosingScrollableArea() const { return 0; } + virtual int visibleHeight() const OVERRIDE; + virtual int visibleWidth() const OVERRIDE; + virtual WebCore::IntSize contentsSize() const OVERRIDE; + virtual bool isOnActivePage() const OVERRIDE; + virtual WebCore::IntRect scrollableAreaBoundingBox() const OVERRIDE; // FIXME: We should provide a way to set this value. virtual bool isActive() const { return true; } |