Add separate settings and preferences to enable/disable async decoding for large...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2016 23:48:00 +0000 (23:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2016 23:48:00 +0000 (23:48 +0000)
commitf77311a7752b04d7f6a5427a49f8c437114856f5
tree761fc12bbbd83085659b37469c14e6281b4e5ffa
parentc4a423075f4bbab27e880c7c68d642d374c19f77
Add separate settings and preferences to enable/disable async decoding for large images and animated images
https://bugs.webkit.org/show_bug.cgi?id=165177

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-11-30
Reviewed by Simon Fraser.
Source/WebCore:

Instead of having the async image decoding be controlled by one setting,
two separate settings are added:
    largeImageAsyncDecodingEnabled
    animatedImageAsyncDecodingEnabled

And an existing setting is removed:
    asyncImageDecodingEnabled

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
* loader/cache/CachedImage.h:
* page/Settings.in:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::internalStartAnimation):
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageObserver.h:

Source/WebKit/mac:

Hook up the async image decoding settings for WebKit1.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences largeImageAsyncDecodingEnabled]):
(-[WebPreferences setLargeImageAsyncDecodingEnabled:]):
(-[WebPreferences animatedImageAsyncDecodingEnabled]):
(-[WebPreferences setAnimatedImageAsyncDecodingEnabled:]):
(-[WebPreferences asyncImageDecodingEnabled]): Deleted.
(-[WebPreferences setAsyncImageDecodingEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Hook up the async image decoding settings for WebKit2.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _largeImageAsyncDecodingEnabled]):
(-[WKPreferences _setLargeImageAsyncDecodingEnabled:]):
(-[WKPreferences _animatedImageAsyncDecodingEnabled]):
(-[WKPreferences _setAnimatedImageAsyncDecodingEnabled:]):
(-[WKPreferences _asyncImageDecodingEnabled]): Deleted.
(-[WKPreferences _setAsyncImageDecodingEnabled:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Pref and a menu item to toggle async image decoding settings for WebKits 1 and 2.

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleLargeImageAsyncDecodingEnabled:]):
(-[SettingsController largeImageAsyncDecodingEnabled]):
(-[SettingsController toggleAnimatedImageAsyncDecodingEnabled:]):
(-[SettingsController animatedImageAsyncDecodingEnabled]):
(-[SettingsController toggleAsyncImageDecodingEnabled:]): Deleted.
(-[SettingsController asyncImageDecodingEnabled]): Deleted.
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/page/Settings.in
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/ImageObserver.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/MiniBrowser/mac/SettingsController.h
Tools/MiniBrowser/mac/SettingsController.m
Tools/MiniBrowser/mac/WK1BrowserWindowController.m
Tools/MiniBrowser/mac/WK2BrowserWindowController.m