diff options
Diffstat (limited to 'WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp')
-rw-r--r-- | WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp index 6424293..7629735 100644 --- a/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp +++ b/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp @@ -58,11 +58,13 @@ SharedGraphicsContext3D::SharedGraphicsContext3D(PassOwnPtr<GraphicsContext3D> c , m_solidFillShader(SolidFillShader::create(m_context.get())) , m_texShader(TexShader::create(m_context.get())) { + allContexts()->add(this); } SharedGraphicsContext3D::~SharedGraphicsContext3D() { m_context->deleteBuffer(m_quadVertices); + allContexts()->remove(this); } void SharedGraphicsContext3D::makeContextCurrent() @@ -112,6 +114,11 @@ void SharedGraphicsContext3D::getIntegerv(unsigned long pname, int* value) m_context->getIntegerv(pname, value); } +void SharedGraphicsContext3D::flush() +{ + m_context->flush(); +} + unsigned SharedGraphicsContext3D::createFramebuffer() { return m_context->createFramebuffer(); @@ -162,6 +169,17 @@ bool SharedGraphicsContext3D::supportsBGRA() return m_context->supportsBGRA(); } +bool SharedGraphicsContext3D::supportsCopyTextureToParentTextureCHROMIUM() + +{ + return m_context->supportsCopyTextureToParentTextureCHROMIUM(); +} + +void SharedGraphicsContext3D::copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture) +{ + return m_context->copyTextureToParentTextureCHROMIUM(texture, parentTexture); +} + Texture* SharedGraphicsContext3D::createTexture(NativeImagePtr ptr, Texture::Format format, int width, int height) { RefPtr<Texture> texture = m_textures.get(ptr); @@ -180,6 +198,28 @@ Texture* SharedGraphicsContext3D::getTexture(NativeImagePtr ptr) return texture ? texture.get() : 0; } +void SharedGraphicsContext3D::removeTextureFor(NativeImagePtr ptr) +{ + TextureHashMap::iterator it = m_textures.find(ptr); + if (it != m_textures.end()) + m_textures.remove(it); +} + +// static +void SharedGraphicsContext3D::removeTexturesFor(NativeImagePtr ptr) +{ + for (HashSet<SharedGraphicsContext3D*>::iterator it = allContexts()->begin(); it != allContexts()->end(); ++it) + (*it)->removeTextureFor(ptr); +} + +// static +HashSet<SharedGraphicsContext3D*>* SharedGraphicsContext3D::allContexts() +{ + static OwnPtr<HashSet<SharedGraphicsContext3D*> > set(new HashSet<SharedGraphicsContext3D*>); + return set.get(); +} + + PassRefPtr<Texture> SharedGraphicsContext3D::createTexture(Texture::Format format, int width, int height) { return Texture::create(m_context.get(), format, width, height); |