Web Inspector: [Canvas] do not blow up the capturing log
authorcommit-queue <commit-queue@webkit.org>
Mon, 5 Nov 2012 07:52:52 +0000 (07:52 +0000)
committercommit-queue <commit-queue@webkit.org>
Mon, 5 Nov 2012 07:52:52 +0000 (07:52 +0000)
commitcabf3d3925dbb52a2550354f4226a23316a12aed
tree7c6f9e892e7c508f372a055e363d5541861e5d18
parente1077424683de0f067039dd324d10c4d48259b8d
Web Inspector: [Canvas] do not blow up the capturing log
https://bugs.webkit.org/show_bug.cgi?id=100752

Patch by Andrey Adaikin <aandrey@chromium.org> on 2012-11-04
Reviewed by Pavel Feldman.

Source/WebCore:

Clear obsolete calls in the canvas 2D capturing log in runtime.
Now we store in the log only minimum number of calls that are necessary to replay a
canvas 2D context. To achieve that we find in runtime those calls in the log that no
longer contribute to the final context state and remove them.
These are the rules according which we find and remove such calls:
- all PATH methods between a clip() call and beginPath() call can be removed
- all MATRIX methods before a restore() or setTransform() call but after any PATH or corresponding save() method
- all consecutive save() + restore() calls

Tests: inspector/profiler/canvas2d/canvas2d-api-changes.html
       inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html

* inspector/InjectedScriptCanvasModuleSource.js:
(.):

LayoutTests:

Added test for track Canvas 2D API changes, as well as basics for the capturing.

* inspector/profiler/canvas-profiler-test.js: Renamed from LayoutTests/inspector/profiler/webgl/webgl-profiler-test.js.
(initialize_CanvasWebGLProfilerTest.InspectorTest.enableCanvasAgent):
(initialize_CanvasWebGLProfilerTest):
(createWebGLContext):
(createCanvas2DContext):
* inspector/profiler/canvas2d/canvas2d-api-changes-expected.txt: Added.
* inspector/profiler/canvas2d/canvas2d-api-changes.html: Added.
* inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics-expected.txt: Added.
* inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html: Added.
* inspector/profiler/webgl/webgl-profiler-get-error.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/profiler/canvas-profiler-test.js [new file with mode: 0644]
LayoutTests/inspector/profiler/canvas2d/canvas2d-api-changes-expected.txt [new file with mode: 0644]
LayoutTests/inspector/profiler/canvas2d/canvas2d-api-changes.html [new file with mode: 0644]
LayoutTests/inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics-expected.txt [new file with mode: 0644]
LayoutTests/inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html [new file with mode: 0644]
LayoutTests/inspector/profiler/webgl/webgl-profiler-get-error.html
LayoutTests/inspector/profiler/webgl/webgl-profiler-test.js [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js