Allow ports to decide whether an image should be directly composited
https://bugs.webkit.org/show_bug.cgi?id=101827

Reviewed by Simon Fraser.

Source/WebCore:

Tested by compositing/tiling/huge-layer-img.html.

* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::shouldDirectlyCompositeImage):
    Allow the GraphicsLayer implementation to decide if the image can be composited.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isDirectlyCompositedImage):
    Take onto account the new shouldDirectlyCompositeImage check.

Source/WebKit2:

Implement shouldDirectlyCompositeImage for coordinated graphics, effectively disabling direct
compositing of images with width or height larger than 2000 pixels.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::shouldDirectlyCompositeImage):
(WebCore):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: Rename tileRect from targetRect.
https://bugs.webkit.org/show_bug.cgi?id=101705

Patch by Huang Dongsung <luxtella@company100.net> on 2012-11-09
Reviewed by Noam Rosenthal.

Messages::LayerTreeCoordinatorProxy::CreateTileForLayer contains the targetRect
variable. The targetRect stands for the rect of the tile created. This patch
renames tileRect to enhance the clearity.

* UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStoreTile::swapBuffers):
(WebKit::CoordinatedBackingStoreTile::setBackBuffer):
(WebKit::CoordinatedBackingStore::updateTile):
* UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h:
(CoordinatedBackingStoreTile):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp:
(WebKit::LayerTreeCoordinatorProxy::createTileForLayer):
(WebKit::LayerTreeCoordinatorProxy::updateTileForLayer):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h:
(LayerTreeCoordinatorProxy):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in:
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::updateTile):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(TileUpdate):
(WebKit::LayerTreeRenderer::TileUpdate::TileUpdate):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::createTile):
(WebCore::CoordinatedGraphicsLayer::updateTile):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayerClient):
(CoordinatedGraphicsLayer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedTile.h:
(CoordinatedTileClient):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::createTile):
(WebKit::LayerTreeCoordinator::updateTile):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
(LayerTreeCoordinator):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Move chromium to USE(LAZY_NATIVE_CURSOR)
https://bugs.webkit.org/show_bug.cgi?id=101501

Patch by Rick Byers <rbyers@chromium.org> on 2012-11-09
Reviewed by Adam Barth.

This simplifies cursor handling in chromium and unifies it with other
ports for easier code sharing and testing by moving to the
USE_LAZY_CURSOR model and eliminating PlatformCursor entirely.

PlatformCursor adds no value in chromium since the sandboxing model
requires the cursor information be marshalled to the browser process
before being turned into a real OS cursor.

Test: fast/events/mouse-cursor.html

* WebCore.gypi:
* platform/Cursor.h:
(WebCore):
* platform/chromium/CursorChromium.cpp:
(WebCore::Cursor::Cursor):
(WebCore::Cursor::operator=):
(WebCore::Cursor::~Cursor):
(WebCore::Cursor::ensurePlatformCursor):
* platform/chromium/PlatformCursor.h: Removed.

Source/WebKit/chromium: Move chromium to USE(LAZY_NATIVE_CURSOR)
https://bugs.webkit.org/show_bug.cgi?id=101501

Patch by Rick Byers <rbyers@chromium.org> on 2012-11-09
Reviewed by Adam Barth.

Update conversion from Cursor to WebCursorInfo to remove the
intermediate (and useless) step of PlatformCursor.

* src/AssertMatchingEnums.cpp:
* src/WebCursorInfo.cpp:
(WebKit::WebCursorInfo::WebCursorInfo):

LayoutTests: [chromium] Move to USE(LAZY_NATIVE_CURSOR)
https://bugs.webkit.org/show_bug.cgi?id=101501

Patch by Rick Byers <rbyers@chromium.org> on 2012-11-09
Reviewed by Adam Barth.

Remove failure expectation for fast/events/mouse-cursor.html now that
chromium uses the same cursor architecture as other ports.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Should only fire a single set of mouse events and update hover state once when scrolling is done
https://bugs.webkit.org/show_bug.cgi?id=99940

Reviewed by Levi Weintraub.

Source/WebCore:

-Use a DeferrableOneShotTimer instead of a Timer. By resetting when the
timer is fired, we ensure the actual goal of not firing fake mouse events
until the scroll is completed. This is the core part of this change.
-Change our mouse event throttling to keep a running average of how long
mouse events take and adjust throttling appropriately.
Test: fast/scrolling/fake-mouse-event-throttling.html
-Maintain a minimum throttle of 100ms.

* page/EventHandler.cpp:
(WebCore):
(WebCore::RunningAverageDurationTracker::RunningAverageDurationTracker):
(WebCore::RunningAverageDurationTracker::~RunningAverageDurationTracker):
Keep track of a running average instead of max. This lets us adjust throttling
dynamically without punishing a page for having a single mouse event handler
that takes disproportionately long.
(RunningAverageDurationTracker):
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::clear):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
(WebCore::EventHandler::fakeMouseMoveEventTimerFired):
* page/EventHandler.h:
(EventHandler):
* platform/Timer.h:
(WebCore::DeferrableOneShotTimer::setDelay):
(WebCore::DeferrableOneShotTimer::delay):
Add a way of adjusting the timer delay.

LayoutTests:

Tests basic throttling. I couldn't think of a good way to test changing
the delay that wouldn't make for a test that takes minutes to run.

* fast/scrolling/fake-mouse-event-throttling-expected.txt: Added.
* fast/scrolling/fake-mouse-event-throttling.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134150 268f45cc-cd09-0410-ab3c-d52691b4dbfc