Changeset 270899 in webkit


Ignore:
Timestamp:
Dec 16, 2020 12:04:41 PM (23 months ago)
Author:
Fujii Hironori
Message:

[WinCairo] Enable USE_ANGLE
https://bugs.webkit.org/show_bug.cgi?id=219421

Reviewed by Don Olmstead.

.:

  • Source/cmake/OptionsWinCairo.cmake:

Source/ThirdParty/ANGLE:

  • CMakeLists.txt: Added entry_points_egl_ext.h to libglesv2_entry_points_headers.

Source/WebCore:

Switch GraphicsContextGLOpenGL implementation from old one
(GraphicsContextGLOpenGLES.cpp) to new one
(GraphicsContextGLANGLE.cpp), which is using ANGLE's internal API
and verification code, for WinCairo port. I will enable WebGL2 for
WinCairo in a follow-up patch.

GL_TEXTURE_RECTANGLE_ANGLE is not available for ANGLE D3D backend.
Use GL_TEXTURE_2D instead.

Add a new class WebCore::ANGLEContext by copying
Nicosia::GCGLANGLELayer::ANGLEContext. It'd be better to merge
them after GTK and WPE will also switch.

  • PlatformWin.cmake:
  • platform/TextureMapper.cmake:
  • platform/graphics/angle/GraphicsContextGLANGLE.cpp:

