[WebGL] Implement a software rendering option on Mac
https://bugs.webkit.org/show_bug.cgi?id=123177

Reviewed by Tim Horton.

Implement a way to force software OpenGL rendering
for WebGL, via a Setting/Preference.

Source/WebCore:

No new tests. We intentionally hide the capabilities of
the renderer from the content, so you can't test for
this setting. However, manual inspection is pretty
obvious. Just go to a page with a complex shader
such as https://www.shadertoy.com/view/lss3WS.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::create): If we're forcing software
rendering, mark the context attributes as such.
* page/Settings.in: New setting key.
* platform/graphics/GraphicsContext3D.h: New flag in Attributes.
(WebCore::GraphicsContext3D::Attributes::Attributes):
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D): Slight update to the
algorithm that sets a pixel format. If we're forcing software rendering,
obviously we never want to create an accelerated pixel format.
* platform/graphics/filters/CustomFilterGlobalContext.cpp:
(WebCore::CustomFilterGlobalContext::prepareContextIfNeeded): Set the attribute
here before trying to create the context.
* platform/graphics/filters/CustomFilterGlobalContext.h: Add a forceSoftwareRendering
flag to prepareContextIfNeeded.
* rendering/FilterEffectRenderer.cpp:
(WebCore::createCustomFilterEffect): Check the Setting before creating a custom
filter context.

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h: New WebKitForceSoftwareWebGLRendering key.
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences forceSoftwareWebGLRendering]):
(-[WebPreferences setForceSoftwareWebGLRendering:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* Shared/WebPreferencesStore.h: New ForceSoftwareWebGLRendering entry.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetForceSoftwareWebGLRendering):
(WKPreferencesGetForceSoftwareWebGLRendering):
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* mac/WebKit2.order:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of IDBObjectStoreBackendLevelDB
https://bugs.webkit.org/show_bug.cgi?id=123174

Reviewed by Tim Horton.

Source/WebCore:

This file was kind of a dumping ground.
Its contents can be merged into IDBBackingStoreInterface and a new IDBIndexWriter class.

Also took the opportunity to do a little bit of RefPtr<> and pointer-vs-reference cleanup.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.cpp: Removed.
* Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.h: Removed.

* Modules/indexeddb/IDBIndexWriter.cpp: Added.
(WebCore::IDBIndexWriter::IDBIndexWriter):
(WebCore::IDBIndexWriter::writeIndexKeys):
(WebCore::IDBIndexWriter::verifyIndexKeys):
(WebCore::IDBIndexWriter::addingKeyAllowed):
* Modules/indexeddb/IDBIndexWriter.h: Added.
(WebCore::IDBIndexWriter::create):

* Modules/indexeddb/IDBBackingStoreInterface.h:
* Modules/indexeddb/IDBDatabaseBackendInterface.h:

* Modules/indexeddb/IDBMetadata.h:
* Modules/indexeddb/IDBTransactionBackendInterface.h:

* Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
(WebCore::IDBBackingStoreLevelDB::makeIndexWriters):
(WebCore::IDBBackingStoreLevelDB::generateKey):
(WebCore::IDBBackingStoreLevelDB::updateKeyGenerator):
* Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:

* Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.cpp:
(WebCore::IDBDatabaseBackendLevelDB::setIndexKeys):
(WebCore::IDBDatabaseBackendLevelDB::setIndexesReady):
* Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.cpp:
(WebCore::IDBTransactionBackendLevelDB::schedulePutOperation):
* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.cpp:
(WebCore::PutOperation::perform):
* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.h:
(WebCore::PutOperation::create):
(WebCore::PutOperation::PutOperation):

Source/WebKit2:

* WebProcess/Databases/IndexedDB/WebProcessIDBDatabaseBackend.h:

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