- Revision
- 270401
- Author
- [email protected]
- Date
- 2020-12-03 11:58:07 -0800 (Thu, 03 Dec 2020)
Log Message
GraphicsContextGLOpenGL: Rename IOSurfaceTextureTarget to drawingBufferTextureTarget
https://bugs.webkit.org/show_bug.cgi?id=219475
Reviewed by Don Olmstead.
Cocoa port has IOSurfaceTextureTarget method to switch a buffer
target type. Non-Cocoa ports also need a similar method.
Rename IOSurfaceTextureTarget, IOSurfaceTextureTargetQuery and
EGLIOSurfaceTextureTarget to drawingBufferTextureTarget,
drawingBufferTextureTargetQuery and EGLDrawingBufferTextureTarget.
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget):
(WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTargetQuery):
(WebCore::GraphicsContextGLOpenGL::EGLDrawingBufferTextureTarget):
(WebCore::GraphicsContextGLOpenGL::reshapeDisplayBufferBacking):
(WebCore::GraphicsContextGLOpenGL::bindDisplayBufferBacking):
(WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget): Deleted.
(WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery): Deleted.
(WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget): Deleted.
* platform/graphics/cv/GraphicsContextGLCVANGLE.cpp:
(WebCore::GraphicsContextGLCVANGLE::initializeUVContextObjects):
(WebCore::GraphicsContextGLCVANGLE::attachIOSurfaceToTexture):
(WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (270400 => 270401)
--- trunk/Source/WebCore/ChangeLog 2020-12-03 19:29:34 UTC (rev 270400)
+++ trunk/Source/WebCore/ChangeLog 2020-12-03 19:58:07 UTC (rev 270401)
@@ -1,3 +1,35 @@
+2020-12-03 Fujii Hironori <[email protected]>
+
+ GraphicsContextGLOpenGL: Rename IOSurfaceTextureTarget to drawingBufferTextureTarget
+ https://bugs.webkit.org/show_bug.cgi?id=219475
+
+ Reviewed by Don Olmstead.
+
+ Cocoa port has IOSurfaceTextureTarget method to switch a buffer
+ target type. Non-Cocoa ports also need a similar method.
+
+ Rename IOSurfaceTextureTarget, IOSurfaceTextureTargetQuery and
+ EGLIOSurfaceTextureTarget to drawingBufferTextureTarget,
+ drawingBufferTextureTargetQuery and EGLDrawingBufferTextureTarget.
+
+ * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
+ (WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
+ * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
+ (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
+ (WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget):
+ (WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTargetQuery):
+ (WebCore::GraphicsContextGLOpenGL::EGLDrawingBufferTextureTarget):
+ (WebCore::GraphicsContextGLOpenGL::reshapeDisplayBufferBacking):
+ (WebCore::GraphicsContextGLOpenGL::bindDisplayBufferBacking):
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget): Deleted.
+ (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery): Deleted.
+ (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget): Deleted.
+ * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp:
+ (WebCore::GraphicsContextGLCVANGLE::initializeUVContextObjects):
+ (WebCore::GraphicsContextGLCVANGLE::attachIOSurfaceToTexture):
+ (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture):
+ * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
+
2020-12-03 Kimmo Kinnunen <[email protected]>
GraphicsContextGL has a couple non-robust getters and other small API problems preventing GPU process implementation
Modified: trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp (270400 => 270401)
--- trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp 2020-12-03 19:29:34 UTC (rev 270400)
+++ trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp 2020-12-03 19:58:07 UTC (rev 270401)
@@ -231,10 +231,10 @@
gl::BindTexture(GL_TEXTURE_2D, texture2DBinding);
// Attach m_texture to m_preserveDrawingBufferFBO for later blitting.
gl::BindFramebuffer(GL_FRAMEBUFFER, m_preserveDrawingBufferFBO);
- gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, IOSurfaceTextureTarget(), m_texture, 0);
+ gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, drawingBufferTextureTarget(), m_texture, 0);
gl::BindFramebuffer(GL_FRAMEBUFFER, m_fbo);
} else
- gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, IOSurfaceTextureTarget(), m_texture, 0);
+ gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, drawingBufferTextureTarget(), m_texture, 0);
#elif PLATFORM(GTK)
gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_texture);
gl::TexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
Modified: trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm (270400 => 270401)
--- trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm 2020-12-03 19:29:34 UTC (rev 270400)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm 2020-12-03 19:58:07 UTC (rev 270401)
@@ -342,7 +342,7 @@
END_BLOCK_OBJC_EXCEPTIONS
// Create the texture that will be used for the framebuffer.
- GLenum textureTarget = IOSurfaceTextureTarget();
+ GLenum textureTarget = drawingBufferTextureTarget();
gl::GenTextures(1, &m_texture);
gl::BindTexture(textureTarget, m_texture);
@@ -426,7 +426,7 @@
LOG(WebGL, "Destroyed a GraphicsContextGLOpenGL (%p).", this);
}
-GCGLenum GraphicsContextGLOpenGL::IOSurfaceTextureTarget()
+GCGLenum GraphicsContextGLOpenGL::drawingBufferTextureTarget()
{
#if PLATFORM(MACCATALYST)
if (needsEAGLOnMac())
@@ -439,7 +439,7 @@
#endif
}
-GCGLenum GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery()
+GCGLenum GraphicsContextGLOpenGL::drawingBufferTextureTargetQuery()
{
#if PLATFORM(MACCATALYST)
if (needsEAGLOnMac())
@@ -452,7 +452,7 @@
#endif
}
-GCGLint GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget()
+GCGLint GraphicsContextGLOpenGL::EGLDrawingBufferTextureTarget()
{
#if PLATFORM(MACCATALYST)
if (needsEAGLOnMac())
@@ -594,7 +594,7 @@
EGL_WIDTH, size.width(),
EGL_HEIGHT, size.height(),
EGL_IOSURFACE_PLANE_ANGLE, 0,
- EGL_TEXTURE_TARGET, WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget(),
+ EGL_TEXTURE_TARGET, WebCore::GraphicsContextGLOpenGL::EGLDrawingBufferTextureTarget(),
EGL_TEXTURE_INTERNAL_FORMAT_ANGLE, usingAlpha ? GL_BGRA_EXT : GL_RGB,
EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGBA,
EGL_TEXTURE_TYPE_ANGLE, GL_UNSIGNED_BYTE,
@@ -610,8 +610,8 @@
bool GraphicsContextGLOpenGL::bindDisplayBufferBacking(std::unique_ptr<IOSurface> backing, void* pbuffer)
{
- GCGLenum textureTarget = IOSurfaceTextureTarget();
- ScopedRestoreTextureBinding restoreBinding(IOSurfaceTextureTargetQuery(), textureTarget, textureTarget != TEXTURE_RECTANGLE_ARB);
+ GCGLenum textureTarget = drawingBufferTextureTarget();
+ ScopedRestoreTextureBinding restoreBinding(drawingBufferTextureTargetQuery(), textureTarget, textureTarget != TEXTURE_RECTANGLE_ARB);
gl::BindTexture(textureTarget, m_texture);
if (!EGL_BindTexImage(m_displayObj, pbuffer, EGL_BACK_BUFFER)) {
EGL_DestroySurface(m_displayObj, pbuffer);
Modified: trunk/Source/WebCore/platform/graphics/cv/GraphicsContextGLCVANGLE.cpp (270400 => 270401)
--- trunk/Source/WebCore/platform/graphics/cv/GraphicsContextGLCVANGLE.cpp 2020-12-03 19:29:34 UTC (rev 270400)
+++ trunk/Source/WebCore/platform/graphics/cv/GraphicsContextGLCVANGLE.cpp 2020-12-03 19:58:07 UTC (rev 270401)
@@ -456,7 +456,7 @@
bool GraphicsContextGLCVANGLE::initializeUVContextObjects()
{
- const bool useTexture2D = GraphicsContextGLOpenGL::IOSurfaceTextureTarget() == GraphicsContextGL::TEXTURE_2D;
+ const bool useTexture2D = GraphicsContextGLOpenGL::drawingBufferTextureTarget() == GraphicsContextGL::TEXTURE_2D;
PlatformGLObject vertexShader = m_context->createShader(GraphicsContextGL::VERTEX_SHADER);
if (useTexture2D)
@@ -541,7 +541,7 @@
LOG(WebGL, "Unknown texture target %d.", static_cast<int>(target));
return nullptr;
}
- if (eglTextureTarget != GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget()) {
+ if (eglTextureTarget != GraphicsContextGLOpenGL::EGLDrawingBufferTextureTarget()) {
LOG(WebGL, "Mismatch in EGL texture target %d.", static_cast<int>(target));
return nullptr;
}
@@ -639,7 +639,7 @@
auto uvPlaneWidth = IOSurfaceGetWidthOfPlane(surface, 1);
auto uvPlaneHeight = IOSurfaceGetHeightOfPlane(surface, 1);
- GCGLenum videoTextureTarget = GraphicsContextGLOpenGL::IOSurfaceTextureTarget();
+ GCGLenum videoTextureTarget = GraphicsContextGLOpenGL::drawingBufferTextureTarget();
auto uvTexture = m_context->createTexture();
m_context->activeTexture(GraphicsContextGL::TEXTURE1);
Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h (270400 => 270401)
--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h 2020-12-03 19:29:34 UTC (rev 270400)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h 2020-12-03 19:58:07 UTC (rev 270401)
@@ -97,9 +97,9 @@
CALayer* platformLayer() const final { return reinterpret_cast<CALayer*>(m_webGLLayer.get()); }
PlatformGraphicsContextGLDisplay platformDisplay() const { return m_displayObj; }
PlatformGraphicsContextGLConfig platformConfig() const { return m_configObj; }
- static GCGLenum IOSurfaceTextureTarget();
- static GCGLenum IOSurfaceTextureTargetQuery();
- static GCGLint EGLIOSurfaceTextureTarget();
+ static GCGLenum drawingBufferTextureTarget();
+ static GCGLenum drawingBufferTextureTargetQuery();
+ static GCGLint EGLDrawingBufferTextureTarget();
#else
PlatformLayer* platformLayer() const final;
#endif