(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
(WebCore::GraphicsContextGLOpenGL::compileShader):

  • platform/graphics/opengl/GraphicsContextGLOpenGL.h:
  • platform/graphics/texmap/ANGLEContext.cpp: Added.

(WebCore::ANGLEContext::errorString):
(WebCore::ANGLEContext::lastErrorString):
(WebCore::ANGLEContext::createContext):
(WebCore::ANGLEContext::ANGLEContext):
(WebCore::ANGLEContext::~ANGLEContext):
(WebCore::ANGLEContext::makeContextCurrent):
(WebCore::ANGLEContext::platformContext const):

  • platform/graphics/texmap/ANGLEContext.h: Added.
  • platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:

(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::isGLES2Compliant const):
(WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget):

  • platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:

(WebCore::TextureMapperGCGLPlatformLayer::TextureMapperGCGLPlatformLayer):
(WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):

  • platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h:

LayoutTests:

  • platform/wincairo/TestExpectations:
Location:
trunk
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r270751 r270899  
     12020-12-16  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo] Enable USE_ANGLE
     4        https://bugs.webkit.org/show_bug.cgi?id=219421
     5
     6        Reviewed by Don Olmstead.
     7
     8        * Source/cmake/OptionsWinCairo.cmake:
     9
    1102020-12-13  Don Olmstead  <don.olmstead@sony.com>
    211
  • trunk/LayoutTests/ChangeLog

    r270896 r270899  
     12020-12-16  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo] Enable USE_ANGLE
     4        https://bugs.webkit.org/show_bug.cgi?id=219421
     5
     6        Reviewed by Don Olmstead.
     7
     8        * platform/wincairo/TestExpectations:
     9
    1102020-12-16  Chris Fleizach  <cfleizach@apple.com>
    211
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r270755 r270899  
    21322132storage/indexeddb/storage-limit-with-indices.html [ Failure ]
    21332133webgl/1.0.3/conformance/canvas/drawingbuffer-test.html [ Skip ] # Timeout
    2134 webgl/1.0.3/conformance/context/context-lost-restored.html [ Failure ]
    21352134webgl/1.0.3/conformance/context/premultiplyalpha-test.html [ Failure ]
     2135webgl/1.0.3/conformance/extensions/oes-element-index-uint.html [ Failure ]
    21362136webgl/1.0.3/conformance/extensions/oes-texture-float-with-video.html [ Skip ] # Timeout
    2137 webgl/1.0.3/conformance/extensions/oes-texture-float.html [ Failure ]
    21382137webgl/1.0.3/conformance/extensions/oes-texture-half-float-with-video.html [ Skip ] # Timeout
    2139 webgl/1.0.3/conformance/extensions/oes-texture-half-float.html [ Failure ]
    2140 webgl/1.0.3/conformance/extensions/webgl-compressed-texture-size-limit.html [ Failure ]
     2138webgl/1.0.3/conformance/glsl/bugs/array-of-struct-with-int-first-position.html [ Skip ] # This test makes DumpRenderTree process unable to exit
    21412139webgl/1.0.3/conformance/glsl/bugs/long-expressions-should-not-crash.html [ Skip ] # Timeout
    2142 webgl/1.0.3/conformance/more/functions/copyTexImage2DBadArgs.html [ Skip ] # Timeout
     2140webgl/1.0.3/conformance/misc/uninitialized-test.html [ Failure ]
    21432141webgl/1.0.3/conformance/more/functions/readPixelsBadArgs.html [ Failure ]
    21442142webgl/1.0.3/conformance/more/functions/texImage2DHTML.html [ Failure ]
    21452143webgl/1.0.3/conformance/more/functions/texSubImage2DHTML.html [ Failure ]
    2146 webgl/1.0.3/conformance/more/functions/texSubImage2DHTMLBadArgs.html [ Skip ] # Crash
    2147 webgl/1.0.3/conformance/renderbuffers/feedback-loop.html [ Failure ]
     2144webgl/1.0.3/conformance/programs/program-test.html [ Failure ]
    21482145webgl/1.0.3/conformance/renderbuffers/framebuffer-object-attachment.html [ Failure ]
    2149 webgl/1.0.3/conformance/rendering/point-no-attributes.html [ Failure ]
     2146webgl/1.0.3/conformance/renderbuffers/framebuffer-state-restoration.html [ Failure ]
     2147webgl/1.0.3/conformance/renderbuffers/renderbuffer-initialization.html [ Failure ]
    21502148webgl/1.0.3/conformance/textures/default-texture.html [ Failure ]
    21512149webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html [ Skip ] # Timeout
     
    21532151webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html [ Skip ] # Timeout
    21542152webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video.html [ Skip ] # Timeout
    2155 webgl/1.0.3/conformance/textures/tex-sub-image-2d-bad-args.html [ Skip ] # Crash
    2156 webgl/1.0.3/conformance/textures/texture-copying-feedback-loops.html [ Failure ]
     2153webgl/1.0.3/conformance/textures/texture-attachment-formats.html [ Failure ]
     2154webgl/1.0.3/conformance/textures/texture-mips.html [ Failure ]
    21572155webgl/1.0.3/conformance/textures/texture-upload-size.html [ Skip ] # Timeout
    2158 webgl/conformance/extensions/ext-texture-compression-rgtc.html [ Failure ]
    2159 webgl/conformance/extensions/s3tc-and-rgtc.html [ Failure ]
    21602156webgl/webgl-vertex-array-object-defined.html [ Failure ]
  • trunk/Source/ThirdParty/ANGLE/CMakeLists.txt

    r270351 r270899  
    171171    set(libglesv2_entry_points_headers
    172172        src/libGLESv2/entry_points_egl.h
     173        src/libGLESv2/entry_points_egl_ext.h
    173174        src/libGLESv2/entry_points_gles_2_0_autogen.h
    174175        src/libGLESv2/entry_points_gles_3_0_autogen.h
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r270779 r270899  
     12020-12-16  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo] Enable USE_ANGLE
     4        https://bugs.webkit.org/show_bug.cgi?id=219421
     5
     6        Reviewed by Don Olmstead.
     7
     8        * CMakeLists.txt: Added entry_points_egl_ext.h to libglesv2_entry_points_headers.
     9
    1102020-12-14  Alex Christensen  <achristensen@webkit.org>
    211
  • trunk/Source/WebCore/ChangeLog

    r270896 r270899  
     12020-12-16  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo] Enable USE_ANGLE
     4        https://bugs.webkit.org/show_bug.cgi?id=219421
     5
     6        Reviewed by Don Olmstead.
     7
     8        Switch GraphicsContextGLOpenGL implementation from old one
     9        (GraphicsContextGLOpenGLES.cpp) to new one
     10        (GraphicsContextGLANGLE.cpp), which is using ANGLE's internal API
     11        and verification code, for WinCairo port. I will enable WebGL2 for
     12        WinCairo in a follow-up patch.
     13
     14        GL_TEXTURE_RECTANGLE_ANGLE is not available for ANGLE D3D backend.
     15        Use GL_TEXTURE_2D instead.
     16
     17        Add a new class WebCore::ANGLEContext by copying
     18        Nicosia::GCGLANGLELayer::ANGLEContext. It'd be better to merge
     19        them after GTK and WPE will also switch.
     20
     21        * PlatformWin.cmake:
     22        * platform/TextureMapper.cmake:
     23        * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
     24        (WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
     25        (WebCore::GraphicsContextGLOpenGL::compileShader):
     26        * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
     27        * platform/graphics/texmap/ANGLEContext.cpp: Added.
     28        (WebCore::ANGLEContext::errorString):
     29        (WebCore::ANGLEContext::lastErrorString):
     30        (WebCore::ANGLEContext::createContext):
     31        (WebCore::ANGLEContext::ANGLEContext):
     32        (WebCore::ANGLEContext::~ANGLEContext):
     33        (WebCore::ANGLEContext::makeContextCurrent):
     34        (WebCore::ANGLEContext::platformContext const):
     35        * platform/graphics/texmap/ANGLEContext.h: Added.
     36        * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
     37        (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
     38        (WebCore::GraphicsContextGLOpenGL::isGLES2Compliant const):
     39        (WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget):
     40        * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
     41        (WebCore::TextureMapperGCGLPlatformLayer::TextureMapperGCGLPlatformLayer):
     42        (WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):
     43        * platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h:
     44
    1452020-12-16  Chris Fleizach  <cfleizach@apple.com>
    246
  • trunk/Source/WebCore/PlatformWin.cmake

    r266672 r270899  
    77    "${WEBCORE_DIR}/page/win"
    88    "${WEBCORE_DIR}/platform/graphics/egl"
     9    "${WEBCORE_DIR}/platform/graphics/angle"
    910    "${WEBCORE_DIR}/platform/graphics/opengl"
    1011    "${WEBCORE_DIR}/platform/graphics/opentype"
     
    3839    platform/audio/PlatformMediaSessionManager.cpp
    3940
     41    platform/graphics/angle/ExtensionsGLANGLE.cpp
     42    platform/graphics/angle/GraphicsContextGLANGLE.cpp
     43    platform/graphics/angle/TemporaryANGLESetting.cpp
     44
    4045    platform/graphics/egl/GLContextEGL.cpp
    4146
    42     platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp
    43     platform/graphics/opengl/ExtensionsGLOpenGLES.cpp
    44     platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp
    45     platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp
    46     platform/graphics/opengl/GraphicsContextGLOpenGLPrivate.cpp
    4747    platform/graphics/opengl/TemporaryOpenGLSetting.cpp
    4848
  • trunk/Source/WebCore/platform/TextureMapper.cmake

    r267735 r270899  
    66list(APPEND WebCore_SOURCES
    77    platform/graphics/nicosia/NicosiaAnimation.cpp
     8
     9    platform/graphics/texmap/ANGLEContext.cpp
    810    platform/graphics/texmap/BitmapTexture.cpp
    911    platform/graphics/texmap/BitmapTexturePool.cpp
     
    1921list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS
    2022    platform/graphics/nicosia/NicosiaAnimation.h
     23
     24    platform/graphics/texmap/ANGLEContext.h
    2125    platform/graphics/texmap/BitmapTexture.h
    2226    platform/graphics/texmap/ClipStack.h
  • trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp

    r270566 r270899  
    224224    } else
    225225        gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, drawingBufferTextureTarget(), m_texture, 0);
    226 #elif PLATFORM(GTK)
    227     gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_texture);
    228     gl::TexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
    229     gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ANGLE, m_texture, 0);
     226#else
     227    GLenum textureTarget = drawingBufferTextureTarget();
     228    GLuint internalColorFormat = textureTarget == GL_TEXTURE_2D ? colorFormat : m_internalColorFormat;
     229    gl::BindTexture(textureTarget, m_texture);
     230    gl::TexImage2D(textureTarget, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
     231    gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureTarget, m_texture, 0);
     232#if USE(COORDINATED_GRAPHICS)
    230233    if (m_compositorTexture) {
    231         gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_compositorTexture);
    232         gl::TexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
    233         gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, 0);
    234         gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_intermediateTexture);
    235         gl::TexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
    236         gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, 0);
    237     }
    238 #else
    239 #error FIXME: Port to non-Cocoa platforms.
     234        gl::BindTexture(textureTarget, m_compositorTexture);
     235        gl::TexImage2D(textureTarget, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
     236        gl::BindTexture(textureTarget, 0);
     237        gl::BindTexture(textureTarget, m_intermediateTexture);
     238        gl::TexImage2D(textureTarget, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
     239        gl::BindTexture(textureTarget, 0);
     240    }
     241#endif
    240242#endif // PLATFORM(COCOA)
    241243
     
    10711073        return;
    10721074
     1075#if !PLATFORM(WIN)
    10731076    // We need the ANGLE_texture_rectangle extension to support IOSurface
    10741077    // backbuffers, but we don't want it exposed to WebGL user shaders.
    10751078    // Temporarily disable it during shader compilation.
    10761079    gl::Disable(GL_TEXTURE_RECTANGLE_ANGLE);
     1080#endif
    10771081    gl::CompileShader(shader);
     1082#if !PLATFORM(WIN)
    10781083    gl::Enable(GL_TEXTURE_RECTANGLE_ANGLE);
     1084#endif
    10791085}
    10801086
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h

    r270587 r270899  
    103103    PlatformGraphicsContextGLDisplay platformDisplay() const { return m_displayObj; }
    104104    PlatformGraphicsContextGLConfig platformConfig() const { return m_configObj; }
    105     static GCGLenum drawingBufferTextureTarget();
    106105    static GCGLenum drawingBufferTextureTargetQuery();
    107106    static GCGLint EGLDrawingBufferTextureTarget();
    108107#else
    109108    PlatformLayer* platformLayer() const final;
     109#endif
     110#if USE(ANGLE)
     111    static GCGLenum drawingBufferTextureTarget();
    110112#endif
    111113
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp

    r270566 r270899  
    33 * Copyright (C) 2010 Google Inc. All rights reserved.
    44 * Copyright (C) 2011 Igalia S.L.
     5 * Copyright (C) 2020 Sony Interactive Entertainment Inc.
    56 *
    67 * Redistribution and use in source and binary forms, with or without
     
    114115{
    115116    ASSERT_UNUSED(sharedContext, !sharedContext);
     117    m_isForWebGL2 = attributes.isWebGL2;
    116118#if USE(NICOSIA)
    117119    m_nicosiaLayer = WTF::makeUnique<Nicosia::GCGLANGLELayer>(*this, destination);
     
    126128
    127129    if (destination == Destination::Offscreen) {
     130        GLenum textureTarget = drawingBufferTextureTarget();
    128131        // Create a texture to render into.
    129132        gl::GenTextures(1, &m_texture);
    130         gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_texture);
    131         gl::TexParameterf(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    132         gl::TexParameterf(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    133         gl::TexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    134         gl::TexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    135         gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, 0);
     133        gl::BindTexture(textureTarget, m_texture);
     134        gl::TexParameterf(textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     135        gl::TexParameterf(textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     136        gl::TexParameteri(textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     137        gl::TexParameteri(textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     138        gl::BindTexture(textureTarget, 0);
    136139
    137140        // Create an FBO.
     
    141144#if USE(COORDINATED_GRAPHICS)
    142145        gl::GenTextures(1, &m_compositorTexture);
    143         gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_compositorTexture);
    144         gl::TexParameterf(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    145         gl::TexParameterf(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    146         gl::TexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    147         gl::TexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     146        gl::BindTexture(texureType, m_compositorTexture);
     147        gl::TexParameterf(texureType, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     148        gl::TexParameterf(texureType, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     149        gl::TexParameteri(texureType, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     150        gl::TexParameteri(texureType, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    148151
    149152        gl::GenTextures(1, &m_intermediateTexture);
    150         gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_intermediateTexture);
    151         gl::TexParameterf(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    152         gl::TexParameterf(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    153         gl::TexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    154         gl::TexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    155 
    156         gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, 0);
     153        gl::BindTexture(texureType, m_intermediateTexture);
     154        gl::TexParameterf(texureType, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     155        gl::TexParameterf(texureType, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     156        gl::TexParameteri(texureType, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     157        gl::TexParameteri(texureType, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
     158
     159        gl::BindTexture(texureType, 0);
    157160#endif
    158161
     
    413416bool GraphicsContextGLOpenGL::isGLES2Compliant() const
    414417{
    415 #if USE(OPENGL_ES)
     418#if USE(ANGLE)
     419    return m_isForWebGL2;
     420#elif USE(OPENGL_ES)
    416421    return true;
    417422#else
     
    428433#endif
    429434}
     435
     436#if USE(ANGLE)
     437GCGLenum GraphicsContextGLOpenGL::drawingBufferTextureTarget()
     438{
     439#if PLATFORM(WIN)
     440    return GL_TEXTURE_2D;
     441#else
     442    return GL_TEXTURE_RECTANGLE_ANGLE;
     443#endif
     444}
     445#endif
    430446
    431447#if PLATFORM(GTK) && !USE(ANGLE)
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp

    r270477 r270899  
    11/*
    22 * Copyright (C) 2011, 2012, 2017 Igalia S.L.
     3 * Copyright (C) 2020 Sony Interactive Entertainment Inc.
    34 *
    45 *  This library is free software; you can redistribute it and/or
     
    2324#if ENABLE(WEBGL) && USE(TEXTURE_MAPPER) && !USE(NICOSIA)
    2425
     26#include "ANGLEContext.h"
     27#include "ANGLEHeaders.h"
    2528#include "BitmapTextureGL.h"
    2629#include "GLContext.h"
     
    3538{
    3639    switch (destination) {
    37     case GraphicsContextGLOpenGL::Destination::Offscreen:
    38         m_glContext = GLContext::createOffscreenContext(&PlatformDisplay::sharedDisplayForCompositing());
     40    case GraphicsContextGLOpenGL::Destination::Offscreen: {
     41        auto sharingContext = PlatformDisplay::sharedDisplayForCompositing().sharingGLContext()->platformContext();
     42        m_glContext = ANGLEContext::createContext(sharingContext, context.contextAttributes().isWebGL2);
    3943        break;
     44    }
    4045    case GraphicsContextGLOpenGL::Destination::DirectlyToHostWindow:
    4146        ASSERT_NOT_REACHED();
     
    102107    if (attrs.antialias && m_context.m_state.boundDrawFBO == m_context.m_multisampleFBO) {
    103108        GLContext* previousActiveContext = GLContext::current();
    104         if (previousActiveContext != m_glContext.get())
    105             m_context.makeContextCurrent();
     109        m_context.makeContextCurrent();
    106110
    107111        m_context.resolveMultisamplingIfNecessary();
    108         ::glBindFramebuffer(GraphicsContextGLOpenGL::FRAMEBUFFER, m_context.m_state.boundDrawFBO);
     112        gl::BindFramebuffer(GL_FRAMEBUFFER, m_context.m_state.boundDrawFBO);
    109113
    110         if (previousActiveContext && previousActiveContext != m_glContext.get())
     114        if (previousActiveContext)
    111115            previousActiveContext->makeContextCurrent();
    112116    }
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h

    r270477 r270899  
    2929namespace WebCore {
    3030
    31 class GLContext;
     31class ANGLEContext;
    3232class TextureMapperPlatformLayerProxy;
    3333
     
    5050private:
    5151    GraphicsContextGLOpenGL& m_context;
    52     std::unique_ptr<GLContext> m_glContext;
     52    std::unique_ptr<ANGLEContext> m_glContext;
    5353
    5454#if USE(COORDINATED_GRAPHICS)
  • trunk/Source/cmake/OptionsWinCairo.cmake

    r270477 r270899  
    4646
    4747set(USE_ANGLE_EGL ON)
     48set(USE_ANGLE_WEBGL ON)
    4849
     50SET_AND_EXPOSE_TO_BUILD(USE_ANGLE ON)
    4951SET_AND_EXPOSE_TO_BUILD(USE_CAIRO ON)
    5052SET_AND_EXPOSE_TO_BUILD(USE_CF ON)
Note: See TracChangeset for help on using the changeset viewer.