[Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
authorjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 20:03:18 +0000 (20:03 +0000)
committerjustin_fan@apple.com <justin_fan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 20:03:18 +0000 (20:03 +0000)
commit85dd4977896bf9b6e6f61fd44b5e01177e9a0cbd
tree77fc4c46bed0790b8440e5c1100a57601f8c7679
parentdb6888977410f8f3bec4cefa89bd8aa948f843ab
[Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
https://bugs.webkit.org/show_bug.cgi?id=196719

Reviewed by Myles C. Maxfield.

Source/WebCore:

Implement setBlendColor, setViewport, and setScissorRect for GPURenderPassEncoder.

Tests: webgpu/viewport-scissor-rect-triangle-strip.html, webgpu/blend-color-triangle-strip.html

* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setBlendColor):
(WebCore::WebGPURenderPassEncoder::setViewport):
(WebCore::WebGPURenderPassEncoder::setScissorRect):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setBlendColor):
(WebCore::GPURenderPassEncoder::setViewport):
(WebCore::GPURenderPassEncoder::setScissorRect):

LayoutTests:

Add blend-color-triangle-strip to set and blend with a custom blend color on the renderpass encoder.
Add viewport-scissor-rect-triangle-strip to draw a checkerboard by restricting the drawing viewport or scissor rectangle.

* webgpu/blend-color-triangle-strip.html: Added.
* webgpu/js/webgpu-functions.js:
(beginBasicRenderPass):
* webgpu/viewport-scissor-rect-triangle-strip-expected.html: Added.
* webgpu/viewport-scissor-rect-triangle-strip.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/webgpu/blend-color-triangle-strip-expected.html [new file with mode: 0644]
LayoutTests/webgpu/blend-color-triangle-strip.html [new file with mode: 0644]
LayoutTests/webgpu/js/webgpu-functions.js
LayoutTests/webgpu/viewport-scissor-rect-triangle-strip-expected.html [new file with mode: 0644]
LayoutTests/webgpu/viewport-scissor-rect-triangle-strip.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.cpp
Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.h
Source/WebCore/Modules/webgpu/WebGPURenderPassEncoder.idl
Source/WebCore/platform/graphics/gpu/GPURenderPassEncoder.h
Source/WebCore/platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm