Changeset 213783 in webkit


Ignore:
Timestamp:
Mar 13, 2017 12:18:33 AM (7 years ago)
Author:
jonlee@apple.com
Message:

WebGPU: Backend - hosting WebGPU layers
https://bugs.webkit.org/show_bug.cgi?id=169366
<rdar://problem/30928735>

Reviewed by Dean Jackson.

  • html/canvas/WebGPURenderingContext.cpp:

(WebCore::WebGPURenderingContext::create): Create the device and the
rendering context.

  • platform/graphics/cocoa/GPUCommandBufferMetal.mm:

(WebCore::GPUCommandBuffer::commit):

  • platform/graphics/cocoa/GPUDrawableMetal.mm:

(WebCore::GPUDrawable::release): Fix a log message

  • platform/graphics/gpu/GPUCommandBuffer.cpp:

(WebCore::GPUCommandBuffer::commit): Deleted. Moved to GPUCommandBufferMetal.

  • rendering/RenderLayerBacking.cpp:

(WebCore::canvasCompositingStrategy): WebGPU canvas should return CanvasAsLayerContents.

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r213782 r213783  
     12017-03-13  Jon Lee  <jonlee@apple.com>
     2
     3        WebGPU: Backend - hosting WebGPU layers
     4        https://bugs.webkit.org/show_bug.cgi?id=169366
     5        <rdar://problem/30928735>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * html/canvas/WebGPURenderingContext.cpp:
     10        (WebCore::WebGPURenderingContext::create): Create the device and the
     11        rendering context.
     12        * platform/graphics/cocoa/GPUCommandBufferMetal.mm:
     13        (WebCore::GPUCommandBuffer::commit):
     14        * platform/graphics/cocoa/GPUDrawableMetal.mm:
     15        (WebCore::GPUDrawable::release): Fix a log message
     16        * platform/graphics/gpu/GPUCommandBuffer.cpp:
     17        (WebCore::GPUCommandBuffer::commit): Deleted. Moved to GPUCommandBufferMetal.
     18        * rendering/RenderLayerBacking.cpp:
     19        (WebCore::canvasCompositingStrategy): WebGPU canvas should return CanvasAsLayerContents.
     20
    1212017-03-12  Jon Lee  <jonlee@apple.com>
    222
  • trunk/Source/WebCore/html/canvas/WebGPURenderingContext.cpp

    r213762 r213783  
    7272std::unique_ptr<WebGPURenderingContext> WebGPURenderingContext::create(HTMLCanvasElement& canvas)
    7373{
    74     UNUSED_PARAM(canvas);
    75 /* FIXME: WebGPU - To be implemented.
    76     Document& document = canvas.document();
    77     Frame* frame = document.frame();
    78     if (!frame)
    79         return nullptr;
    80 
    81     GPUDevice::Attributes attributes;
    82 
    83     attributes.antialias = false;
    84 
    85     // FIXME: WebGPU - handle retina.
    86     // if (page)
    87     //     attributes.devicePixelRatio = page->deviceScaleFactor();
    88 
    89     HostWindow* hostWindow = document.view()->root()->hostWindow();
    90     RefPtr<GPUDevice> device(GPUDevice::create(attributes, hostWindow));
     74    RefPtr<GPUDevice> device(GPUDevice::create());
    9175
    9276    if (!device) {
     
    10084
    10185    return renderingContext;
    102 */
    103     return nullptr;
    10486}
    10587
  • trunk/Source/WebCore/platform/graphics/cocoa/GPUCommandBufferMetal.mm

    r213780 r213783  
    6262}
    6363
     64void GPUCommandBuffer::commit()
     65{
     66    if (!m_commandBuffer)
     67        return;
     68
     69    [m_commandBuffer commit];
     70}
     71
    6472} // namespace WebCore
    6573
  • trunk/Source/WebCore/platform/graphics/cocoa/GPUDrawableMetal.mm

    r213780 r213783  
    4949void GPUDrawable::release()
    5050{
    51     LOG(WebGPU, "MetalDrawable::release()");
     51    LOG(WebGPU, "GPUDrawable::release()");
    5252    m_drawable = nullptr;
    5353}
  • trunk/Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp

    r213780 r213783  
    4848}
    4949
    50 void GPUCommandBuffer::commit()
    51 {
    52 }
    53 
    5450RefPtr<GPURenderCommandEncoder> GPUCommandBuffer::createRenderCommandEncoder(GPURenderPassDescriptor* descriptor)
    5551{
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r213466 r213783  
    8585        return CanvasAsLayerContents;
    8686
     87#if ENABLE(WEBGPU)
     88    if (context->isGPU())
     89        return CanvasAsLayerContents;
     90#endif
     91
    8792#if ENABLE(ACCELERATED_2D_CANVAS)
    8893    return CanvasAsLayerContents;
Note: See TracChangeset for help on using the changeset viewer.