Bug 40398 - Support UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL for texImage2D taking ArrayBufferView
Summary: Support UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL for texImage2D...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Kenneth Russell
URL:
Keywords:
: 32040 32619 (view as bug list)
Depends on: 40318
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-09 18:18 PDT by Kenneth Russell
Modified: 2010-08-23 13:57 PDT (History)
5 users (show)

See Also:


Attachments
Patch (95.12 KB, patch)
2010-06-28 17:51 PDT, Kenneth Russell
kbr: commit-queue-
Details | Formatted Diff | Diff
Revised patch (95.26 KB, patch)
2010-06-28 18:28 PDT, Kenneth Russell
dglazkov: review+
kbr: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2010-06-09 18:18:04 PDT
The new pixel store parameters UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL need to be supported for the texImage2D and texSubImage2D entry points taking ArrayBufferView.

This bug depends on 40318.
Comment 1 Kenneth Russell 2010-06-28 17:51:51 PDT
Created attachment 59964 [details]
Patch

From the ChangeLog:

Added support for UNPACK_FLIP_Y_WEBGL and UNPACK_PREMULTIPLY_ALPHA_WEBGL pixel store parameters to texImage2D and texSubImage2D entry points taking ArrayBufferView. More cleanly separated the unpacking and packing phases of user-supplied pixel data in GraphicsContext3D, and added support for unpack alignment. Fixed bug in handling of unpackAlignment in GraphicsContext3D::flipVertically. Necessarily added validation of the amount of data passed to texImage2D and texSubImage2D. Modified fast/canvas/webgl/tex-image-with-format-and-type.html to include premultiplied alpha tests for relevant source formats; added new test which exercises all combinations of UNPACK_FLIP_Y_WEBGL, UNPACK_PREMULTIPLY_ALPHA_WEBGL, and UNPACK_ALIGNMENT pixel store parameters.

Note to reviewers:

This patch is large, but the individual code changes are small and easily reviewable, and it is not possible to break it down into any smaller set of patches which are individually testable. The test cases and their boilerplate output comprise more than half of the patch. The test cases are as exhaustive as possible and caught a couple of implementation errors.
Comment 2 Eric Seidel (no email) 2010-06-28 17:58:14 PDT
Attachment 59964 [details] did not build on mac:
Build output: http://webkit-commit-queue.appspot.com/results/3268898
Comment 3 Kenneth Russell 2010-06-28 18:28:32 PDT
Created attachment 59970 [details]
Revised patch

Revised patch fixing build problem in Release mode on Mac
Comment 4 Dimitri Glazkov (Google) 2010-06-29 10:26:39 PDT
Comment on attachment 59970 [details]
Revised patch

r=me (pair programming FTW!), except:

WebCore/html/canvas/WebGLRenderingContext.cpp:3567
 +          return false;
Need to synthesize an error here.
Comment 5 Kenneth Russell 2010-06-29 13:17:11 PDT
Committed r62145: <http://trac.webkit.org/changeset/62145>
Comment 6 Kenneth Russell 2010-07-07 19:18:16 PDT
*** Bug 32619 has been marked as a duplicate of this bug. ***
Comment 7 Kenneth Russell 2010-08-23 13:57:01 PDT
*** Bug 32040 has been marked as a duplicate of this bug. ***