12012-05-15 Kenneth Russell <kbr@google.com>
2
3 Assertion failure running Mozilla's WebGL performance regression tests
4 https://bugs.webkit.org/show_bug.cgi?id=85942
5
6 Reviewed by Stephen White.
7
8 Fixed incorrect assumptions about source formats and buffer sizes
9 when uploading to floating-point textures. Added code paths
10 supporting the necessary conversions.
11
12 Tests have been added to the WebGL conformance suite which cover
13 these new code paths; they verify uploads of HTMLCanvasElement,
14 HTMLImageElement, HTMLVideoElement, and ImageData to
15 floating-point textures. However, because floating-point texture
16 support is optional, and generally only supported on bots which
17 run with real GPUs and not in virtual machines, it isn't feasible
18 to incorporate these tests as layout tests.
19
20 Ran the new WebGL conformance tests in Chromium on Linux; all
21 pass.
22
23 * platform/graphics/GraphicsContext3D.cpp:
24 (WebCore::GraphicsContext3D::extractImageData):
25 Properly compute size of destination buffer.
26
27 (WebCore):
28 Add pack/unpack routines for converting RGBA8/BGRA8 to floating point.
29
30 (WebCore::doFloatingPointPacking):
31 Support RGBA8 and BGRA8 source formats.
32
33 (WebCore::isFloatingPointSource):
34 Factored out logic for assertions.
35
36 (WebCore::GraphicsContext3D::packPixels):
37 Generalized assertions and logic.
38
39 * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
40 (WebCore::GraphicsContext3D::getImageData):
41 Properly compute size of destination buffer.
42
43 * platform/graphics/cg/GraphicsContext3DCG.cpp:
44 (WebCore::GraphicsContext3D::getImageData):
45 Properly compute size of destination buffer.
46
47 * platform/graphics/qt/GraphicsContext3DQt.cpp:
48 (WebCore::GraphicsContext3D::getImageData):
49 Properly compute size of destination buffer.
50
51 * platform/graphics/skia/GraphicsContext3DSkia.cpp:
52 (WebCore::GraphicsContext3D::getImageData):
53 Properly compute size of destination buffer.
54