summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2012-03-12 15:40:56 -0400
committerDerek Sollenberger <djsollen@google.com>2012-03-12 15:40:56 -0400
commit146f4231e665a454284a465ff66379b9277f1fc0 (patch)
tree229239bf8a3a2587eb42dc8c6eb0f89bb655bfc0 /Source/WebCore
parent668a73488d6938004d25b6c155573e97b6600182 (diff)
parentf6d491730d3fe389bd2f027abe9f5676dd4376aa (diff)
downloadexternal_webkit-146f4231e665a454284a465ff66379b9277f1fc0.zip
external_webkit-146f4231e665a454284a465ff66379b9277f1fc0.tar.gz
external_webkit-146f4231e665a454284a465ff66379b9277f1fc0.tar.bz2
resolved conflicts for merge of f6d49173 to master
Change-Id: I5c3e6fe524ae5742420c5a6e092d92840e2754f0
Diffstat (limited to 'Source/WebCore')
-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
6 files changed, 18 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