[chromium] Do partial-swap scissoring on quads during draw instead of on layers
https://bugs.webkit.org/show_bug.cgi?id=91800

Reviewed by Adrienne Walker.

Source/WebCore:

Computing the scissor rect for each render pass is now done in
LayerRendererChromium::drawRenderPass() instead of being done for each
layer and then copied into the quads. This allows us to always push a
full frame of quads (and include damage rects) from a child compositor,
and do partial-swap scissoring in the host compositor.

This also make partial-swap functionality completely contained within
LayerRendererChromium!

The scissorRect is removed from all layers, and the concept of
scissorRect is now misplaced in CCOcclusionTracker, so the variables
and methods in the tracker should be renamed to more appropriate
things.

Covered by existing tests, as well as: CCLayerTreeHostImplTest.textureCachingWithScissor

* platform/graphics/chromium/LayerChromium.h:
(LayerChromium):
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::clearFramebuffer):
(WebCore::LayerRendererChromium::renderPassTextureSize):
(WebCore::LayerRendererChromium::drawFrame):
(WebCore::LayerRendererChromium::drawRenderPass):
(WebCore::LayerRendererChromium::drawQuad):
(WebCore::LayerRendererChromium::drawDebugBorderQuad):
(WebCore::LayerRendererChromium::drawBackgroundFilters):
(WebCore::LayerRendererChromium::drawTileQuad):
(WebCore::LayerRendererChromium::swapBuffers):
(WebCore::LayerRendererChromium::useRenderPass):
(WebCore::LayerRendererChromium::setScissorToRect):
* platform/graphics/chromium/LayerRendererChromium.h:
(LayerRendererChromium):
(DrawingFrame):
* platform/graphics/chromium/RenderSurfaceChromium.cpp:
* platform/graphics/chromium/RenderSurfaceChromium.h:
(RenderSurfaceChromium):
* platform/graphics/chromium/cc/CCDrawQuad.h:
(WebCore::CCDrawQuad::clippedRectInTarget):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::createSharedQuadState):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(CCLayerImpl):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::updateLayers):
(WebCore::CCLayerTreeHost::paintLayerContents):
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateVisibleRectsInternal):
(WebCore::CCLayerTreeHostCommon::calculateVisibleRects):
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.h:
(CCLayerTreeHostCommon):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderSurfaceLayerList):
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
(WebCore::CCLayerTreeHostImpl::drawLayers):
(WebCore::CCLayerTreeHostImpl::swapBuffers):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::::layerScissorRectInTargetSurface):
* platform/graphics/chromium/cc/CCRenderPass.cpp:
(WebCore::CCRenderPass::CCRenderPass):
(WebCore::CCRenderPass::appendQuadsToFillScreen):
* platform/graphics/chromium/cc/CCRenderPass.h:
(CCRenderPass):
(WebCore::CCRenderPass::transformToRootTarget):
(WebCore::CCRenderPass::outputRect):
(WebCore::CCRenderPass::damageRect):
(WebCore::CCRenderPass::setDamageRect):
* platform/graphics/chromium/cc/CCRenderSurface.cpp:
(WebCore::computeClippedRectInTarget):
(WebCore):
(WebCore::CCRenderSurface::createSharedQuadState):
(WebCore::CCRenderSurface::createReplicaSharedQuadState):
* platform/graphics/chromium/cc/CCRenderSurface.h:
(CCRenderSurface):
* platform/graphics/chromium/cc/CCRenderer.h:
(CCRenderer):
* platform/graphics/chromium/cc/CCSharedQuadState.cpp:
(WebCore::CCSharedQuadState::create):
(WebCore::CCSharedQuadState::CCSharedQuadState):
* platform/graphics/chromium/cc/CCSharedQuadState.h:
(CCSharedQuadState):
* platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
(WebCore::CCTiledLayerImpl::appendQuads):

Source/WebKit/chromium:

* tests/CCDamageTrackerTest.cpp:
(WebKitTests::executeCalculateDrawTransformsAndVisibility):
* tests/CCLayerIteratorTest.cpp:
* tests/CCLayerTreeHostCommonTest.cpp:
Removed tests of the scissor rect here, as they are no longer
computed within CCLayerTreeHostCommon. Verify that the scissor
does not affect texture caching in CCLayerTreeHostImplTest now.
Previous scissor would affect the texture cache decisions, but
this was incorrect, as damaged areas are always inside the
scissor rect, and anything outside the scissor rect should
be considered as valid and complete (assuming no external
occlusion, which is computed outside the scissor rect now also).

