[CoordinatedGraphics] Access to LayerTreeRenderer::m_renderQueue should be thread safe
https://bugs.webkit.org/show_bug.cgi?id=101341

Reviewed by Noam Rosenthal.

The queue can be accessed from public API so we should make
sure it is not updated concurrently with a threaded render loop.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::syncRemoteContent):
(WebKit::LayerTreeRenderer::appendUpdate):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(LayerTreeRenderer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: NMI instrument CachedMetadata. It uses ~300k on plus.google.com
https://bugs.webkit.org/show_bug.cgi?id=101067

Reviewed by Yury Semikhatsky.

Plain vanilla instrumentation for CachedMetadata class.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* loader/CachedMetadata.cpp: Added.
(WebCore):
(WebCore::CachedMetadata::reportMemoryUsage):
* loader/CachedMetadata.h:
(CachedMetadata):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[TexMap] Remove unused textures in the texture pool.
https://bugs.webkit.org/show_bug.cgi?id=100706

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

Currently, we do not remove textures in the texture pool of
TextureMapper. The texture pool is destroyed when TextureMapper is
destroyed. It means the texture pool consumes texture memory until its
destruction. This patch removes textures if the textures have been not
used in 3 seconds as LayerTreeCoordinator manages UpdateAtlases.

Changing cache policy is not testable in layout tests.

* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::BitmapTexturePoolEntry::BitmapTexturePoolEntry):
(WebCore::BitmapTexturePoolEntry::markUsed):
(WebCore::BitmapTexturePoolEntry::compareTimeLastUsed):
(BitmapTexturePoolEntry):
(WebCore):
(BitmapTexturePool):
(WebCore::BitmapTexturePool::BitmapTexturePool):
(WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
(WebCore::BitmapTexturePool::acquireTexture):
(WebCore::TextureMapper::acquireTextureFromPool):
(WebCore::TextureMapper::TextureMapper):
(WebCore::TextureMapper::~TextureMapper):
* platform/graphics/texmap/TextureMapper.h:
(WebCore):
(TextureMapper):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][EFL][GTK] early return of checkSpellingOfString treats correct words as misspelled
https://bugs.webkit.org/show_bug.cgi?id=101215

Reviewed by Gustavo Noronha Silva.

Save the misspelled location and length of the string to the default values (-1, 0)
at the beginning of the checkSpellingOfString method.
It assumes that the words are spelled correctly and early return of method doesn't
cause assertions in findFirstMisspelling (WebCore/editing/TextCheckingHelper.cpp).

* platform/text/enchant/TextCheckerEnchant.cpp:
(TextCheckerEnchant::checkSpellingOfString):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: Remove two methods' virtual modifiers in CoordinatedGraphicsLayer.
https://bugs.webkit.org/show_bug.cgi?id=101141

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

The methods exist for only CoordinatedGraphicsLayer and we have no plan to
extend CoordinatedGraphicsLayer.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: Remove a parent member in WebLayerInfo.
https://bugs.webkit.org/show_bug.cgi?id=101142

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

The parent member is not used in UI Process, and GraphicsLayer::setParent is
internally used only, so we don't need to send the parent layer id to UI Process.

* Shared/WebLayerTreeInfo.h:
(WebKit::WebLayerInfo::WebLayerInfo):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::syncLayerState):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133605 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Automatically go fullscreen on video play
https://bugs.webkit.org/show_bug.cgi?id=101100

Patch by Max Feil <mfeil@rim.com> on 2012-11-06
Reviewed by Eric Carlson.

Source/WebCore:

There is a requirement to have HTML5 video automatically enter
fullscreen when a video starts playing (PR131774). This change
implements this feature, with restrictions. The main restriction
is adherence to WebKit's philosophy of only entering fullscreen
due to a user gesture. This is important in order to avoid
pop-up advertisements and other unwanted fullscreen content.
One consequence of this is that video elements with the autoplay
attribute will not automatically enter fullscreen.

Other caveats:
- This feature applies only to "small screen" devices where
automatically going fullscreen makes more sense.
- Fullscreen will only be entered automatically when the
video is played from the beginning (current time is zero).
It is assumed that if the user is resuming play from a paused
state and is not in fullscreen mode, then they exited fullscreen
mode intentionally.

