Coordinated Graphics: Refactor code related to directly composited images.
https://bugs.webkit.org/show_bug.cgi?id=101023

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

Internal Review by Gwang Yoon Hwang and Jae Hyun Park.

Currently, LayerTreeCoordinator manages composited images using
ShareableBitmap. This patch introduces CoordinatedImageBacking which
plays a role in managing composited images. CoordinatedImageBacking makes us
gather code related to a directly composited image into a single class.

We create only one CoordinatedImageBacking per image. For example, in the leaves
demo, we create only 3 textures of leaves.

* CMakeLists.txt:
* Shared/WebLayerTreeInfo.h:
(WebKit::WebLayerInfo::WebLayerInfo):
(WebLayerInfo):
* Target.pri:
* UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStoreTile::swapBuffers):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp:
(WebKit::LayerTreeCoordinatorProxy::createImageBacking):
(WebKit::LayerTreeCoordinatorProxy::updateImageBacking):
(WebKit):
(WebKit::LayerTreeCoordinatorProxy::removeImageBacking):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h:
(LayerTreeCoordinatorProxy):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in:
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::setLayerState):
(WebKit::LayerTreeRenderer::createImageBacking):
(WebKit::LayerTreeRenderer::updateImageBacking):
(WebKit::LayerTreeRenderer::removeImageBacking):
(WebKit):
(WebKit::LayerTreeRenderer::assignImageBackingToLayer):
(WebKit::LayerTreeRenderer::removeReleasedImageBackingsIfNeeded):
(WebKit::LayerTreeRenderer::flushLayerChanges):
(WebKit::LayerTreeRenderer::purgeGLResources):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(LayerTreeRenderer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsToImage):
(WebCore::CoordinatedGraphicsLayer::syncImageBacking):
(WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded):
(WebCore::CoordinatedGraphicsLayer::beginContentUpdate):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayerClient):
(CoordinatedGraphicsLayer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedImageBacking.cpp: Added.
(WebKit):
(WebKit::CoordinatedImageBacking::getCoordinatedImageBackingID):
(WebKit::CoordinatedImageBacking::create):
(WebKit::CoordinatedImageBacking::CoordinatedImageBacking):
(WebKit::CoordinatedImageBacking::~CoordinatedImageBacking):
(WebKit::CoordinatedImageBacking::addLayerClient):
(WebKit::CoordinatedImageBacking::removeLayerClient):
(WebKit::CoordinatedImageBacking::markDirty):
(WebKit::CoordinatedImageBacking::update):
(WebKit::CoordinatedImageBacking::releaseSurfaceIfNeeded):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedImageBacking.h: Added.
(WebCore):
(WebKit):
(CoordinatedImageBacking):
(Coordinator):
(WebKit::CoordinatedImageBacking::id):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::flushPendingLayerChanges):
(WebKit::LayerTreeCoordinator::createImageBackingIfNeeded):
(WebKit::LayerTreeCoordinator::createImageBacking):
(WebKit::LayerTreeCoordinator::updateImageBacking):
(WebKit::LayerTreeCoordinator::removeImageBacking):
(WebKit::LayerTreeCoordinator::flushPendingImageBackingChanges):
(WebKit::LayerTreeCoordinator::purgeBackingStores):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
(LayerTreeCoordinator):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
custom CSS cursors ignore hotspot values embedded in CUR files
https://bugs.webkit.org/show_bug.cgi?id=100059

Patch by Rick Byers <rbyers@chromium.org> on 2012-11-15
Reviewed by Kenneth Russell.

Source/WebCore:

Add reading the hotspot values to the ICOImageDecoder (for CUR files only),
and plumb it through so that the existing calls to ImageSource::getHotSpot
actually return the hot spot value when there is one.

Tests: fast/events/mouse-cursor.html, fast/events/mouse-cursor-multiframecur.html

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::getHotSpot):
* platform/graphics/chromium/DeferredImageDecoder.cpp:
(WebCore::DeferredImageDecoder::hotSpot):
(WebCore::DeferredImageDecoder::hotSpotAtIndex):
* platform/graphics/chromium/DeferredImageDecoder.h:
(DeferredImageDecoder):
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::hotSpot):
(WebCore::ImageDecoder::hotSpotAtIndex):
(ImageDecoder):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::hotSpot):
(WebCore::ICOImageDecoder::hotSpotAtIndex):
(WebCore::ICOImageDecoder::processDirectory):
(WebCore::ICOImageDecoder::readDirectoryEntry):
* platform/image-decoders/ico/ICOImageDecoder.h:
(ICOImageDecoder):
(IconDirectoryEntry):

LayoutTests:

Add mouse cursor test cases that use CUR files that have embedded hotspot values.

* fast/events/mouse-cursor-expected.txt:
* fast/events/mouse-cursor-multiframecur-expected.txt: Added.
* fast/events/mouse-cursor-multiframecur.html: Copied from LayoutTests/fast/events/mouse-cursor.html.
* fast/events/mouse-cursor.html:
* fast/events/resources/greenbox-3frames.cur: Added.
* fast/events/resources/greenbox-hotspot35-4.cur: Added.
* fast/events/resources/greenbox-hotspot5-4.cur: Added.
* platform/mac/TestExpectations: Skip the multi-frame case on mac because it causes a hang

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