* tests/CCLayerTreeHostImplTest.cpp:
Removed didDrawNotCalledOnScissoredLayer test, as this no longer
applies. didDraw will be called on layers that are outside the
partial swap rect, regardless.

Removed partialSwapNoUpdate test, and merged its functionality into
the partialSwap test while updating its expectations.

Added textureCachingWithScissor, which is loosely based on the
CCLayerTreeHostCommonTest.scissorRectWithClip test.

* tests/CCOcclusionTrackerTest.cpp:
(WebKitTests::CCOcclusionTrackerTest::calcDrawEtc):
(WebKitTests::CCOcclusionTrackerTestChildInRotatedChild::runMyTest):
(WebKitTests::CCOcclusionTrackerTestVisitTargetTwoTimes::runMyTest):
* tests/CCQuadCullerTest.cpp:
* tests/CCRenderSurfaceTest.cpp:
* tests/CCSolidColorLayerImplTest.cpp:
(CCLayerTestCommon::TEST):
* tests/CCTiledLayerImplTest.cpp:
(CCLayerTestCommon::createLayer):
* tests/LayerRendererChromiumTest.cpp:
(LayerRendererChromiumTest::swapBuffers):
(TEST_F):
(TEST):
* tests/TiledLayerChromiumTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [WK2] Add a process model constant for multiple processes
        https://bugs.webkit.org/show_bug.cgi?id=93642

        Reviewed by Anders Carlsson.

        * UIProcess/ProcessModel.h: Added ProcessModelMultipleSecondaryProcesses.
        Deleted ProcessModelSecondaryProcess in favor of more descriptive ProcessModelSharedSecondaryProcess - 
        these used to behave the same.

        * UIProcess/WebContext.cpp: (WebKit::WebContext::create): Changed to use ProcessModelSharedSecondaryProcess.

        * UIProcess/WebProcessProxy.h: Removed an unncessary include of ProcessModel.h.



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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[QNX] Implement getCPUTime() for OS(QNX)
https://bugs.webkit.org/show_bug.cgi?id=93516

Patch by Yong Li <yoli@rim.com> on 2012-08-09
Reviewed by George Staikos.

Implement getCPUTime() with CLOCK_THREAD_CPUTIME_ID so it will tell
exactly how long the current thread has spent without being impacted
by other things.

* runtime/TimeoutChecker.cpp:
(JSC::getCPUTime):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gardening LayoutTests/platform/win/fast/canvas tests folder.
https://bugs.webkit.org/show_bug.cgi?id=93633

Patch by Roger Fong <roger_fong@apple.com> on 2012-08-09
Reviewed by Tim Horton.

These tests pass now.
Adjusting expected results.
Removing other failing results.

* platform/win/fast/canvas/canvas-draw-canvas-on-canvas-shadow-expected.txt:
    This test is now passing. Modifying to passing results since Mac fallback results are failing.
* platform/win/fast/canvas/canvas-scale-drawImage-shadow-expected.txt: Removed.
* platform/win/fast/canvas/canvas-scale-fillPath-shadow-expected.txt: Removed.
* platform/win/fast/canvas/canvas-scale-fillRect-shadow-expected.txt: Removed.
* platform/win/fast/canvas/canvas-transforms-fillRect-shadow-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: replace the Web Inspector editor with CodeMirror
https://bugs.webkit.org/show_bug.cgi?id=92769

Patch by Jan Keromnes <janx@linux.com> on 2012-08-09
Reviewed by Pavel Feldman.

