Bug 39883 - Adding tests to canvas.html performance test
Summary: Adding tests to canvas.html performance test
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-28 10:15 PDT by Sterling Swigart
Modified: 2010-05-29 08:18 PDT (History)
1 user (show)

See Also:


Attachments
Patch to canvas.html (4.50 KB, patch)
2010-05-28 10:21 PDT, Sterling Swigart
levin: review-
Details | Formatted Diff | Diff
Patch to canvas.html (3.59 KB, patch)
2010-05-28 11:33 PDT, Sterling Swigart
levin: review-
Details | Formatted Diff | Diff
Made the tests more asynchronous (4.10 KB, patch)
2010-05-28 13:30 PDT, Sterling Swigart
levin: review-
Details | Formatted Diff | Diff
Added beginPath/closePath (4.17 KB, patch)
2010-05-28 14:38 PDT, Sterling Swigart
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sterling Swigart 2010-05-28 10:15:10 PDT
Added tests for:

strokeText
fillText
strokeLine
Comment 1 Sterling Swigart 2010-05-28 10:21:52 PDT
Created attachment 57339 [details]
Patch to canvas.html
Comment 2 David Levin 2010-05-28 11:20:31 PDT
Comment on attachment 57339 [details]
Patch to canvas.html

In keeping with the C++ style, I would add spaces around the operators. For example here: "500*j/numStrings"


WebKitSite/demos/canvas-perf/canvas.html:193
 +      */
You should get rid of the commented out code.

WebKitSite/demos/canvas-perf/canvas.html:226
 +      */
Ditto.
Comment 3 Sterling Swigart 2010-05-28 11:33:09 PDT
Created attachment 57350 [details]
Patch to canvas.html
Comment 4 David Levin 2010-05-28 12:34:02 PDT
Comment on attachment 57350 [details]
Patch to canvas.html


> +
> +function doStrokeTextTests() {
> +    log("===== StrokeText Tests =====");
> +    var strokeTextFunc = function(obj, str, x, y) { obj.strokeText(str, x, y); };
> +    for (var i = 1; i < 1001; i *= 10)
> +        textTest(strokeTextFunc, i);
One last comment: It would be nice if these were written in a more async manner to allow for any gc's to happen as done in other tests.

Example:

function doStrokeTextTests() {
    log("===== StrokeText Tests =====");
    doNextStrokeTextTest(1);
}

function doNextStrokeTextTest(var lineCount) {
    var strokeTextFunc = function(canvas, str, x, y) { canvas.strokeText(str, x, y); };
    textTest(strokeTextFunc, i);
    lineCount *= 10;
    if (lineCount < 1001)
        window.setTimeout(function () {
                              doNextStrokeTextTest(lineCount);
                          }, idleTimer);
    else {
        log("");
        window.setTimeout(doFillTextTests, idleTimer);
   }
}
Comment 5 Sterling Swigart 2010-05-28 13:30:00 PDT
Created attachment 57368 [details]
Made the tests more asynchronous
Comment 6 David Levin 2010-05-28 14:29:13 PDT
Comment on attachment 57368 [details]
Made the tests more asynchronous

Please add the beginPath/closePath fix as discussed.
Comment 7 Sterling Swigart 2010-05-28 14:38:11 PDT
Created attachment 57383 [details]
Added beginPath/closePath
Comment 8 WebKit Commit Bot 2010-05-29 08:18:17 PDT
Comment on attachment 57383 [details]
Added beginPath/closePath

Clearing flags on attachment: 57383

Committed r60407: <http://trac.webkit.org/changeset/60407>
Comment 9 WebKit Commit Bot 2010-05-29 08:18:22 PDT
All reviewed patches have been landed.  Closing bug.