Bug 104176 - Extend platform layer so it can pass blend modes to the compositing calls
Summary: Extend platform layer so it can pass blend modes to the compositing calls
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rik Cabanier
URL:
Keywords:
Depends on: 104415
Blocks: 100069 104367
  Show dependency treegraph
 
Reported: 2012-12-05 15:15 PST by Rik Cabanier
Modified: 2012-12-07 20:04 PST (History)
13 users (show)

See Also:


Attachments
Patch (44.06 KB, text/plain)
2012-12-05 15:34 PST, Rik Cabanier
no flags Details
Patch (47.54 KB, text/plain)
2012-12-05 16:02 PST, Rik Cabanier
no flags Details
Patch (48.77 KB, text/plain)
2012-12-05 16:44 PST, Rik Cabanier
no flags Details
Patch (45.39 KB, patch)
2012-12-05 19:03 PST, Rik Cabanier
no flags Details | Formatted Diff | Diff
Patch (49.43 KB, patch)
2012-12-05 23:16 PST, Rik Cabanier
no flags Details | Formatted Diff | Diff
Patch (51.32 KB, patch)
2012-12-06 15:11 PST, Rik Cabanier
no flags Details | Formatted Diff | Diff
Patch (51.25 KB, patch)
2012-12-06 16:03 PST, Rik Cabanier
no flags Details | Formatted Diff | Diff
Patch (51.02 KB, patch)
2012-12-07 11:11 PST, Rik Cabanier
no flags Details | Formatted Diff | Diff
Patch (51.08 KB, patch)
2012-12-07 13:55 PST, Rik Cabanier
no flags Details | Formatted Diff | Diff
Added missing exports file for mac (52.04 KB, patch)
2012-12-07 16:49 PST, Rik Cabanier
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rik Cabanier 2012-12-05 15:15:45 PST
Canvas has a proposal to allow blending in the compositing operator.
The plaform code needs to be enhanced to support this. This bug will just extend the platform interface to allow this.
Comment 1 Rik Cabanier 2012-12-05 15:34:11 PST
Created attachment 177847 [details]
Patch
Comment 2 kov's GTK+ EWS bot 2012-12-05 15:53:35 PST
Comment on attachment 177847 [details]
Patch

Attachment 177847 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/15170261
Comment 3 Rik Cabanier 2012-12-05 16:02:02 PST
Created attachment 177854 [details]
Patch
Comment 4 Rik Cabanier 2012-12-05 16:44:16 PST
Created attachment 177866 [details]
Patch
Comment 5 WebKit Review Bot 2012-12-05 16:48:55 PST
Attachment 177866 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit/chromium/tests/DragImageTest.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 1 in 35 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 WebKit Review Bot 2012-12-05 18:07:16 PST
Comment on attachment 177866 [details]
Patch

Attachment 177866 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15173128
Comment 7 Peter Beverloo (cr-android ews) 2012-12-05 18:34:25 PST
Comment on attachment 177866 [details]
Patch

Attachment 177866 [details] did not pass cr-android-ews (chromium-android):
Output: http://queues.webkit.org/results/15153648
Comment 8 Rik Cabanier 2012-12-05 19:03:30 PST
Created attachment 177908 [details]
Patch
Comment 9 WebKit Review Bot 2012-12-05 19:07:49 PST
Attachment 177908 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/html/HTMLCanvasElement.cpp'..." exit_code: 1
Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/tests/DragImageTest.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 35 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 Rik Cabanier 2012-12-05 20:15:34 PST
This patch updates interfaces so relevant calls also pass blend modes.
In addition, the blend mode is stored in the graphics context.
Comment 11 Dirk Schulze 2012-12-05 20:41:27 PST
Comment on attachment 177908 [details]
Patch

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

> Source/WebCore/platform/graphics/GraphicsContext.h:409
>          void setCompositeOperation(CompositeOperator);
> +        void setCompositeOperation(CompositeOperator, BlendMode);

Does it make sense to combine both and use the default value BlendModeNormal like you did for setPlatformCompositeOperation ?
Comment 12 Rik Cabanier 2012-12-05 23:16:19 PST
Created attachment 177949 [details]
Patch
Comment 13 WebKit Review Bot 2012-12-05 23:18:43 PST
Attachment 177949 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/tests/DragImageTest.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 36 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Build Bot 2012-12-05 23:42:03 PST
Comment on attachment 177908 [details]
Patch

Attachment 177908 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/15154752
Comment 15 Build Bot 2012-12-06 01:39:54 PST
Comment on attachment 177949 [details]
Patch

Attachment 177949 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/15181029
Comment 16 Stephen Chenney 2012-12-06 07:33:13 PST
Comment on attachment 177949 [details]
Patch

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

