WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-231471-20211109160839.patch (text/plain), 28.46 KB, created by
Kimmo Kinnunen
on 2021-11-09 06:08:41 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Kimmo Kinnunen
Created:
2021-11-09 06:08:41 PST
Size:
28.46 KB
patch
obsolete
>Subversion Revision: 285340 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 4ab312470c17875fb680be60f51f9dcb831e4517..4f9e0af3885403853a483383d52b35b49140e7b9 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2021-11-05 Kimmo Kinnunen <kkinnunen@apple.com> >+ >+ REGRESSION (iOS 15, GPU Process): Fails to load texture map >+ https://bugs.webkit.org/show_bug.cgi?id=231471 >+ <rdar://problem/84328146> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Clear the CGImage copy from the IOSurface CGContext after the IOSurface has >+ been drawn to a bitmap CGContext. The CGImage stored in the IOSurface CGContext >+ contains a malloc buffer of the data. This buffer is counted against GPU >+ process memory consumption, causing GPU process jetsams. >+ >+ * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp: >+ (WebCore::ImageBufferIOSurfaceBackend::draw): >+ * platform/graphics/cg/ImageBufferIOSurfaceBackend.h: >+ > 2021-11-05 Carlos Garcia Campos <cgarcia@igalia.com> > > AX: rename actionVerb() as localizedActionVerb() >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 1a29e5648e778796f5675335e809e444fd859f03..6afe8a21b356ff9b7763c513c6c5392a440407e4 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,22 @@ >+2021-11-05 Kimmo Kinnunen <kkinnunen@apple.com> >+ >+ REGRESSION (iOS 15, GPU Process): Fails to load texture map >+ https://bugs.webkit.org/show_bug.cgi?id=231471 >+ <rdar://problem/84328146> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use the normal "draw image buffer" call to draw the image buffer >+ to the shareable bitmap. Before, it was manually re-implementing this >+ API call via the lower level calls. >+ The drawImageBuffer call now fixes up the IOSurface -backed source >+ ImageBuffers to not keep referencing to the CGImage that provided >+ the data to the draw. Otherwise GPU process jetsams as the CGImage >+ inside IOSurface is counted against GPU process memory limit. >+ >+ * GPUProcess/graphics/RemoteRenderingBackend.cpp: >+ (WebKit::RemoteRenderingBackend::getShareableBitmapForImageBufferWithQualifiedIdentifier): >+ > 2021-11-04 Jean-Yves Avenard <jya@apple.com> > > Have RemoteMediaResource use SharedMemory >diff --git a/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp b/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp >index dbb6966ad39a54170d554f572343f172d5efe7b1..e68a1bafb2c594a55be7408a1edd4a40ed5bbf41 100644 >--- a/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp >+++ b/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp >@@ -175,6 +175,14 @@ RefPtr<NativeImage> ImageBufferIOSurfaceBackend::sinkIntoNativeImage() > return NativeImage::create(IOSurface::sinkIntoImage(WTFMove(m_surface))); > } > >+void ImageBufferIOSurfaceBackend::draw(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options) >+{ >+ ImageBufferCGBackend::draw(destContext, destRect, srcRect, options); >+ // Accelerated to/from unaccelerated image buffers need complex caching. We trust that >+ // this is a one-off draw, and as such we clear the caches of the source image after each draw. >+ if (destContext.renderingMode() != context().renderingMode()) >+ invalidateCachedNativeImage(); >+} > void ImageBufferIOSurfaceBackend::drawConsuming(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions& options) > { > prepareToDrawIntoContext(destContext); >diff --git a/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h b/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h >index af54ebc44e5332eb1ff38faea4e57f314e4bdcc9..31388b4eb152d18f9747807ee7d7b319ba958c8d 100644 >--- a/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h >+++ b/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h >@@ -58,6 +58,7 @@ public: > RefPtr<NativeImage> copyNativeImage(BackingStoreCopy = CopyBackingStore) const override; > RefPtr<NativeImage> sinkIntoNativeImage() override; > >+ void draw(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions&) override; > void drawConsuming(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect, const ImagePaintingOptions&) override; > > std::optional<PixelBuffer> getPixelBuffer(const PixelBufferFormat& outputFormat, const IntRect&) const override; >diff --git a/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp b/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp >index db4e137b2f6adfb9cd1478a1d872e664d1a96deb..fcc72bf20a2fb2c6b99ba0ee6f8206a4cab6ffc0 100644 >--- a/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp >+++ b/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp >@@ -304,9 +304,6 @@ void RemoteRenderingBackend::getShareableBitmapForImageBufferWithQualifiedIdenti > auto imageBuffer = m_remoteResourceCache.cachedImageBuffer(identifier); > if (!imageBuffer) > return; >- auto image = imageBuffer->copyNativeImage(WebCore::BackingStoreCopy::DontCopyBackingStore); >- if (!image) >- return; > auto backendSize = imageBuffer->backendSize(); > auto resultSize = preserveResolution == WebCore::PreserveResolution::Yes ? backendSize : imageBuffer->truncatedLogicalSize(); > auto bitmap = ShareableBitmap::createShareable(resultSize, { imageBuffer->colorSpace() }); >@@ -315,7 +312,7 @@ void RemoteRenderingBackend::getShareableBitmapForImageBufferWithQualifiedIdenti > auto context = bitmap->createGraphicsContext(); > if (!context) > return; >- context->drawNativeImage(*image, resultSize, FloatRect { { }, resultSize }, FloatRect { { }, backendSize }, { WebCore::CompositeOperator::Copy }); >+ context->drawImageBuffer(*imageBuffer, FloatRect { { }, resultSize }, FloatRect { { }, backendSize }, { WebCore::CompositeOperator::Copy }); > bitmap->createHandle(handle); > }(); > completionHandler(WTFMove(handle)); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 968d032b62aaafc81d53b19a16fc9383efac3f51..c543f4ac43680e0bddf8d10260d52504ac2150a3 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,21 @@ >+2021-11-05 Kimmo Kinnunen <kkinnunen@apple.com> >+ >+ REGRESSION (iOS 15, GPU Process): Fails to load texture map >+ https://bugs.webkit.org/show_bug.cgi?id=231471 >+ <rdar://problem/84328146> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a test that tries to assert that GraphicsContext::drawImageBuffer() does not increase >+ memory footprint of the process. However, leave the test disabled as currently >+ it seems that the WTF::memoryFootprint() measurement does not see all the >+ memory releases the CG does. >+ >+ * TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp: >+ (TestWebKitAPI::memoryFootprintChangedBy): >+ (TestWebKitAPI::imageBufferPixelIs): >+ (TestWebKitAPI::TEST): >+ > 2021-11-05 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK][a11y] Embedded objects are not correctly handled by text interface with ATSPI >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp b/Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp >index b623beeecc023a97aa03bf9be32e9d5c1d207c8d..67373003c44b4ec5373961cec64b5c65fd40f1fb 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/ImageBufferTests.cpp >@@ -25,12 +25,37 @@ > > #include "config.h" > >+#include <WebCore/Color.h> > #include <WebCore/ImageBuffer.h> > #include <WebCore/PlatformImageBuffer.h> >+#include <cmath> >+#include <wtf/MemoryFootprint.h> > > namespace TestWebKitAPI { > using namespace WebCore; > >+static ::testing::AssertionResult memoryFootprintChangedBy(size_t& lastFootprint, double expectedChange, double error) >+{ >+ WTF::releaseFastMallocFreeMemory(); >+ size_t newFootprint = memoryFootprint(); >+ size_t oldFootprint = std::exchange(lastFootprint, newFootprint); >+ double change = static_cast<double>(newFootprint) - oldFootprint; >+ if (change - expectedChange > error) >+ return ::testing::AssertionFailure() << "Footprint changed by " << change << ". Expected at most " << expectedChange << "+-" << error; >+ return ::testing::AssertionSuccess(); >+} >+ >+static ::testing::AssertionResult imageBufferPixelIs(Color expected, ImageBuffer& imageBuffer, int x, int y) >+{ >+ PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB() }; >+ auto frontPixelBuffer = imageBuffer.getPixelBuffer(format, { x, y, 1, 1 }); >+ auto& data = frontPixelBuffer->data(); >+ auto got = Color { SRGBA<uint8_t> { data.item(0), data.item(1), data.item(2), data.item(3) } }; >+ if (got != expected) >+ return ::testing::AssertionFailure() << "color is not expected."; // FIXME: implement Color <<. >+ return ::testing::AssertionSuccess(); >+} >+ > // Tests that the specialized image buffer constructors construct the expected type of object. > // Test passes if the test compiles, there was a bug where the code wouldn't compile. > TEST(ImageBufferTests, ImageBufferSubTypeCreateCreatesSubtypes) >@@ -79,26 +104,71 @@ TEST(ImageBufferTests, ImageBufferSubPixelDrawing) > frontContext.drawImageBuffer(*backImageBuffer, WebCore::FloatPoint { }, { WebCore::CompositeOperator::Copy }); > } > >- auto checkGreenPixel = [&](ImageBuffer& imageBuffer, int x, int y) { >- PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, colorSpace }; >- auto frontPixelBuffer = imageBuffer.getPixelBuffer(format, { x, y, 1, 1 }); >- auto& data = frontPixelBuffer->data(); >- >- EXPECT_EQ(data.item(0), 0x00); >- EXPECT_EQ(data.item(1), 0xff); >- EXPECT_EQ(data.item(2), 0x00); >- EXPECT_EQ(data.item(3), 0xff); >- }; >- >- checkGreenPixel(*frontImageBuffer, fillRect.x() + 1, fillRect.y() + 1); >- checkGreenPixel(*frontImageBuffer, fillRect.maxX() - 1, fillRect.y() + 1); >- checkGreenPixel(*frontImageBuffer, fillRect.x() + 1, fillRect.maxY() - 1); >- checkGreenPixel(*frontImageBuffer, fillRect.maxX() - 1, fillRect.maxY() - 1); >- >- checkGreenPixel(*backImageBuffer, fillRect.x() + 1, fillRect.y() + 1); >- checkGreenPixel(*backImageBuffer, fillRect.maxX() - 1, fillRect.y() + 1); >- checkGreenPixel(*backImageBuffer, fillRect.x() + 1, fillRect.maxY() - 1); >- checkGreenPixel(*backImageBuffer, fillRect.maxX() - 1, fillRect.maxY() - 1); >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *frontImageBuffer, fillRect.x() + 1, fillRect.y() + 1)); >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *frontImageBuffer, fillRect.maxX() - 1, fillRect.y() + 1)); >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *frontImageBuffer, fillRect.x() + 1, fillRect.maxY() - 1)); >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *frontImageBuffer, fillRect.maxX() - 1, fillRect.maxY() - 1)); >+ >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *backImageBuffer, fillRect.x() + 1, fillRect.y() + 1)); >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *backImageBuffer, fillRect.maxX() - 1, fillRect.y() + 1)); >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *backImageBuffer, fillRect.x() + 1, fillRect.maxY() - 1)); >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *backImageBuffer, fillRect.maxX() - 1, fillRect.maxY() - 1)); > } > >+// Test that drawing an accelerated ImageBuffer to an unaccelerated does not store extra >+// memory to the accelerated ImageBuffer. >+// FIXME: The test is disabled as it appears that WTF::memoryFootprint() is not exact enough to >+// test that GraphicsContext::drawImageBitmap() does not keep extra memory around. >+// However, if the test is paused at the memory measurement location and the process is inspected >+// manually with the memory tools, the footprint is as expected, e.g. drawBitmapImage does not >+// persist additional memory. >+TEST(ImageBufferTests, DISABLED_DrawImageBufferDoesNotReferenceExtraMemory) >+{ >+ auto colorSpace = DestinationColorSpace::SRGB(); >+ auto pixelFormat = PixelFormat::BGRA8; >+ FloatSize logicalSize { 4096, 4096 }; >+ float scale = 1; >+ size_t footprintError = 1024 * 1024; >+ size_t logicalSizeBytes = logicalSize.width() * logicalSize.height() * 4; >+ // FIXME: Logically this fuzz amount should not exist. >+ // WTF::memoryFootprint() does not return the same amount of memory as >+ // the `footprint` command or the leak tools. >+ // At the time of writing, the bug case would report drawImageBitmap footprint >+ // as ~130mb, and fixed case would report ~67mb. >+ size_t drawImageBitmapUnaccountedFootprint = logicalSizeBytes + 3 * 1024 * 1024; >+ >+ { >+ // Make potential accelerated drawing backend instantiate roughly the global structures needed for this test. >+ auto accelerated = ImageBuffer::create(logicalSize, RenderingMode::Accelerated, scale, colorSpace, pixelFormat, nullptr); >+ auto fillRect = FloatRect { { }, logicalSize }; >+ accelerated->context().fillRect(fillRect, Color::green); >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *accelerated, fillRect.maxX() - 1, fillRect.maxY() - 1)); >+ } >+ WTF::releaseFastMallocFreeMemory(); >+ auto initialFootprint = memoryFootprint(); >+ auto lastFootprint = initialFootprint; >+ EXPECT_GT(lastFootprint, 0u); >+ >+ auto accelerated = ImageBuffer::create(logicalSize, RenderingMode::Accelerated, scale, colorSpace, pixelFormat, nullptr); >+ auto fillRect = FloatRect { { }, logicalSize }; >+ accelerated->context().fillRect(fillRect, Color::green); >+ accelerated->flushContext(); >+ EXPECT_TRUE(memoryFootprintChangedBy(lastFootprint, logicalSizeBytes, footprintError)); >+ >+ auto unaccelerated = ImageBuffer::create(logicalSize, RenderingMode::Unaccelerated, scale, colorSpace, pixelFormat, nullptr); >+ unaccelerated->context().fillRect(fillRect, Color::yellow); >+ EXPECT_TRUE(imageBufferPixelIs(Color::yellow, *unaccelerated, fillRect.maxX() - 1, fillRect.maxY() - 1)); >+ EXPECT_TRUE(memoryFootprintChangedBy(lastFootprint, logicalSizeBytes, footprintError)); >+ >+ // The purpose of the whole test is to test that drawImageBuffer does not increase >+ // memory footprint. >+ unaccelerated->context().drawImageBuffer(*accelerated, FloatRect { { }, logicalSize }, FloatRect { { }, logicalSize }, { WebCore::CompositeOperator::Copy }); >+ EXPECT_TRUE(imageBufferPixelIs(Color::green, *unaccelerated, fillRect.maxX() - 1, fillRect.maxY() - 1)); >+ EXPECT_TRUE(memoryFootprintChangedBy(lastFootprint, 0 + drawImageBitmapUnaccountedFootprint, footprintError)); >+ // sleep(10000); // Enable this to inspect the process manually. >+ accelerated = nullptr; >+ unaccelerated = nullptr; >+ lastFootprint = initialFootprint; >+ EXPECT_TRUE(memoryFootprintChangedBy(lastFootprint, 0, footprintError)); >+} > } >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index a0094ac7ffe31b7ccbca2fb3af9262c8073e9d31..a4430c481642ba8e84f42760c590e4cdce6655ee 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,20 @@ >+2021-11-09 Kimmo Kinnunen <kkinnunen@apple.com> >+ >+ REGRESSION (iOS 15, GPU Process): Fails to load texture map >+ https://bugs.webkit.org/show_bug.cgi?id=231471 >+ <rdar://problem/84328146> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a test that sometimes jetsams on device. >+ Jetsam is not deterministic as it is only >+ triggerd during memory pressure. >+ macOS does not trigger jetsam due to platform >+ rules. >+ >+ * fast/canvas/webgl/gl-teximage-imagebitmap-memory.html: Added. >+ * fast/canvas/webgl/resources/green-4000x4000.png: Added. >+ > 2021-11-04 Kate Cheney <katherine_cheney@apple.com> > > Form action with a redirect should report correct blocked URI >diff --git a/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap-memory-expected.txt b/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap-memory-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..a5bc2d4a7b18a36f16bfe9cb3523cb282c6bf81f >--- /dev/null >+++ b/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap-memory-expected.txt >@@ -0,0 +1,68 @@ >+PASS gpu process restart check canvas should be red >+PASS getError was expected value: NO_ERROR : Should be no errors from setup. >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS getError was expected value: NO_ERROR : Should be no errors from setup >+PASS should be green >+PASS gpu process restart check canvas should be red >+PASS gpu process restart check canvas should be green >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap-memory.html b/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap-memory.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cdd4ee933cafbe1f1de5971776d25828e7bf0817 >--- /dev/null >+++ b/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap-memory.html >@@ -0,0 +1,79 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<title>texImage2D with large ImageBitmap.</title> >+<script src="../../../resources/js-test.js"></script> >+<script src="resources/webgl-test.js"> </script> >+<script src="resources/webgl-test-utils-khr.js"> </script> >+</head> >+<body> >+<canvas id="example"></canvas> >+<div id="description"></div> >+<script> >+"use strict"; >+ >+let wtu = WebGLTestUtils; >+ >+async function loadImage(url) { >+ const res = await fetch(url, { mode: 'cors' }); >+ const blob = await res.blob(); >+ const bitmap = await createImageBitmap(blob); >+ return bitmap; >+} >+ >+async function test() { >+ let red = [255, 0, 0, 255]; >+ let green = [0, 255, 0, 255]; >+ >+ let ctx2d = document.createElement("canvas").getContext("2d"); >+ ctx2d.fillStyle = "#ff0000"; >+ ctx2d.fillRect(0, 0, 300, 150); >+ wtu.checkCanvasRect(ctx2d, 0, 0, 300, 150, red, "gpu process restart check canvas should be red", 0); >+ >+ let canvas = document.getElementById("example"); >+ let gl = wtu.create3DContext(canvas, {'depth': false, 'antialias': false, stencil: 'false'}); >+ let program = wtu.setupTexturedQuad(gl); >+ let loc = gl.getUniformLocation(program, "tex"); >+ gl.uniform1i(loc, 0); >+ >+ gl.disable(gl.BLEND); >+ gl.disable(gl.DEPTH_TEST); >+ gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE); >+ let width = canvas.width; >+ let height = canvas.height; >+ >+ glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup."); >+ let bitmapCount = 6; >+ let uploadIterations = 5; >+ let bitmaps = []; >+ for (let i = 0; i < bitmapCount; ++i) >+ bitmaps.push(await loadImage('resources/green-4000x4000.png')); >+ for (let i = 0; i < uploadIterations; ++i) { >+ for (let bitmap of bitmaps) { >+ let tex = gl.createTexture(); >+ gl.bindTexture(gl.TEXTURE_2D, tex); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); >+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); >+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, bitmap); >+ glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup"); >+ wtu.drawUnitQuad(gl); >+ gl.deleteTexture(tex); >+ wtu.checkCanvasRect(gl, 0, 0, width, height, green, "should be green", 0); >+ gl.clear(gl.COLOR_BUFFER_BIT); >+ } >+ } >+ wtu.checkCanvasRect(ctx2d, 0, 0, 300, 150, red, "gpu process restart check canvas should be red", 0); >+ ctx2d.fillStyle = "#00ff00"; >+ ctx2d.fillRect(0, 0, 300, 150); >+ wtu.checkCanvasRect(ctx2d, 0, 0, 300, 150, green, "gpu process restart check canvas should be green", 0); >+} >+ >+initNonKhronosFramework(true); >+ >+test().then(() => { >+ nonKhronosFrameworkNotifyDone() >+}); >+var successfullyParsed = true; >+</script> >diff --git a/LayoutTests/fast/canvas/webgl/resources/green-4000x4000.png b/LayoutTests/fast/canvas/webgl/resources/green-4000x4000.png >new file mode 100644 >index 0000000000000000000000000000000000000000..760649e0fc69dd3ba4bdfaf177bc38e733075c48 >GIT binary patch >literal 289423 >zcmeI*U5uRNb-?l2#fx^=Mp=c{xQX2ku8ATm?1vkLu(jQdaS}U%6uCqgS1Bg2v@5U| >zc^BALRIIDe7O7tn;->0{FLH;C?28D=iX2#we1j@3n%-ClMY*BHifAkK!l<M(o}IIc >zpV>3B9<vnZXJq;K*_n6e{lDjb&Y5|=56|EG?Qh;R__@JKrE=5$eR~g7DxWz~|J{FM >zZRO|B{;aq5N6*ZGZ|<qQ{4bmTz4n*6$%FeJz2~0F_FCLu>FfDy<%ar0YX4PwK3D0x >z99Jse>iK-c2YSA^_?X(k{$i@KZt*dPYJb*$?W_H+J$v!b-V?peM||eQi5r&U`a?J0 >z@gL9C{up>--vcw1%KDq@zk4cw{|}ogmEM1vy6@oZ!F%o=e|Y-H@I#MGe{XVl?#L7M >zXH|C2jn~2>ld}(1=Z-vnbY^^R*VfCA7_Y_k<&mw`%MY1-Y}eL<_uN~(Yx>w^^((`p >z!=qbw4_2$yoyQ(|bo{{HZ!A8&_P1SI|7dphiSdz<r=Na$`03voo<8=6BV%{odFROJ >zj*%TZZm&J!_L)CEI{VPv?MG*RvvH8-arREmJbY~GiP@>?qt*IxANt<(le4?FZmoZ# >z_|<rwvr~^QeW#-{i>FmP!IAn`M#hFmM_N5?a&Bscr`5mGc-rOjYJ9t$^@EK+aA0y~ >z`tc|0FKhQ5J9b|F4j)-udVP&2EIs}^N2g|YH=lCF@|Djzxb*d<Z?k;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{FG7b1c)<%^gboq#f)~699U|ZbFL)6;M8FGP >z@FH}GfET>rMd%O#FL=R=&>;d|@PZeiLj=6w1usH}2zYV5dNK6DQ+M~)_D`yweD<-| >zHor9b%x&qJzS?`^?5*u~Sc<e+IdGhO2P%B<X}?7hztUor?3c(de(|dmq%$vma_%=C >zZtexp+ZJPI$8?<e@^Y+d1!py_t&B-V$shS6e@a1k!3$pSBDVk^d>U0kzsNHIAAIyv >z{UWyjAAI!F(t>hDKg~_S2Osl>x{+Ie4?gCN(t>hDKg~_S2Osl>x{+Ie4?gCN(t>hD >zKg~_S2Osl>x{+Ie4?gCN(t>hDKg~_S2Osl>x{+Ie4?gCN(t>hDKg~_S2Osl>x{+Ie >z4?gCN(t>j3+V;~Q_3e7Oxfj4{Gw|bnZEO5`CN5qW8>sE2G=KWTQ++ch7v6udJi+G5 >z;hr1L4t2BD*y7$Vj+5_3g%3XMw-#wyS#H50f8>w+;YDr%KKL}Mgnp4{0zUZYr}{;1 >z0Y3QXr=<nuihi1#f)76C4Rs^803UqJ8>I#1ihi1#f)76C4Rs^803UqJ8>I#1ihi1# >zf)76C4Rs^803UqJ8>I#1ihi1#f)76C4Rs^803UqJ8>I#1ihi1#f)76C4Rs^803UqJ >z8>I#1ihi1#f=?HGerLy5pQ=>8Fus59*X~>V`Sdaa%N5MKV2<;I{E<K2BdDvn1^D3O >zJwj<gx$=qi(;rTs-&Wf{sj_hCm5pzn8GQZz6{`B_`JV6gce5qn;(jlVlkY%<4?e4S >ze^FEt`6GYi&jc@4IeDrZ>V~?ZZsZo=gHNMM=ofh=;De8Ts$b+5;De8TT3S%9=%=|U >n_~2vSP&aZ5TJV|py<fX^_l2FiKB(UX-2e4&?|pgC;XnI7r<0>> > >literal 0 >HcmV?d00001 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 231471
:
440701
|
443423
| 443687