diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
commit | 49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch) | |
tree | 5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebKit/chromium/src/WebExternalTextureLayer.cpp | |
parent | b211c645d8ab690f713515dfdc84d80b11c27d2c (diff) | |
download | qtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz |
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/WebKit/chromium/src/WebExternalTextureLayer.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebExternalTextureLayer.cpp | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/Source/WebKit/chromium/src/WebExternalTextureLayer.cpp b/Source/WebKit/chromium/src/WebExternalTextureLayer.cpp index 8f7b58a9d..d9cea3bb1 100644 --- a/Source/WebKit/chromium/src/WebExternalTextureLayer.cpp +++ b/Source/WebKit/chromium/src/WebExternalTextureLayer.cpp @@ -27,6 +27,8 @@ #include <public/WebExternalTextureLayer.h> #include "TextureLayerChromium.h" +#include "cc/CCTextureUpdater.h" +#include <public/WebExternalTextureLayerClient.h> #include <public/WebFloatRect.h> #include <public/WebSize.h> @@ -34,13 +36,57 @@ using namespace WebCore; namespace WebKit { -WebExternalTextureLayer WebExternalTextureLayer::create() +class WebTextureUpdaterImpl : public WebTextureUpdater { +public: + explicit WebTextureUpdaterImpl(CCTextureUpdater& updater) + : m_updater(updater) + { + } + + virtual void appendCopy(unsigned sourceTexture, unsigned destinationTexture, WebSize size) OVERRIDE + { + m_updater.appendCopy(sourceTexture, destinationTexture, size); + } + +private: + CCTextureUpdater& m_updater; +}; + +class WebExternalTextureLayerImpl : public TextureLayerChromiumClient, public TextureLayerChromium { +public: + explicit WebExternalTextureLayerImpl(WebExternalTextureLayerClient* client) + : TextureLayerChromium(client ? this : 0) + , m_client(client) + { + } + + virtual unsigned prepareTexture(CCTextureUpdater& updater) OVERRIDE + { + WebTextureUpdaterImpl updaterImpl(updater); + return m_client->prepareTexture(updaterImpl); + } + + virtual WebKit::WebGraphicsContext3D* context() OVERRIDE + { + return m_client->context(); + } + +private: + WebExternalTextureLayerClient* m_client; +}; + +WebExternalTextureLayer WebExternalTextureLayer::create(WebExternalTextureLayerClient* client) { - RefPtr<TextureLayerChromium> layer = TextureLayerChromium::create(0); + RefPtr<TextureLayerChromium> layer = adoptRef(new WebExternalTextureLayerImpl(client)); layer->setIsDrawable(true); return WebExternalTextureLayer(layer.release()); } +void WebExternalTextureLayer::clearClient() +{ + unwrap<TextureLayerChromium>()->clearClient(); +} + void WebExternalTextureLayer::setTextureId(unsigned id) { unwrap<TextureLayerChromium>()->setTextureId(id); @@ -56,6 +102,26 @@ void WebExternalTextureLayer::setUVRect(const WebFloatRect& rect) unwrap<TextureLayerChromium>()->setUVRect(rect); } +void WebExternalTextureLayer::setOpaque(bool opaque) +{ + unwrap<TextureLayerChromium>()->setOpaque(opaque); +} + +void WebExternalTextureLayer::setPremultipliedAlpha(bool premultipliedAlpha) +{ + unwrap<TextureLayerChromium>()->setPremultipliedAlpha(premultipliedAlpha); +} + +void WebExternalTextureLayer::willModifyTexture() +{ + unwrap<TextureLayerChromium>()->willModifyTexture(); +} + +void WebExternalTextureLayer::setRateLimitContext(bool rateLimit) +{ + unwrap<TextureLayerChromium>()->setRateLimitContext(rateLimit); +} + WebExternalTextureLayer::WebExternalTextureLayer(PassRefPtr<TextureLayerChromium> layer) : WebLayer(layer) { |