Bug 91169 - Chromium Mac: Add TEXTURE_RECTANGLE_ARB support to CCVideoLayerImpl
Summary: Chromium Mac: Add TEXTURE_RECTANGLE_ARB support to CCVideoLayerImpl
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sailesh Agrawal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-12 17:24 PDT by Sailesh Agrawal
Modified: 2012-07-18 13:25 PDT (History)
11 users (show)

See Also:


Attachments
Patch (18.14 KB, patch)
2012-07-12 17:38 PDT, Sailesh Agrawal
no flags Details | Formatted Diff | Diff
Patch (18.14 KB, patch)
2012-07-12 17:48 PDT, Sailesh Agrawal
no flags Details | Formatted Diff | Diff
Patch (10.16 KB, patch)
2012-07-17 12:02 PDT, Sailesh Agrawal
no flags Details | Formatted Diff | Diff
Patch (10.36 KB, patch)
2012-07-18 11:37 PDT, Sailesh Agrawal
no flags Details | Formatted Diff | Diff
Patch (10.40 KB, patch)
2012-07-18 12:14 PDT, Sailesh Agrawal
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sailesh Agrawal 2012-07-12 17:24:37 PDT
Chromium Mac: Add TEXTURE_RECTANGLE_ARB support to CCVideoLayerImpl
Comment 1 Sailesh Agrawal 2012-07-12 17:38:48 PDT
Created attachment 152110 [details]
Patch
Comment 2 WebKit Review Bot 2012-07-12 17:41:25 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 WebKit Review Bot 2012-07-12 17:41:45 PDT
Attachment 152110 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/Platform/ChangeLog', u'Source/Platf..." exit_code: 1
Source/WebCore/ChangeLog:22:  Need whitespace between colon and description  [changelog/filechangedescriptionwhitespace] [5]
Total errors found: 1 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Sailesh Agrawal 2012-07-12 17:48:23 PDT
Created attachment 152114 [details]
Patch
Comment 5 Dana Jansens 2012-07-13 08:37:10 PDT
Comment on attachment 152114 [details]
Patch

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

> Source/WebCore/ChangeLog:10
> +        No new tests (OOPS!).

You'll need to add tests or justify why none are possible here.

> Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:1675
> +const LayerRendererChromium::TextureRectProgramFlip* LayerRendererChromium::textureRectProgramFlip()

bikeshed: s/Flip/Flipped/ ?
Comment 6 Adrienne Walker 2012-07-13 11:31:01 PDT
Comment on attachment 152114 [details]
Patch

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

>> Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:1675
>> +const LayerRendererChromium::TextureRectProgramFlip* LayerRendererChromium::textureRectProgramFlip()
> 
> bikeshed: s/Flip/Flipped/ ?

Do we really need another program? Can't the rect that's being sent to the shader be adjusted?

> Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h:204
> -    typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRectFlipAlpha> TextureIOSurfaceProgram;
> +    typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRectAlpha> TextureRectProgram;
> +    typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRectFlipAlpha> TextureRectProgramFlip;

bikshed: I'll take other suggestions, but I don't like this renaming.  TextureRect is just too ambiguous, since TextureProgram and TextureProgramFlip take texture rects as uniforms.

> Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:211
> +    case GraphicsContext3D::TEXTURE_2D:
> +    case Extensions3D::TEXTURE_RECTANGLE_ARB: {

Can you reuse the CCIOSurfaceDrawQuad rather than shoehorning this into the CCTextureDrawQuad?
Comment 7 Sailesh Agrawal 2012-07-17 12:02:47 PDT
Created attachment 152801 [details]
Patch
Comment 8 Sailesh Agrawal 2012-07-17 12:04:45 PDT
Comment on attachment 152114 [details]
Patch

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

>>> Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp:1675
>>> +const LayerRendererChromium::TextureRectProgramFlip* LayerRendererChromium::textureRectProgramFlip()
>> 
>> bikeshed: s/Flip/Flipped/ ?
> 
> Do we really need another program? Can't the rect that's being sent to the shader be adjusted?

Removed.

>> Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h:204
>> +    typedef ProgramBinding<VertexShaderPosTexTransform, FragmentShaderRGBATexRectFlipAlpha> TextureRectProgramFlip;
> 
> bikshed: I'll take other suggestions, but I don't like this renaming.  TextureRect is just too ambiguous, since TextureProgram and TextureProgramFlip take texture rects as uniforms.

Removed.

>> Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:211
>> +    case Extensions3D::TEXTURE_RECTANGLE_ARB: {
> 
> Can you reuse the CCIOSurfaceDrawQuad rather than shoehorning this into the CCTextureDrawQuad?

Done. Reused CCIOSurfaceDrawQuad and added a flipped field.
Comment 9 Adrienne Walker 2012-07-17 17:21:00 PDT
Comment on attachment 152801 [details]
Patch

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

This patch is much improved.  Thanks for all the changes.  Along with rebasing to get this to apply to ToT, I have one more small change, but then this should be good:

> Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:102
> -    quadList.append(CCIOSurfaceDrawQuad::create(sharedQuadState, quadRect, m_ioSurfaceSize, m_ioSurfaceTextureId));
> +    quadList.append(CCIOSurfaceDrawQuad::create(sharedQuadState, quadRect, m_ioSurfaceSize, m_ioSurfaceTextureId, true));

Ack, boolean parameter trap (http://ariya.ofilabs.com/2011/08/hall-of-api-shame-boolean-trap.html).  Even if you store flipped as a boolean member variable, can you add an enum { Flipped, Unflipped } to the create function signature so it's obvious what the parameter means at the callsite?
Comment 10 Sailesh Agrawal 2012-07-18 11:37:16 PDT
Created attachment 153058 [details]
Patch
Comment 11 Sailesh Agrawal 2012-07-18 11:38:03 PDT
Comment on attachment 152801 [details]
Patch

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

Rebased to tip of tree.

>> Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:102
>> +    quadList.append(CCIOSurfaceDrawQuad::create(sharedQuadState, quadRect, m_ioSurfaceSize, m_ioSurfaceTextureId, true));
> 
> Ack, boolean parameter trap (http://ariya.ofilabs.com/2011/08/hall-of-api-shame-boolean-trap.html).  Even if you store flipped as a boolean member variable, can you add an enum { Flipped, Unflipped } to the create function signature so it's obvious what the parameter means at the callsite?

Done.
Comment 12 Adrienne Walker 2012-07-18 11:40:49 PDT
Comment on attachment 153058 [details]
Patch

R=me.  Thanks for that change.  It looks like this still doesn't apply, though.
Comment 13 Sailesh Agrawal 2012-07-18 12:14:44 PDT
Created attachment 153064 [details]
Patch
Comment 14 Sailesh Agrawal 2012-07-18 12:17:34 PDT
(In reply to comment #12)
> (From update of attachment 153058 [details])
> R=me.  Thanks for that change.  It looks like this still doesn't apply, though.

Oops, updated. New patch seems to apply now.
Thanks for the review!
Comment 15 Adrienne Walker 2012-07-18 12:25:02 PDT
Comment on attachment 153064 [details]
Patch

R=meagain.
Comment 16 WebKit Review Bot 2012-07-18 13:25:23 PDT
Comment on attachment 153064 [details]
Patch

Clearing flags on attachment: 153064

Committed r123009: <http://trac.webkit.org/changeset/123009>
Comment 17 WebKit Review Bot 2012-07-18 13:25:29 PDT
All reviewed patches have been landed.  Closing bug.