summaryrefslogtreecommitdiffstats
path: root/WebKit/chromium/src/GraphicsContext3D.cpp
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-09-13 16:35:48 +0100
committerIain Merrick <husky@google.com>2010-09-16 12:10:42 +0100
commit5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306 (patch)
treeddce1aa5e3b6967a69691892e500897558ff8ab6 /WebKit/chromium/src/GraphicsContext3D.cpp
parent12bec63ec71e46baba27f0bd9bd9d8067683690a (diff)
downloadexternal_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.zip
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.gz
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.bz2
Merge WebKit at r67178 : Initial merge by git.
Change-Id: I57e01163b6866cb029cdadf405a0394a3918bc18
Diffstat (limited to 'WebKit/chromium/src/GraphicsContext3D.cpp')
-rw-r--r--WebKit/chromium/src/GraphicsContext3D.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp
index 6bc5ffe..3051b9b 100644
--- a/WebKit/chromium/src/GraphicsContext3D.cpp
+++ b/WebKit/chromium/src/GraphicsContext3D.cpp
@@ -35,7 +35,7 @@
#include "GraphicsContext3D.h"
#include "CachedImage.h"
-#include "CanvasLayerChromium.h"
+#include "WebGLLayerChromium.h"
#include "CanvasRenderingContext.h"
#include "Chrome.h"
#include "ChromeClientImpl.h"
@@ -55,6 +55,7 @@
#if PLATFORM(CG)
#include "GraphicsContext.h"
+#include "WebGLRenderingContext.h"
#include <CoreGraphics/CGContext.h>
#include <CoreGraphics/CGImage.h>
#endif
@@ -103,7 +104,7 @@ public:
void prepareTexture();
#if USE(ACCELERATED_COMPOSITING)
- CanvasLayerChromium* platformLayer() const;
+ WebGLLayerChromium* platformLayer() const;
#endif
bool isGLES2Compliant() const;
bool isGLES2NPOTStrict() const;
@@ -298,7 +299,7 @@ private:
OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
WebKit::WebViewImpl* m_webViewImpl;
#if USE(ACCELERATED_COMPOSITING)
- RefPtr<CanvasLayerChromium> m_compositingLayer;
+ RefPtr<WebGLLayerChromium> m_compositingLayer;
#endif
#if PLATFORM(SKIA)
// If the width and height of the Canvas's backing store don't
@@ -360,7 +361,7 @@ bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs,
m_impl.set(webContext);
#if USE(ACCELERATED_COMPOSITING)
- m_compositingLayer = CanvasLayerChromium::create(0);
+ m_compositingLayer = WebGLLayerChromium::create(0);
#endif
return true;
}
@@ -381,7 +382,7 @@ void GraphicsContext3DInternal::prepareTexture()
}
#if USE(ACCELERATED_COMPOSITING)
-CanvasLayerChromium* GraphicsContext3DInternal::platformLayer() const
+WebGLLayerChromium* GraphicsContext3DInternal::platformLayer() const
{
return m_compositingLayer.get();
}
@@ -436,10 +437,10 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon
canvas.drawBitmapRect(m_resizingBitmap, 0, dst);
}
#elif PLATFORM(CG)
- if (m_renderOutput)
- context->graphicsContext3D()->paintToCanvas(m_renderOutput, m_impl->width(), m_impl->height(),
- canvas->width(), canvas->height(),
- imageBuffer->context()->platformContext());
+ if (m_renderOutput && context->is3d()) {
+ WebGLRenderingContext* webGLContext = static_cast<WebGLRenderingContext*>(context);
+ webGLContext->graphicsContext3D()->paintToCanvas(m_renderOutput, m_impl->width(), m_impl->height(), canvas->width(), canvas->height(), imageBuffer->context()->platformContext());
+ }
#else
#error Must port to your platform
#endif
@@ -1039,7 +1040,7 @@ void GraphicsContext3D::prepareTexture()
#if USE(ACCELERATED_COMPOSITING)
PlatformLayer* GraphicsContext3D::platformLayer() const
{
- CanvasLayerChromium* canvasLayer = m_internal->platformLayer();
+ WebGLLayerChromium* canvasLayer = m_internal->platformLayer();
canvasLayer->setContext(this);
return canvasLayer;
}