Test: platform/blackberry/media/video-automatic-fullscreen.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerEnterFullscreen):
(WebCore):
(WebCore::HTMLMediaElement::mediaPlayerIsFullscreen):
(WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted):
* html/HTMLMediaElement.h:
(HTMLMediaElement):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerEnterFullscreen):
(WebCore::MediaPlayerClient::mediaPlayerIsFullscreen):
(WebCore::MediaPlayerClient::mediaPlayerIsFullscreenPermitted):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
(WebCore::MediaPlayerPrivate::play):
(WebCore::MediaPlayerPrivate::waitMetadataTimerFired):
(WebCore::MediaPlayerPrivate::conditionallyGoFullscreenAfterPlay):
(WebCore):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
(MediaPlayerPrivate):

LayoutTests:

Test that fullscreen is entered automatically when play is
pressed (PR131774). This test applies to handheld (small screen)
devices only, not tablets. The html code for this test was based
on video-controls-fullscreen-volume.html and modified.

* platform/blackberry/media/video-automatic-fullscreen-expected.txt: Added.
* platform/blackberry/media/video-automatic-fullscreen.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Enable fixed position compositing on Android DRT
https://bugs.webkit.org/show_bug.cgi?id=100263

Patch by Sami Kyostila <skyostil@chromium.org> on 2012-11-06
Reviewed by James Robinson.

Chrome on Android forces composited mode for every page and creates
stacking contexts and graphics layers for fixed positioned elements.
Change the DumpRenderTree settings to match this.

* DumpRenderTree/chromium/DumpRenderTree.cpp:
(main):
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::TestShell):
(TestShell::resetWebSettings):
* DumpRenderTree/chromium/TestShell.h:
(TestShell::setAcceleratedCompositingForFixedPositionEnabled):
(TestShell):
* DumpRenderTree/chromium/WebPreferences.cpp:
(WebPreferences::reset):
(WebPreferences::applyTo):
* DumpRenderTree/chromium/WebPreferences.h:
(WebPreferences):
* Scripts/webkitpy/layout_tests/port/chromium_android.py:
(ChromiumAndroidPort.additional_drt_flag):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[skia] Implement reference (url) filters on composited layers.
https://bugs.webkit.org/show_bug.cgi?id=100142

Reviewed by James Robinson.

Source/Platform:

* chromium/public/WebLayer.h:
Expose Layer::setFilter() to the WebKit API.

Source/WebCore:

Covered by css3/filters/effect-reference-hw.html

* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
Add new files.
* WebCore.xcodeproj/project.pbxproj:
Mark FilterEffect.h as "private".
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::setFilters):
Use the new SkImageFilter builder and setLayer() infrastructure, but
only if there's a reference filter in the chain.
* platform/graphics/filters/FEBlend.h:
* platform/graphics/filters/FEColorMatrix.h:
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::createImageFilter):
Add createImageFilter() factory function for building SkImageFilters.
* platform/graphics/filters/FilterOperation.h:
(WebCore::FilterOperation::ReferenceFilterOperation::filterEffect):
(WebCore::FilterOperation::ReferenceFilterOperation::setFilterEffect):
Add a FilterEffect member to ReferenceFilterOperation, and accessors
for it.
* platform/graphics/filters/skia/FEBlendSkia.cpp:
(WebCore::FEBlend::createImageFilter):
Implement SkImageFilter building for FEBlend filter.
* platform/graphics/filters/skia/FEColorMatrixSkia.cpp:
(WebCore::createColorFilter):
(WebCore::FEColorMatrix::platformApplySkia):
Refactor creation of SkColorFilter from an FEColorMatrix filter.
(WebCore::FEColorMatrix::createImageFilter):
Implement SkImageFilter building for FEColorMatrix filter.
* platform/graphics/filters/skia/FEGaussianBlurSkia.cpp:
(WebCore::FEGaussianBlur::createImageFilter):
Implement SkImageFilter building for FEGaussianBlur filter.
* platform/graphics/filters/skia/FELightingSkia.cpp:
(WebCore::FELighting::createImageFilter):
Implement SkImageFilter building for FELighting filters.
* platform/graphics/filters/skia/FEMorphologySkia.cpp:
(WebCore::FEMorphology::createImageFilter):
Implement SkImageFilter building for FEMorphology filter.
* platform/graphics/filters/skia/SkiaImageFilterBuilder.cpp: Added.
(WebCore::SkiaImageFilterBuilder::SkiaImageFilterBuilder):
(WebCore::SkiaImageFilterBuilder::build):
* platform/graphics/filters/skia/SkiaImageFilterBuilder.h:
Implement new helper class for building an SkImageFilter DAG from
a FilterEffect DAG.  Can also build from FilterOperations list.
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):
When building FilterEffects from a reference filter, also store the
generated DAG on the ReferenceFilterOperation itself.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateOrRemoveFilterEffect):
Even when in composited mode, if there's a reference filter in the
chain, build the FilterEffect DAG from it.

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