[Chromium] Use GL_CHROMIUM_command_buffer_query to throttle texture uploads.
https://bugs.webkit.org/show_bug.cgi?id=81004

Patch by David Reveman <reveman@chromium.org> on 2012-05-07
Reviewed by Adrienne Walker.

Source/WebCore:

Add ThrottledTextureUploader class that uses GL_CHROMIUM_command_buffer_query
to throttle texture uploads based on number of currently pending queries.

Unit test: ThrottledTextureUploaderTest.IsBusy

* WebCore.gypi:
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::create):
(WebCore::LayerRendererChromium::LayerRendererChromium):
(WebCore::LayerRendererChromium::initializeSharedObjects):
* platform/graphics/chromium/LayerRendererChromium.h:
(LayerRendererChromium):
* platform/graphics/chromium/TextureUploader.cpp: Removed.
* platform/graphics/chromium/TextureUploader.h:
(TextureUploader):
* platform/graphics/chromium/ThrottledTextureUploader.cpp: Added.
(WebCore):
(WebCore::ThrottledTextureUploader::Query::Query):
(WebCore::ThrottledTextureUploader::Query::~Query):
(WebCore::ThrottledTextureUploader::Query::begin):
(WebCore::ThrottledTextureUploader::Query::end):
(WebCore::ThrottledTextureUploader::Query::isPending):
(WebCore::ThrottledTextureUploader::Query::wait):
(WebCore::ThrottledTextureUploader::ThrottledTextureUploader):
(WebCore::ThrottledTextureUploader::~ThrottledTextureUploader):
(WebCore::ThrottledTextureUploader::isBusy):
(WebCore::ThrottledTextureUploader::beginUploads):
(WebCore::ThrottledTextureUploader::endUploads):
(WebCore::ThrottledTextureUploader::uploadTexture):
(WebCore::ThrottledTextureUploader::processQueries):
* platform/graphics/chromium/ThrottledTextureUploader.h: Copied from Source/WebCore/platform/graphics/chromium/TextureUploader.h.
(WebCore):
(ThrottledTextureUploader):
(WebCore::ThrottledTextureUploader::create):
(Query):
(WebCore::ThrottledTextureUploader::Query::create):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::initializeLayerRenderer):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(UnthrottledTextureUploader):
(WebCore::UnthrottledTextureUploader::create):
(WebCore::UnthrottledTextureUploader::~UnthrottledTextureUploader):
(WebCore::UnthrottledTextureUploader::isBusy):
(WebCore::UnthrottledTextureUploader::beginUploads):
(WebCore::UnthrottledTextureUploader::endUploads):
(WebCore::UnthrottledTextureUploader::uploadTexture):
(WebCore::UnthrottledTextureUploader::UnthrottledTextureUploader):
(WebCore):
(WebCore::CCSingleThreadProxy::initializeLayerRenderer):
(WebCore::CCSingleThreadProxy::recreateContext):
(WebCore::CCSingleThreadProxy::doCommit):
* platform/graphics/chromium/cc/CCTextureUpdater.cpp:
(WebCore::CCTextureUpdater::update):
* platform/graphics/chromium/cc/CCTextureUpdater.h:
(CCTextureUpdater):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore):
(UnthrottledTextureUploader):
(WebCore::UnthrottledTextureUploader::create):
(WebCore::UnthrottledTextureUploader::~UnthrottledTextureUploader):
(WebCore::UnthrottledTextureUploader::isBusy):
(WebCore::UnthrottledTextureUploader::beginUploads):
(WebCore::UnthrottledTextureUploader::endUploads):
(WebCore::UnthrottledTextureUploader::uploadTexture):
(WebCore::UnthrottledTextureUploader::UnthrottledTextureUploader):
(WebCore::CCThreadProxy::initializeLayerRendererOnImplThread):
(WebCore::CCThreadProxy::recreateContextOnImplThread):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/CCLayerTreeHostImplTest.cpp:
(WebKitTests::TEST_F):
* tests/CCTiledLayerTestCommon.h:
(WebKitTests::FakeTextureUploader::isBusy):
(WebKitTests::FakeTextureUploader::beginUploads):
(WebKitTests::FakeTextureUploader::endUploads):
* tests/Canvas2DLayerChromiumTest.cpp:
* tests/LayerRendererChromiumTest.cpp:
(FakeLayerRendererChromium::FakeLayerRendererChromium):
(LayerRendererChromiumTest::LayerRendererChromiumTest):
(TEST):
* tests/ThrottledTextureUploaderTest.cpp: Added.
(WebKit):
(FakeWebGraphicsContext3DWithQueryTesting):
(WebKit::FakeWebGraphicsContext3DWithQueryTesting::FakeWebGraphicsContext3DWithQueryTesting):
(WebKit::FakeWebGraphicsContext3DWithQueryTesting::getQueryObjectuivEXT):
(WebKit::FakeWebGraphicsContext3DWithQueryTesting::setResultAvailable):
(WebKit::TEST):
* tests/TiledLayerChromiumTest.cpp:
(WTF::TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Qt build fix in Debug.

We need some system includes here for getpid() to be recognized.

Source/WebKit2:

* qt/MainQt.cpp:

Tools:

* WebKitTestRunner/qt/main.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Selection Background Color Error
https://bugs.webkit.org/show_bug.cgi?id=80382

Patch by Shezan Baig <shezbaig.wk@gmail.com> on 2012-05-07
Reviewed by David Hyatt.

Source/WebCore:

Determine the text colors and selection colors before painting the
background behind the text.  This is because when determining whether
to invert the selection background, the selection text color should be
used instead of the regular text color.  With this patch, the selection
text color is passed to 'paintSelection' so that the selection
background can be compared against it, instead of comparing against the
CSSPropertyColor value.

Test: fast/backgrounds/selection-background-color.html

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
    Pass selection text color to paintSelection

(WebCore::InlineTextBox::paintSelection):
    Use the selection text color instead of CSSPropertyColor

* rendering/InlineTextBox.h:
(InlineTextBox):
    Adjust signature of paintSelection to accept text color

LayoutTests:

Added new test case for selection background color.

* fast/backgrounds/selection-background-color.html: Added.
* fast/backgrounds/selection-background-color-expected.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix compositing expectations to not include leopard.

Unreviewed, expectations change.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update media/ pixel test results after r115749.

* platform/mac/media/audio-controls-rendering-expected.png:
* platform/mac/media/controls-after-reload-expected.png:
* platform/mac/media/controls-layout-direction-expected.png:
* platform/mac/media/controls-strict-expected.png:
* platform/mac/media/media-controls-clone-expected.png:
* platform/mac/media/video-controls-rendering-expected.png:
* platform/mac/media/video-display-toggle-expected.png:
* platform/mac/media/video-layer-crash-expected.png:
* platform/mac/media/video-playing-and-pause-expected.png:

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