summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-09-29 17:32:26 +0100
committerSteve Block <steveblock@google.com>2010-09-29 17:35:08 +0100
commit68513a70bcd92384395513322f1b801e7bf9c729 (patch)
tree161b50f75a5921d61731bb25e730005994fcec85 /WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp
parentfd5c6425ce58eb75211be7718d5dee960842a37e (diff)
downloadexternal_webkit-68513a70bcd92384395513322f1b801e7bf9c729.zip
external_webkit-68513a70bcd92384395513322f1b801e7bf9c729.tar.gz
external_webkit-68513a70bcd92384395513322f1b801e7bf9c729.tar.bz2
Merge WebKit at r67908: Initial merge by Git
Change-Id: I43a553e7b3299b28cb6ee8aa035ed70fe342b972
Diffstat (limited to 'WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp')
-rw-r--r--WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp40
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);