Integrating CodeMirror as a devtools experiment. Currently supporting
basic editing, search/replacing, and saving. Missing proper breakpoints
wiring, debugging, message bubbles, popovers and context menus. WIP.

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/compile-front-end.py:
* inspector/front-end/CodeMirrorTextEditor.js: Added.
(WebInspector.CodeMirrorTextEditor.this._codeMirror.CodeMirror):
(WebInspector.CodeMirrorTextEditor):
(WebInspector.CodeMirrorTextEditor.prototype.set mimeType):
(WebInspector.CodeMirrorTextEditor.prototype.setReadOnly):
(WebInspector.CodeMirrorTextEditor.prototype.readOnly):
(WebInspector.CodeMirrorTextEditor.prototype.defaultFocusedElement):
(WebInspector.CodeMirrorTextEditor.prototype.focus):
(WebInspector.CodeMirrorTextEditor.prototype.revealLine):
(WebInspector.CodeMirrorTextEditor.prototype.addDecoration):
(WebInspector.CodeMirrorTextEditor.prototype.removeDecoration):
(WebInspector.CodeMirrorTextEditor.prototype.markAndRevealRange):
(WebInspector.CodeMirrorTextEditor.prototype.highlightLine):
(WebInspector.CodeMirrorTextEditor.prototype.clearLineHighlight):
(WebInspector.CodeMirrorTextEditor.prototype.freeCachedElements):
(WebInspector.CodeMirrorTextEditor.prototype.elementsToRestoreScrollPositionsFor):
(WebInspector.CodeMirrorTextEditor.prototype.inheritScrollPositions):
(WebInspector.CodeMirrorTextEditor.prototype.beginUpdates):
(WebInspector.CodeMirrorTextEditor.prototype.endUpdates):
(WebInspector.CodeMirrorTextEditor.prototype.onResize):
(WebInspector.CodeMirrorTextEditor.prototype.editRange):
(WebInspector.CodeMirrorTextEditor.prototype._onChange):
(WebInspector.CodeMirrorTextEditor.prototype._commitEditing):
(WebInspector.CodeMirrorTextEditor.prototype.scrollToLine):
(WebInspector.CodeMirrorTextEditor.prototype.selection):
(WebInspector.CodeMirrorTextEditor.prototype.lastSelection):
(WebInspector.CodeMirrorTextEditor.prototype.setSelection):
(WebInspector.CodeMirrorTextEditor.prototype.setText):
(WebInspector.CodeMirrorTextEditor.prototype.text):
(WebInspector.CodeMirrorTextEditor.prototype.range):
(WebInspector.CodeMirrorTextEditor.prototype.line):
(WebInspector.CodeMirrorTextEditor.prototype.get linesCount):
(WebInspector.CodeMirrorTextEditor.prototype.setAttribute):
(WebInspector.CodeMirrorTextEditor.prototype.getAttribute):
(WebInspector.CodeMirrorTextEditor.prototype.removeAttribute):
(WebInspector.CodeMirrorTextEditor.prototype.wasShown):
(WebInspector.CodeMirrorTextEditor.prototype.willHide):
(WebInspector.CodeMirrorTextEditor.prototype._textChanged):
(WebInspector.CodeMirrorTextEditor.prototype._toPos):
(WebInspector.CodeMirrorTextEditor.prototype._toRange):
* inspector/front-end/Settings.js:
(WebInspector.ExperimentsSettings):
* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/cmdevtools.css: Added.
* inspector/front-end/inspector.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS 2.1 failure: 'Text-indent' only affects a line if it is the first formatted line of an element
https://bugs.webkit.org/show_bug.cgi?id=63185

Reviewed by Eric Seidel.

Source/WebCore:

Per CSS 2.1 (http://www.w3.org/TR/CSS21/text.html) : "'Text-indent' only affects a line if it is the
first formatted line of an element. For example, the first line of an anonymous block box is only
affected if it is the first child of its parent element."

Tests: fast/css/text-indent-first-line-001.html
       fast/css/text-indent-first-line-002.html
       fast/css/text-indent-first-line-003.html
       fast/css/text-indent-first-line-004.html
       fast/css/text-indent-first-line-005.html
       fast/css/text-indent-first-line-006.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::computeInlineDirectionPositionsForLine): As well as being the first line under a parent block,
  check that this is also the first *formatted* line of an element by ensuring that we are at the start of a
  formatting context and not just a continuation of a previous anonymous block in an existing formatting context.

LayoutTests:

* css2.1/20110323/text-indent-014-expected.html: Added.
* css2.1/20110323/text-indent-014.htm: Added.
* fast/css/text-indent-first-line-001-expected.html: Added.
* fast/css/text-indent-first-line-001.html: Added.
* fast/css/text-indent-first-line-002-expected.html: Added.
* fast/css/text-indent-first-line-002.html: Added.
* fast/css/text-indent-first-line-003-expected.html: Added.
* fast/css/text-indent-first-line-003.html: Added.
* fast/css/text-indent-first-line-004-expected.html: Added.
* fast/css/text-indent-first-line-004.html: Added.
* fast/css/text-indent-first-line-005-expected.html: Added.
* fast/css/text-indent-first-line-005.html: Added.
  Text-indent in the span here is inherited from the div. CSS 2.1: "Since the 'text-indent'
  property inherits, when specified on a block element, it will affect descendant
  inline-block elements."
* fast/css/text-indent-first-line-006-expected.html: Added.
* fast/css/text-indent-first-line-006.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Extract the definition of NativeImagePtr from ImageSource.h into NativeImagePtr.h.
https://bugs.webkit.org/show_bug.cgi?id=93466

Patch by Huang Dongsung <luxtella@company100.net> on 2012-08-09
Reviewed by Adam Barth.

