[chromium] Evict textures through the texture manager instead of the resource provider
https://bugs.webkit.org/show_bug.cgi?id=96463

Patch by Christopher Cameron <ccameron@chromium.org> on 2012-09-12
Reviewed by James Robinson.

Source/WebCore:

When deleting contents textures' resources on the impl thread, do the
deletion through the CCPrioritizedTextureManager instead of the
CCResourceProvider.

This requires traversing the backings list on the impl thread while
the main thread is running, so remove the one remaining traversal of
the backings list by the main thread. This traversal happens when
unlinking textures that were evicted by the impl thread, so explicitly
send the list of evicted backings from the impl thread to the main thread.

Unify all resource deletion paths in the CCPrioritizedTextureManager.
Always perform the sequence of eviction (deleting the GL resource) and
then destruction of evicted backings (deleting the objects).  Also,
use the same function (evictBackingsToReduceMemory) to reduce memory
consumption both during commit and when done by the impl thread in response
to a request by the GPU memory manager.

Note that destroying only some of the resources at a time during texture
eviction (as opposed all resources) is still not supported because the
texture upload queues cannot be only-partially invalidated yet.

Updated tests to take this behavior into account.

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::reduceContentsTexturesMemoryOnImplThread):
(WebCore):
(WebCore::CCLayerTreeHost::getEvictedContentTexturesBackings):
(WebCore::CCLayerTreeHost::unlinkEvictedContentTexturesBackings):
(WebCore::CCLayerTreeHost::deleteEvictedContentTexturesBackings):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::releaseContentsTextures):
(WebCore::CCLayerTreeHostImpl::setContentsTexturesPurged):
(WebCore):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImplClient):
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp:
(WebCore::CCPrioritizedTextureManager::~CCPrioritizedTextureManager):
(WebCore::CCPrioritizedTextureManager::acquireBackingTextureIfNeeded):
(WebCore::CCPrioritizedTextureManager::evictBackingsToReduceMemory):
(WebCore::CCPrioritizedTextureManager::reduceMemory):
(WebCore::CCPrioritizedTextureManager::clearAllMemory):
(WebCore::CCPrioritizedTextureManager::reduceMemoryOnImplThread):
(WebCore::CCPrioritizedTextureManager::getEvictedBackings):
(WebCore::CCPrioritizedTextureManager::unlinkEvictedBackings):
(WebCore):
(WebCore::CCPrioritizedTextureManager::deleteEvictedBackings):
(WebCore::CCPrioritizedTextureManager::evictBackingResource):
* platform/graphics/chromium/cc/CCPrioritizedTextureManager.h:
(CCPrioritizedTextureManager):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::releaseContentsTexturesOnImplThread):
(WebCore):
(WebCore::CCSingleThreadProxy::commitAndComposite):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::releaseContentsTexturesOnImplThread):
(WebCore):
(WebCore::CCThreadProxy::scheduledActionBeginFrame):
(WebCore::CCThreadProxy::beginFrame):
(WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
(WebCore::CCThreadProxy::layerTreeHostClosedOnImplThread):
(WebCore::CCThreadProxy::recreateContextOnImplThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:
(BeginFrameAndCommitState):
(CCThreadProxy):

Source/WebKit/chromium:

Update layer tree host impl test to include the extra interface functions
added to CCLayerTreeHostImplClient.

* tests/CCLayerTreeHostImplTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fixed for http://trac.webkit.org/changeset/128243

Unreviewed build fix.

Change UnicodeString::extract for gcc based on ICU fix described in
http://bugs.icu-project.org/trac/ticket/8197.

* icu/unicode/unistr.h:
(UnicodeString::extract):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Inline repainting can be off-by-one with sub-pixel enabled
https://bugs.webkit.org/show_bug.cgi?id=95882

Reviewed by Eric Seidel.

Source/WebCore: 

With sub-pixel layout enabled, context accumulated from containing renderers is used to properly
pixel snap. Selection repaint rects are stored outside the affected renderers, and are handed to
the embedder without the context to correctly determine the snapped values. This can result in
repaint areas smaller than what's needed.

This could be fixed three ways:
- by changing selection repaint rects to an IntRect and pixel snapping the values before storing
  them outside the render tree. This is the narrowest solution.
- by adapting layout to store pixel snapping hints along with the size/location of the renderer.
  This is the best possible solution, as it would help solve a lot of pixel snapping issues and
  reduce complexity of handling. I eventually intend on implementing this.
- by reverting repaintUsingContainer to IntRects and using pixel snapping when possible, and
  enclosingIntRect where we lack context.

This implements the last solution, as it's the least invasive, but can potentially fix numerous
sub-pixel repaint issues.

Test: fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::layoutRunsAndFloats):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::repaintIncludingNonCompositingDescendants):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintUsingContainer):
(WebCore::RenderObject::repaint):
(WebCore::RenderObject::repaintRectangle):
(WebCore::RenderObject::repaintAfterLayoutIfNeeded):
* rendering/RenderObject.h:
(RenderObject):
* rendering/RenderSelectionInfo.h:
(WebCore::RenderSelectionInfo::repaint):
(WebCore::RenderBlockSelectionInfo::repaint):

LayoutTests: 

Test that we properly repaint selection gaps inside tables with sub-pixel offsets.

* fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt: Added.
* fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html: Added.
* platform/chromium-mac/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png: Added.
* platform/chromium/TestExpectations:
* platform/mac-lion/Skipped:
* platform/mac-snowleopard/Skipped:
* platform/mac-wk2/Skipped:
* platform/mac/Skipped:
* platform/qt-4.8/Skipped:
* platform/qt/Skipped:
* platform/win-wk2/Skipped:
* platform/win-xp/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:
* platform/wk2/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename OVERFLOW_SCROLLING as ACCELERATED_OVERFLOW_SCROLLING
https://bugs.webkit.org/show_bug.cgi?id=96251

Patch by Sami Kyostila <skyostil@google.com> on 2012-09-12
Reviewed by Simon Fraser.

Rename OVERFLOW_SCROLLING as ACCELERATED_OVERFLOW_SCROLLING to better describe
the feature it controls.

.:

* Source/cmakeconfig.h.cmake:

Source/WebCore:

No tests because of no change in runtime behavior.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::usesCompositedScrolling):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:
(StyleRareInheritedData):

Source/WebKit/blackberry:

* WebCoreSupport/AboutDataEnableFeatures.in:

Source/WebKit/chromium:

* features.gypi:

LayoutTests:

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add a virtual test suite for fast/hidpi
https://bugs.webkit.org/show_bug.cgi?id=90192

Patch by Alex Sakhartchouk <alexst@chromium.org> on 2012-09-12
Reviewed by Dirk Pranke.

Tools:

Add a virtual test suite to make sure the pixel tests in fast/hidpi give the same result
on the hardware accelerated path as the software path.

* DumpRenderTree/chromium/WebPreferences.cpp:
(WebPreferences::applyTo):
* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort.virtual_test_suites):

LayoutTests:

Making sure the new virtual tests have matching expectations to non-gpu ones

* platform/chromium/TestExpectations:
* platform/chromium/virtual/gpu/fast/hidpi/README.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r128338): Broke Windows build
https://bugs.webkit.org/show_bug.cgi?id=96537

Unreviewed build fix.

Fix Apple-Win build by allocating array dynamically
since its size is not constant.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-12

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::stringArrayToJS):

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