diff options
author | Steve Block <steveblock@google.com> | 2011-05-25 19:08:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-08 13:51:31 +0100 |
commit | 2bde8e466a4451c7319e3a072d118917957d6554 (patch) | |
tree | 28f4a1b869a513e565c7760d0e6a06e7cf1fe95a /Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp | |
parent | 6939c99b71d9372d14a0c74a772108052e8c48c8 (diff) | |
download | external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.zip external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.gz external_webkit-2bde8e466a4451c7319e3a072d118917957d6554.tar.bz2 |
Merge WebKit at r82507: Initial merge by git
Change-Id: I60ce9d780725b58b45e54165733a8ffee23b683e
Diffstat (limited to 'Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp index 5d595ad..3667fbb 100644 --- a/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.cpp @@ -29,10 +29,10 @@ #include "PluginLayerChromium.h" -#include "cc/CCLayerImpl.h" #include "GraphicsContext3D.h" #include "LayerRendererChromium.h" -#include <GLES2/gl2.h> +#include "cc/CCLayerImpl.h" +#include "cc/CCPluginLayerImpl.h" namespace WebCore { @@ -43,40 +43,26 @@ PassRefPtr<PluginLayerChromium> PluginLayerChromium::create(GraphicsLayerChromiu PluginLayerChromium::PluginLayerChromium(GraphicsLayerChromium* owner) : LayerChromium(owner) + , m_textureId(0) { } -void PluginLayerChromium::setTextureId(unsigned id) +PassRefPtr<CCLayerImpl> PluginLayerChromium::createCCLayerImpl() { - m_textureId = id; + return CCPluginLayerImpl::create(this); } -void PluginLayerChromium::updateContentsIfDirty() +void PluginLayerChromium::setTextureId(unsigned id) { + m_textureId = id; } -void PluginLayerChromium::draw() +void PluginLayerChromium::pushPropertiesTo(CCLayerImpl* layer) { - ASSERT(layerRenderer()); - const PluginLayerChromium::Program* program = layerRenderer()->pluginLayerProgram(); - ASSERT(program && program->initialized()); - GraphicsContext3D* context = layerRendererContext(); - GLC(context, context->activeTexture(GL_TEXTURE0)); - GLC(context, context->bindTexture(GL_TEXTURE_2D, m_textureId)); - - // FIXME: setting the texture parameters every time is redundant. Move this code somewhere - // where it will only happen once per texture. - GLC(context, context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); - GLC(context, context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); - GLC(context, context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); - GLC(context, context->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); - - layerRenderer()->useShader(program->program()); - GLC(context, context->uniform1i(program->fragmentShader().samplerLocation(), 0)); - drawTexturedQuad(context, layerRenderer()->projectionMatrix(), ccLayerImpl()->drawTransform(), - bounds().width(), bounds().height(), ccLayerImpl()->drawOpacity(), - program->vertexShader().matrixLocation(), - program->fragmentShader().alphaLocation()); + LayerChromium::pushPropertiesTo(layer); + + CCPluginLayerImpl* pluginLayer = static_cast<CCPluginLayerImpl*>(layer); + pluginLayer->setTextureId(m_textureId); } } |