Optimize the texture packing for texImage2D() and texSubImage2D() in WebGL
https://bugs.webkit.org/show_bug.cgi?id=105821

Patch by Jun Jiang <jun.a.jiang@intel.com> on 2013-01-22
Reviewed by Kenneth Russell.

The original texture packing code uses function pointers to denote each unpack and pack operations for different combination of Source formats,
Destination formats and Alpha Operations. It could be made cleaner and simpler. In this patch, template functions are used and try best to avoid
generating useless code for unreachable path to avoid code bloat. Moreover, the flipY operation is moved into the pack operation instead of
operating in a standalone method to improve performance.

Already covered by current test.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::texImage2DImpl):
(WebCore::WebGLRenderingContext::texSubImage2DImpl):
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::packImageData):
(WebCore::GraphicsContext3D::extractImageData):
(WebCore::GraphicsContext3D::extractTextureData):
(WebCore):
(WebCore::GraphicsContext3D::packPixels):
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::srcFormatComeFromDOMElementOrImageData):
(GraphicsContext3D):
(WebCore::GraphicsContext3D::ImageExtractor::imageSourceFormat):
(ImageExtractor):
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::getSourceDataFormat):
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
* platform/graphics/qt/GraphicsContext3DQt.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):
* platform/graphics/skia/GraphicsContext3DSkia.cpp:
(WebCore::GraphicsContext3D::ImageExtractor::extractImage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Use a platform strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* platform/PlatformStrategies.h:
Add a way to create/get the storage strategy.

* storage/StorageNamespace.cpp:
(WebCore::StorageNamespace::localStorageNamespace):
(WebCore::StorageNamespace::sessionStorageNamespace):
Call the storage strategy.

* storage/StorageNamespace.h:
* storage/StorageStrategy.cpp: Added.
(WebCore::StorageStrategy::localStorageNamespace):
(WebCore::StorageStrategy::sessionStorageNamespace):
Call through to StorageNamespaceImpl.

* storage/StorageStrategy.h: Added.

Source/WebKit/efl: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/PlatformStrategiesEfl.cpp:
(PlatformStrategiesEfl::createStorageStrategy):
* WebCoreSupport/PlatformStrategiesEfl.h:
(PlatformStrategiesEfl):

Source/WebKit/gtk: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/PlatformStrategiesGtk.cpp:
(PlatformStrategiesGtk::createStorageStrategy):
* WebCoreSupport/PlatformStrategiesGtk.h:
(PlatformStrategiesGtk):

Source/WebKit/mac: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::createStorageStrategy):

Source/WebKit/qt: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/PlatformStrategiesQt.cpp:
(PlatformStrategiesQt::createStorageStrategy):
* WebCoreSupport/PlatformStrategiesQt.h:
(PlatformStrategiesQt):

Source/WebKit/win: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createStorageStrategy):
* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):

Source/WebKit/wince: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebCoreSupport/PlatformStrategiesWinCE.cpp:
(PlatformStrategiesWinCE::createStorageStrategy):
* WebCoreSupport/PlatformStrategiesWinCE.h:
(PlatformStrategiesWinCE):

Source/WebKit2: Use a platforom strategy for local storage
https://bugs.webkit.org/show_bug.cgi?id=107600

Reviewed by Andreas Kling.

Update for new storage strategy.

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createStorageStrategy):
(WebKit):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):


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