> Source/WebCore/platform/graphics/GraphicsContext.cpp:475
> +{    if (paintingDisabled() || !image)

Missing a newline in here.

> Source/WebCore/platform/graphics/GraphicsContext.cpp:548
> +    drawImageBuffer(image, styleColorSpace, p, IntRect(0, 0, -1, -1), op, blendMode);

I am not a fan of all of the methods in GraphicsContext named drawImageBuffer that chain together to finally end up at the one call with the FloatRect, FloatRect arguments. Can short-circuit all of these calls and go direct to the correct method? I'll probably take it on as a separate patch.

> Source/WebCore/platform/graphics/GraphicsContext.cpp:553
> +    drawImageBuffer(image, styleColorSpace, r, IntRect(0, 0, -1, -1), op, blendMode, useLowQualityScale);

Ditto.

> Source/WebCore/platform/graphics/GraphicsContext.cpp:558
> +    drawImageBuffer(image, styleColorSpace, IntRect(dest, srcRect.size()), srcRect, op, blendMode);

Ditto.

> Source/WebCore/platform/graphics/GraphicsContext.h:409
> +        void setCompositeOperation(CompositeOperator, BlendMode);

Why not add BlendMode as a default parameter to the existing method? It would be functionally the same and avoid further bloat to this class.

>> Source/WebKit/chromium/tests/DragImageTest.cpp:87
>> +                      WebCore::CompositeOperator, WebCore::BlendMode)
> 
> Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]

Ignore this.

>> Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99
>> +                      WebCore::CompositeOperator, WebCore::BlendMode)
> 
> Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]