Image.h includes ImageSource.h in order to know the definition of NativeImagePtr.
But Image does not need to know the definition of ImageSource. So, this patch
extracts the definition of NativeImagePtr from ImageSource.h into NativeImagePtr.h.

This is a preparation for asynchronous image decoding. Async decoding
will need a callback function, which sends a NativeImagePtr to clients, and the
callback must know the definition of NativeImagePtr, not ImageSource.

No new tests, behavior is unchanged.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
* platform/graphics/ImageSource.h:
(WebCore):
* platform/graphics/NativeImagePtr.h: Added.
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nrwt: should log progress like ninja does
https://bugs.webkit.org/show_bug.cgi?id=93563

Reviewed by Ojan Vafai.

This change modifies the output of nrwt in the
non--debug-rwt-logging modes.

In non-verbose mode, the output changes from:
  "Testing (50%): 96 ran as expected, 4 didn't, 100 left"
to:
  "[100/200] foo.html (+4)"
or:
  "[100/200] foo.html failed  unexpectedly (text diff)"

which indicates the earliest test currently running (optionally plus the
count of other currently-executing tests if we're running tests in parallel)
or the result of said test.

If the test produces unexpected results, that line is flushed
rather than erased (so we no longer need the %d didn't running
tally).

In --verbose mode, the output is similar, but every test gets a
line (and tests are logged in order of them being started, not
order of them being completed) (and in --details mode, the
first line of each test matches --verbose but the other lines
are unchanged).

The overall result should be easier to read and is simpler to
implement as well (apart from managing the number of tests that
have started but not completed, which is slightly annoying).

This also matches the output style for test-webkitpy, more-or-less.

* Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
(LayoutTestRunner.run_tests):
(LayoutTestRunner._update_summary_with_result):
(LayoutTestRunner._handle_started_test):
* Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py:
(FakePrinter):
(FakePrinter.print_started_test):
(FakePrinter.print_finished_test):
* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer.__init__):
(Printer.print_started_test):
(Printer.print_finished_test):
(Printer._print_test_trace):
(Printer._print_progress):
* Scripts/webkitpy/layout_tests/views/printing_unittest.py:
(test_details):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[css3-text] Add suport for -webkit-text-decoration-line
https://bugs.webkit.org/show_bug.cgi?id=90959

Patch by Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> on 2012-08-09
Reviewed by Kenneth Rohde Christiansen.

This patch implements the "text-decoration-line" property specified in CSS3
working draft, with "-webkit-" prefix. The specification can be found below:
http://dev.w3.org/csswg/css3-text/#text-decoration-line

Additionally, Mozilla implementation details can be found here:
https://developer-dev.allizom.org/en-US/docs/CSS/text-decoration-line

It is important to notice that "-webkit-text-decoration-line" and
"text-decoration" properties shares the same property handlers, however, the
former resets the latter if value from latter doesn't have "important" value
set (same behavior as Firefox). In a rare case where both properties have
"important" value set, the text decoration gets value from the last parsed
property.

Source/WebCore:

Test: fast/css/text-decoration-line.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::renderTextDecorationFlagsToCSSValue):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::addTextDecorationProperty):
(WebCore::CSSParser::parseTextDecoration):
* css/CSSParser.h:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList):

LayoutTests:

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css/getComputedStyle/resources/property-names.js:
* fast/css/text-decoration-line-expected.html: Added.
* fast/css/text-decoration-line.html: Added.
* svg/css/getComputedStyle-basic-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, paint the bots green.

* platform/qt-5.0-wk2/Skipped: Skip failing tests.
* platform/qt-5.0-wk2/fast/forms/mailto/advanced-get-expected.txt: Added because of whitespace differenced.
* platform/qt-5.0-wk2/fast/forms/mailto/advanced-put-expected.txt: Added because of whitespace differenced.
* platform/qt/TestExpectations: Mark an asserting test as crash.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Export InRegionScroller to fix build
https://bugs.webkit.org/show_bug.cgi?id=93635

Patch by Leo Yang <leoyang@rim.com> on 2012-08-09
Reviewed by Antonio Gomes.

Build fix.

* Api/InRegionScroller.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Recommend the use of https and mention git on building/checkout.html
https://bugs.webkit.org/show_bug.cgi?id=93657

Reviewed by Mark Rowe.

This page was quite out-dated. Stop mentioning about how to install subversion on OS X 10.4
because the paragraph right above it refers to buliding/tools.html for that.

Recommend the use of HTTPS connection for the Subversion checkout and also mention how to
checkout using a Git client.

* building/checkout.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Address one more review comment.

* building/checkout.html:


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