Bug 45476 - [Chromium] Minimize uploads in canvas 2d mixed mode rendering
Summary: [Chromium] Minimize uploads in canvas 2d mixed mode rendering
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-09 11:03 PDT by Vincent Scheib
Modified: 2010-09-09 17:37 PDT (History)
6 users (show)

See Also:


Attachments
Patch (17.70 KB, patch)
2010-09-09 11:18 PDT, Vincent Scheib
no flags Details | Formatted Diff | Diff
Patch (24.65 KB, patch)
2010-09-09 13:53 PDT, Vincent Scheib
no flags Details | Formatted Diff | Diff
Patch (24.65 KB, patch)
2010-09-09 15:23 PDT, Vincent Scheib
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Scheib 2010-09-09 11:03:30 PDT
[Chromium] Minimize uploads in canvas 2d mixed mode rendering
Comment 1 Vincent Scheib 2010-09-09 11:18:55 PDT
Created attachment 67070 [details]
Patch
Comment 2 WebKit Review Bot 2010-09-09 11:20:03 PDT
Attachment 67070 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/platform/graphics/skia/PlatformContextSkia.cpp:342:  Use 0 instead of NULL.  [readability/null] [4]
Total errors found: 1 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 James Robinson 2010-09-09 12:12:40 PDT
Comment on attachment 67070 [details]
Patch

review- for the build break.  Overall looks awesome.


View in context: https://bugs.webkit.org/attachment.cgi?id=67070&action=prettypatch

> WebCore/html/canvas/CanvasRenderingContext2D.cpp:1534
>  #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING)
> +    if (isAccelerated())
> +        drawingContext()->addDirtyRect(enclosingIntRect(dirtyRect));
The addDirtyRect() call should only be guarded by ENABLE(ACCELERATED_2D_CANVAS).  We still have to make this call even if accelerated compositing is not enabled in order to render correctly.

> WebCore/html/canvas/CanvasRenderingContext2D.h:272
> +        CanvasDidDrawApplyNone = 0
nit: this would be better at the beginning of the enum definition

> WebCore/platform/graphics/GraphicsContext.h:427
> +        void addDirtyRect(const IntRect& rect);
You have to add a stub implementation of this to GraphicsContext.cpp for !PLATFORM(SKIA) or this won't compile on other platforms.  See how setSharedGraphicsContext3D and syncSoftwareCanvas() are handled.

Don't name the parameter here.

Also, this name is less than ideal.  It appears to have a much broader application than it really does.

> WebCore/platform/graphics/gpu/Texture.cpp:147
> +
> +
remove the extra new lines here

> WebCore/platform/graphics/skia/PlatformContextSkia.cpp:818
> +    switch (m_backingStoreState) {
> +    case Software:
> +    case Mixed:
> +        m_softwareDirtyRect.unite(rect);
> +        return;
> +    case Hardware:
> +        return;
> +    default:
> +        ASSERT_NOT_REACHED();
This is probably clearer as an if() instead of a switch.  The other cases are not likely to get interesting.

> WebCore/platform/graphics/skia/PlatformContextSkia.h:197
> +    void addDirtyRect(const IntRect& rect);
don't name the parameter here
Comment 4 Vincent Scheib 2010-09-09 13:53:10 PDT
Created attachment 67091 [details]
Patch
Comment 5 WebKit Review Bot 2010-09-09 13:54:47 PDT
Attachment 67091 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/platform/graphics/skia/PlatformContextSkia.cpp:342:  Use 0 instead of NULL.  [readability/null] [4]
Total errors found: 1 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Early Warning System Bot 2010-09-09 14:10:14 PDT
Attachment 67091 [details] did not build on qt:
Build output: http://queues.webkit.org/results/3926335
Comment 7 Vincent Scheib 2010-09-09 15:23:06 PDT
Created attachment 67099 [details]
Patch
Comment 8 WebKit Review Bot 2010-09-09 15:28:26 PDT
Attachment 67099 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebCore/platform/graphics/skia/PlatformContextSkia.cpp:342:  Use 0 instead of NULL.  [readability/null] [4]
Total errors found: 1 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 James Robinson 2010-09-09 16:12:10 PDT
Comment on attachment 67099 [details]
Patch

R=me.  Clearing commit-queue flag, I'll land by hand

View in context: https://bugs.webkit.org/attachment.cgi?id=67099&action=prettypatch

> WebCore/ChangeLog:11
> +        - addDirtyRect() plumbed through GraphicsContext to PlatformContextSkia.
this is out of date. I'll fix while landing
Comment 10 James Robinson 2010-09-09 16:15:44 PDT
Committed r67123: <http://trac.webkit.org/changeset/67123>
Comment 11 WebKit Review Bot 2010-09-09 17:03:07 PDT
http://trac.webkit.org/changeset/67123 might have broken Qt Windows 32-bit Release
The following changes are on the blame list:
http://trac.webkit.org/changeset/67123
http://trac.webkit.org/changeset/67124
http://trac.webkit.org/changeset/67125
Comment 12 James Robinson 2010-09-09 17:37:19 PDT
Comment on attachment 67099 [details]
Patch

Patch has landed, clearing flags.