summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/WebCore/platform/graphics/android/BaseLayerAndroid.h2
-rw-r--r--Source/WebCore/platform/graphics/android/GaneshContext.cpp104
-rw-r--r--Source/WebCore/platform/graphics/android/GaneshContext.h12
-rw-r--r--Source/WebCore/platform/graphics/android/ImagesManager.h2
-rw-r--r--Source/WebCore/platform/graphics/android/TextureInfo.cpp1
-rw-r--r--Source/WebCore/platform/graphics/android/TextureInfo.h5
-rw-r--r--Source/WebKit/android/jni/WebViewCore.h1
7 files changed, 19 insertions, 108 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h
index a807b8b..5560f58 100644
--- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h
@@ -26,6 +26,8 @@
#ifndef BaseLayerAndroid_h
#define BaseLayerAndroid_h
+#include <utils/threads.h>
+
#include "Color.h"
#include "Layer.h"
#include "PictureSet.h"
diff --git a/Source/WebCore/platform/graphics/android/GaneshContext.cpp b/Source/WebCore/platform/graphics/android/GaneshContext.cpp
index 1a5ce5e..80fe749 100644
--- a/Source/WebCore/platform/graphics/android/GaneshContext.cpp
+++ b/Source/WebCore/platform/graphics/android/GaneshContext.cpp
@@ -51,9 +51,6 @@ namespace WebCore {
GaneshContext::GaneshContext()
: m_grContext(0)
- , m_baseTileDeviceFBO(0)
- , m_baseTileFBO(0)
- , m_baseTileStencil(0)
, m_baseTileDeviceSurface(0)
, m_surfaceConfig(0)
, m_surfaceContext(EGL_NO_CONTEXT)
@@ -95,18 +92,6 @@ SkDevice* GaneshContext::getDeviceForBaseTile(const TileRenderInfo& renderInfo)
contextNeedsReset = true;
}
- SkDevice* device = getDeviceForBaseTileSurface(renderInfo);
-
- // We must reset the Ganesh context only after we are sure we have
- // re-established our EGLContext as the current context.
- if (device && contextNeedsReset)
- getGrContext()->resetContext();
-
- return device;
-}
-
-SkDevice* GaneshContext::getDeviceForBaseTileSurface(const TileRenderInfo& renderInfo)
-{
EGLDisplay display;
if (!m_surfaceContext) {
@@ -150,7 +135,6 @@ SkDevice* GaneshContext::getDeviceForBaseTileSurface(const TileRenderInfo& rende
}
TransferQueue* tileQueue = TilesManager::instance()->transferQueue();
-
if (tileQueue->m_eglSurface == EGL_NO_SURFACE) {
const float tileWidth = renderInfo.tileSize.width();
@@ -175,17 +159,16 @@ SkDevice* GaneshContext::getDeviceForBaseTileSurface(const TileRenderInfo& rende
if (!m_baseTileDeviceSurface) {
- GrPlatformSurfaceDesc surfaceDesc;
- surfaceDesc.fSurfaceType = kRenderTarget_GrPlatformSurfaceType;
- surfaceDesc.fRenderTargetFlags = kNone_GrPlatformRenderTargetFlagBit;
- surfaceDesc.fWidth = TilesManager::tileWidth();
- surfaceDesc.fHeight = TilesManager::tileHeight();
- surfaceDesc.fConfig = kRGBA_8888_GrPixelConfig;
- surfaceDesc.fStencilBits = 8;
- surfaceDesc.fPlatformRenderTarget = 0;
+ GrPlatformRenderTargetDesc renderTargetDesc;
+ renderTargetDesc.fWidth = TilesManager::tileWidth();
+ renderTargetDesc.fHeight = TilesManager::tileHeight();
+ renderTargetDesc.fConfig = kRGBA_8888_PM_GrPixelConfig;
+ renderTargetDesc.fSampleCnt = 0;
+ renderTargetDesc.fStencilBits = 8;
+ renderTargetDesc.fRenderTargetHandle = 0;
GrContext* grContext = getGrContext();
- GrRenderTarget* renderTarget = (GrRenderTarget*) grContext->createPlatformSurface(surfaceDesc);
+ GrRenderTarget* renderTarget = grContext->createPlatformRenderTarget(renderTargetDesc);
m_baseTileDeviceSurface = new SkGpuDevice(grContext, renderTarget);
renderTarget->unref();
@@ -193,76 +176,17 @@ SkDevice* GaneshContext::getDeviceForBaseTileSurface(const TileRenderInfo& rende
}
GLUtils::checkGlError("getDeviceForBaseTile");
- return m_baseTileDeviceSurface;
-}
-
-SkDevice* GaneshContext::getDeviceForBaseTileFBO(const TileRenderInfo& renderInfo)
-{
- const GLuint textureId = renderInfo.textureInfo->m_textureId;
- const float tileWidth = renderInfo.tileSize.width();
- const float tileHeight = renderInfo.tileSize.height();
-
- // bind to the current texture
- glBindTexture(GL_TEXTURE_2D, textureId);
-
- // setup the texture if needed
- if (renderInfo.textureInfo->m_width != tileWidth
- || renderInfo.textureInfo->m_height != tileHeight) {
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tileWidth, tileHeight,
- 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- renderInfo.textureInfo->m_width = tileWidth;
- renderInfo.textureInfo->m_height = tileHeight;
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- }
-
- if (!m_baseTileFBO) {
- glGenFramebuffers(1, &m_baseTileFBO);
- XLOG("generated FBO");
- }
-
- if (!m_baseTileStencil) {
- glGenRenderbuffers(1, &m_baseTileStencil);
- glBindRenderbuffer(GL_RENDERBUFFER, m_baseTileStencil);
- glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8,
- TilesManager::tileWidth(),
- TilesManager::tileHeight());
- glClearStencil(0);
- glClear(GL_STENCIL_BUFFER_BIT);
- XLOG("generated stencil");
- }
-
- // bind the FBO and attach the texture and stencil
- glBindFramebuffer(GL_FRAMEBUFFER, m_baseTileFBO);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureId, 0);
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, m_baseTileStencil);
-
- if (!m_baseTileDeviceFBO) {
-
- GrPlatformSurfaceDesc surfaceDesc;
- surfaceDesc.fSurfaceType = kRenderTarget_GrPlatformSurfaceType;
- surfaceDesc.fRenderTargetFlags = kNone_GrPlatformRenderTargetFlagBit;
- surfaceDesc.fWidth = TilesManager::tileWidth();
- surfaceDesc.fHeight = TilesManager::tileHeight();
- surfaceDesc.fConfig = kRGBA_8888_GrPixelConfig;
- surfaceDesc.fStencilBits = 8;
- surfaceDesc.fPlatformRenderTarget = m_baseTileFBO;
-
- GrContext* grContext = getGrContext();
- GrRenderTarget* renderTarget = (GrRenderTarget*) grContext->createPlatformSurface(surfaceDesc);
-
- m_baseTileDeviceFBO = new SkGpuDevice(grContext, renderTarget);
- renderTarget->unref();
- XLOG("generated device %p", m_baseTileDeviceFBO);
- }
+ // We must reset the Ganesh context only after we are sure we have
+ // re-established our EGLContext as the current context.
+ if (m_baseTileDeviceSurface && contextNeedsReset)
+ getGrContext()->resetContext();
- GLUtils::checkGlError("getDeviceForBaseTile");
- return m_baseTileDeviceFBO;
+ return m_baseTileDeviceSurface;
}
+
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/android/GaneshContext.h b/Source/WebCore/platform/graphics/android/GaneshContext.h
index 12ea92d..def35e5 100644
--- a/Source/WebCore/platform/graphics/android/GaneshContext.h
+++ b/Source/WebCore/platform/graphics/android/GaneshContext.h
@@ -48,20 +48,8 @@ private:
GaneshContext();
GrContext* getGrContext();
-
- // Creates a device for rendering into a SurfaceTexture via an EGLSurface
- SkDevice* getDeviceForBaseTileSurface(const TileRenderInfo& renderInfo);
- // Creates a device for rendering into a EGLImage via an FBO
- SkDevice* getDeviceForBaseTileFBO(const TileRenderInfo& renderInfo);
-
GrContext* m_grContext;
- // FBO specific variables
- SkGpuDevice* m_baseTileDeviceFBO;
- GLuint m_baseTileFBO;
- GLuint m_baseTileStencil;
-
- // Surface specific variables
SkGpuDevice* m_baseTileDeviceSurface;
EGLConfig m_surfaceConfig;
EGLContext m_surfaceContext;
diff --git a/Source/WebCore/platform/graphics/android/ImagesManager.h b/Source/WebCore/platform/graphics/android/ImagesManager.h
index a3ea859..b915a46 100644
--- a/Source/WebCore/platform/graphics/android/ImagesManager.h
+++ b/Source/WebCore/platform/graphics/android/ImagesManager.h
@@ -32,6 +32,8 @@
#include "SkRefCnt.h"
#include "Vector.h"
+#include <utils/threads.h>
+
namespace WebCore {
class ImageTexture;
diff --git a/Source/WebCore/platform/graphics/android/TextureInfo.cpp b/Source/WebCore/platform/graphics/android/TextureInfo.cpp
index 56b6698..f5c8b02 100644
--- a/Source/WebCore/platform/graphics/android/TextureInfo.cpp
+++ b/Source/WebCore/platform/graphics/android/TextureInfo.cpp
@@ -41,7 +41,6 @@ TextureInfo::TextureInfo()
m_width = 0;
m_height = 0;
m_internalFormat = 0;
- m_eglSurface = EGL_NO_SURFACE;
}
bool TextureInfo::equalsAttributes(const TextureInfo* otherTexture)
diff --git a/Source/WebCore/platform/graphics/android/TextureInfo.h b/Source/WebCore/platform/graphics/android/TextureInfo.h
index 764c229..4684df2 100644
--- a/Source/WebCore/platform/graphics/android/TextureInfo.h
+++ b/Source/WebCore/platform/graphics/android/TextureInfo.h
@@ -59,11 +59,6 @@ public:
int32_t m_width;
int32_t m_height;
GLenum m_internalFormat;
-
- // TODO: Delete this after the Ganesh code path get fixed.
- sp<ANativeWindow> m_ANW;
- // The EGLSurface wraps the m_ANW to enable direct OpenGL rendering (e.g. Ganesh)
- EGLSurface m_eglSurface;
};
} // namespace WebCore
diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h
index ff55c00..6f9bb13 100644
--- a/Source/WebKit/android/jni/WebViewCore.h
+++ b/Source/WebKit/android/jni/WebViewCore.h
@@ -49,6 +49,7 @@
#include <jni.h>
#include <androidfw/KeycodeLabels.h>
#include <ui/PixelFormat.h>
+#include <utils/threads.h>
namespace WebCore {
class Color;