Ignore this.
Comment 17 Rik Cabanier 2012-12-06 15:11:54 PST
Created attachment 178089 [details]
Patch
Comment 18 WebKit Review Bot 2012-12-06 15:14:44 PST
Attachment 178089 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/tests/DragImageTest.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 37 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 19 Rik Cabanier 2012-12-06 15:54:03 PST
(In reply to comment #11)
> (From update of attachment 177908 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=177908&action=review
> 
> > Source/WebCore/platform/graphics/GraphicsContext.h:409
> >          void setCompositeOperation(CompositeOperator);
> > +        void setCompositeOperation(CompositeOperator, BlendMode);
> 
> Does it make sense to combine both and use the default value BlendModeNormal like you did for setPlatformCompositeOperation ?

I did not combine them because there are dependencies between the different WebKit libraries and I wanted to minimize the changes.
Comment 20 Rik Cabanier 2012-12-06 16:01:29 PST
(In reply to comment #16)
> (From update of attachment 177949 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=177949&action=review
> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:475
> > +{    if (paintingDisabled() || !image)
> 
> Missing a newline in here.

Fixed

> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:548
> > +    drawImageBuffer(image, styleColorSpace, p, IntRect(0, 0, -1, -1), op, blendMode);
> 
> I am not a fan of all of the methods in GraphicsContext named drawImageBuffer that chain together to finally end up at the one call with the FloatRect, FloatRect arguments. Can short-circuit all of these calls and go direct to the correct method? I'll probably take it on as a separate patch.

I agree. It's messy.
when you say "I'll take it on", do you mean you or me?

> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:553
> > +    drawImageBuffer(image, styleColorSpace, r, IntRect(0, 0, -1, -1), op, blendMode, useLowQualityScale);
> 
> Ditto.
> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:558
> > +    drawImageBuffer(image, styleColorSpace, IntRect(dest, srcRect.size()), srcRect, op, blendMode);
> 
> Ditto.
> 
> > Source/WebCore/platform/graphics/GraphicsContext.h:409
> > +        void setCompositeOperation(CompositeOperator, BlendMode);
> 
> Why not add BlendMode as a default parameter to the existing method? It would be functionally the same and avoid further bloat to this class.
> 
> >> Source/WebKit/chromium/tests/DragImageTest.cpp:87
> >> +                      WebCore::CompositeOperator, WebCore::BlendMode)
> > 
> > Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
> 
> Ignore this.
> 
> >> Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99
> >> +                      WebCore::CompositeOperator, WebCore::BlendMode)
> > 
> > Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
> 
> Ignore this.
Comment 21 Rik Cabanier 2012-12-06 16:03:08 PST
(In reply to comment #16)
> (From update of attachment 177949 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=177949&action=review
> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:475
> > +{    if (paintingDisabled() || !image)
> 
> Missing a newline in here.
> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:548
> > +    drawImageBuffer(image, styleColorSpace, p, IntRect(0, 0, -1, -1), op, blendMode);
> 
> I am not a fan of all of the methods in GraphicsContext named drawImageBuffer that chain together to finally end up at the one call with the FloatRect, FloatRect arguments. Can short-circuit all of these calls and go direct to the correct method? I'll probably take it on as a separate patch.
> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:553
> > +    drawImageBuffer(image, styleColorSpace, r, IntRect(0, 0, -1, -1), op, blendMode, useLowQualityScale);
> 
> Ditto.
> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:558
> > +    drawImageBuffer(image, styleColorSpace, IntRect(dest, srcRect.size()), srcRect, op, blendMode);
> 
> Ditto.
> 
> > Source/WebCore/platform/graphics/GraphicsContext.h:409
> > +        void setCompositeOperation(CompositeOperator, BlendMode);
> 
> Why not add BlendMode as a default parameter to the existing method? It would be functionally the same and avoid further bloat to this class.

Krit had the same remark.
If I change this, there will be a link issues between the libraries.
I can fix this in another patch. 

> 
> >> Source/WebKit/chromium/tests/DragImageTest.cpp:87
> >> +                      WebCore::CompositeOperator, WebCore::BlendMode)
> > 
> > Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
> 
> Ignore this.
> 
> >> Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99
> >> +                      WebCore::CompositeOperator, WebCore::BlendMode)
> > 
> > Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
> 
> Ignore this.
Comment 22 Rik Cabanier 2012-12-06 16:03:46 PST
Created attachment 178099 [details]
Patch
Comment 23 WebKit Review Bot 2012-12-06 16:09:27 PST
Attachment 178099 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/tests/DragImageTest.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 37 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 24 Stephen Chenney 2012-12-07 06:08:42 PST
(In reply to comment #20)
> (In reply to comment #16)
> > (From update of attachment 177949 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=177949&action=review

> > > Source/WebCore/platform/graphics/GraphicsContext.cpp:548
> > > +    drawImageBuffer(image, styleColorSpace, p, IntRect(0, 0, -1, -1), op, blendMode);
> > 
> > I am not a fan of all of the methods in GraphicsContext named drawImageBuffer that chain together to finally end up at the one call with the FloatRect, FloatRect arguments. Can short-circuit all of these calls and go direct to the correct method? I'll probably take it on as a separate patch.
> 
> I agree. It's messy.
> when you say "I'll take it on", do you mean you or me?

I mean myself. https://bugs.webkit.org/show_bug.cgi?id=104367
Comment 25 Dirk Schulze 2012-12-07 09:15:08 PST
Comment on attachment 178099 [details]
Patch

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

> Source/WebCore/platform/graphics/GraphicsContext.cpp:710
>  void GraphicsContext::setCompositeOperation(CompositeOperator compositeOperation)
>  {
> +    setCompositeOperation(compositeOperation, BlendModeNormal);
> +}

I don't get your point here actually. Which libraries do you mean? All files that include this functions can still use setCompositeOperation(compositeOperation)? Can you give an example please?
Comment 26 Rik Cabanier 2012-12-07 11:11:00 PST
Created attachment 178242 [details]
Patch
Comment 27 WebKit Review Bot 2012-12-07 11:12:54 PST
Attachment 178242 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/tests/DragImageTest.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 37 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 28 Rik Cabanier 2012-12-07 11:13:59 PST
(In reply to comment #25)
> (From update of attachment 178099 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=178099&action=review
> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:710
> >  void GraphicsContext::setCompositeOperation(CompositeOperator compositeOperation)
> >  {
> > +    setCompositeOperation(compositeOperation, BlendModeNormal);
> > +}
> 
> I don't get your point here actually. Which libraries do you mean? All files that include this functions can still use setCompositeOperation(compositeOperation)? Can you give an example please?

I changed the .def.in file that defines the exported functions. This fixed the problem.
Comment 29 Dirk Schulze 2012-12-07 13:48:24 PST
Comment on attachment 178242 [details]
Patch

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

Can you just upload a new patch with a better change log?

> Source/WebCore/ChangeLog:8
> +        Interface changes for the new blend modes

Can you provide more details here? The changelog helps other people to understand what exaclty you did, w/o looking at the code.
Comment 30 Rik Cabanier 2012-12-07 13:55:10 PST
Created attachment 178266 [details]
Patch
Comment 31 WebKit Review Bot 2012-12-07 14:58:09 PST
Attachment 178266 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/tests/DragImageTest.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 37 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 32 WebKit Review Bot 2012-12-07 15:34:09 PST
Comment on attachment 178266 [details]
Patch

Clearing flags on attachment: 178266

Committed r136993: <http://trac.webkit.org/changeset/136993>
Comment 33 WebKit Review Bot 2012-12-07 15:34:15 PST
All reviewed patches have been landed.  Closing bug.
Comment 34 WebKit Review Bot 2012-12-07 16:31:58 PST
Re-opened since this is blocked by bug 104415
Comment 35 Rik Cabanier 2012-12-07 16:49:00 PST
Created attachment 178304 [details]
Added missing exports file for mac
Comment 36 WebKit Review Bot 2012-12-07 17:51:40 PST
Attachment 178304 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp:99:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Source/WebKit/chromium/tests/DragImageTest.cpp:87:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 2 in 38 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 37 Dirk Schulze 2012-12-07 19:41:46 PST
Comment on attachment 178304 [details]
Added missing exports file for mac

Lets try it agin. r=me.
Comment 38 WebKit Review Bot 2012-12-07 20:04:03 PST
Comment on attachment 178304 [details]
Added missing exports file for mac

Clearing flags on attachment: 178304

Committed r137011: <http://trac.webkit.org/changeset/137011>
Comment 39 WebKit Review Bot 2012-12-07 20:04:11 PST
All reviewed patches have been landed.  Closing bug.