Skip to content

Commit 51171f8

Browse files
committed
[accCanvas] Remove implementation of copyToPlatformTexture.
1 parent af55248 commit 51171f8

2 files changed

Lines changed: 0 additions & 44 deletions

File tree

Source/WebCore/platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -145,49 +145,6 @@ RefPtr<GraphicsLayerContentsDisplayDelegate> ImageBufferCairoGLSurfaceBackend::l
145145
return m_layerContentsDisplayDelegate;
146146
}
147147

148-
bool ImageBufferCairoGLSurfaceBackend::copyToPlatformTexture(GraphicsContextGL&, GCGLenum target, PlatformGLObject destinationTexture, GCGLenum internalFormat, bool premultiplyAlpha, bool flipY) const
149-
{
150-
if (!premultiplyAlpha || flipY)
151-
return false;
152-
153-
if (!m_textures[0])
154-
return false;
155-
156-
GCGLenum bindTextureTarget;
157-
switch (target) {
158-
case GL_TEXTURE_2D:
159-
bindTextureTarget = GL_TEXTURE_2D;
160-
break;
161-
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
162-
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
163-
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
164-
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
165-
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
166-
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
167-
bindTextureTarget = GL_TEXTURE_CUBE_MAP;
168-
break;
169-
default:
170-
return false;
171-
}
172-
173-
auto backendSize = this->backendSize();
174-
cairo_surface_flush(m_surfaces[0].get());
175-
176-
std::unique_ptr<GLContext> context = GLContext::createOffscreenContext(&PlatformDisplay::sharedDisplayForCompositing());
177-
context->makeContextCurrent();
178-
uint32_t fbo;
179-
glGenFramebuffers(1, &fbo);
180-
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
181-
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_textures[0], 0);
182-
glBindTexture(bindTextureTarget, destinationTexture);
183-
glCopyTexImage2D(target, 0, internalFormat, 0, 0, backendSize.width(), backendSize.height(), 0);
184-
glBindTexture(bindTextureTarget, 0);
185-
glBindFramebuffer(GL_FRAMEBUFFER, 0);
186-
glFlush();
187-
glDeleteFramebuffers(1, &fbo);
188-
return true;
189-
}
190-
191148
void ImageBufferCairoGLSurfaceBackend::swapBuffersIfNeeded()
192149
{
193150
auto backendSize = this->backendSize();

Source/WebCore/platform/graphics/cairo/ImageBufferCairoGLSurfaceBackend.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class ImageBufferCairoGLSurfaceBackend : public ImageBufferCairoSurfaceBackend,
2424
virtual ~ImageBufferCairoGLSurfaceBackend();
2525

2626
RefPtr<GraphicsLayerContentsDisplayDelegate> layerContentsDisplayDelegate() const final;
27-
bool copyToPlatformTexture(GraphicsContextGL&, GCGLenum, PlatformGLObject, GCGLenum, bool, bool) const final;
2827

2928
private:
3029
ImageBufferCairoGLSurfaceBackend(const Parameters&, const std::array<uint32_t, 2>&, const std::array<RefPtr<cairo_surface_t>, 2>&);

0 commit comments

Comments
 (0)