diff options
Diffstat (limited to 'Source')
6 files changed, 37 insertions, 20 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index 0ab28d7..6c572c4 100644 --- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -287,7 +287,6 @@ bool BaseLayerAndroid::drawGL(double currentTime, LayerAndroid* compositedRoot, m_glWebViewState->resetLayersDirtyArea(); } - m_glWebViewState->paintExtras(); m_previousVisible = visibleRect; diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index 40a9428..55419f4 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -180,8 +180,12 @@ void GLWebViewState::setRings(Vector<IntRect>& rings, bool isPressed) android::Mutex::Autolock lock(m_baseLayerLock); m_displayRings = true; m_rings.setEmpty(); - for (size_t i = 0; i < rings.size(); i++) - m_rings.op(rings.at(i), SkRegion::kUnion_Op); + for (size_t i = 0; i < rings.size(); i++) { + if (i == 0) + m_rings.setRect(rings.at(i)); + else + m_rings.op(rings.at(i), SkRegion::kUnion_Op); + } m_ringsIsPressed = isPressed; } @@ -571,6 +575,10 @@ bool GLWebViewState::drawGL(IntRect& rect, SkRect& viewport, IntRect* invalRect, double currentTime = setupDrawing(rect, viewport, webViewRect, titleBarHeight, clip, scale); bool ret = baseLayer->drawGL(currentTime, compositedRoot, rect, viewport, scale, buffersSwappedPtr); + // Reset the clip to make sure we can draw the rings. If this isn't done, the + // current clip will be the clip of whatever layer was last drawn + TilesManager::instance()->shader()->clip(clip); + paintExtras(); glBindBuffer(GL_ARRAY_BUFFER, 0); diff --git a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp index bf5f760..857623a 100644 --- a/Source/WebCore/platform/graphics/android/ShaderProgram.cpp +++ b/Source/WebCore/platform/graphics/android/ShaderProgram.cpp @@ -294,6 +294,7 @@ void ShaderProgram::drawQuadInternal(SkRect& geometry, GLenum textureTarget, GLint position, GLint alpha, + GLint texFilter, GLint contrast) { glUseProgram(program); @@ -313,8 +314,8 @@ void ShaderProgram::drawQuadInternal(SkRect& geometry, glActiveTexture(GL_TEXTURE0); glUniform1i(texSampler, 0); glBindTexture(textureTarget, textureId); - glTexParameteri(textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(textureTarget, GL_TEXTURE_MIN_FILTER, texFilter); + glTexParameteri(textureTarget, GL_TEXTURE_MAG_FILTER, texFilter); glTexParameteri(textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); @@ -330,26 +331,26 @@ void ShaderProgram::drawQuadInternal(SkRect& geometry, } void ShaderProgram::drawQuad(SkRect& geometry, int textureId, float opacity, - GLenum textureTarget) + GLenum textureTarget, GLint texFilter) { if (textureTarget == GL_TEXTURE_2D) { drawQuadInternal(geometry, textureId, opacity, m_program, m_hProjectionMatrix, m_hTexSampler, GL_TEXTURE_2D, - m_hPosition, alpha()); + m_hPosition, alpha(), texFilter); } else if (textureTarget == GL_TEXTURE_EXTERNAL_OES && !TilesManager::instance()->invertedScreen()) { drawQuadInternal(geometry, textureId, opacity, m_surfTexOESProgram, m_hSTOESProjectionMatrix, m_hSTOESTexSampler, GL_TEXTURE_EXTERNAL_OES, - m_hSTOESPosition, m_hSTOESAlpha); + m_hSTOESPosition, m_hSTOESAlpha, texFilter); } else if (textureTarget == GL_TEXTURE_EXTERNAL_OES && TilesManager::instance()->invertedScreen()) { drawQuadInternal(geometry, textureId, opacity, m_surfTexOESProgramInverted, m_hSTOESProjectionMatrixInverted, m_hSTOESTexSamplerInverted, GL_TEXTURE_EXTERNAL_OES, m_hSTOESPositionInverted, m_hSTOESAlphaInverted, - m_hSTOESContrastInverted); + texFilter, m_hSTOESContrastInverted); } GLUtils::checkGlError("drawQuad"); } diff --git a/Source/WebCore/platform/graphics/android/ShaderProgram.h b/Source/WebCore/platform/graphics/android/ShaderProgram.h index d8447bf..5f5ce9f 100644 --- a/Source/WebCore/platform/graphics/android/ShaderProgram.h +++ b/Source/WebCore/platform/graphics/android/ShaderProgram.h @@ -54,7 +54,8 @@ public: // support Surface texture in GL_TEXTURE_EXTERNAL_OES target on all // platforms. void drawQuad(SkRect& geometry, int textureId, float opacity, - GLenum textureTarget = GL_TEXTURE_2D); + GLenum textureTarget = GL_TEXTURE_2D, + GLint texFilter = GL_LINEAR); void drawLayerQuad(const TransformationMatrix& drawMatrix, SkRect& geometry, int textureId, float opacity, bool forceBlending = false, @@ -99,7 +100,8 @@ private: void drawQuadInternal(SkRect& geometry, GLint textureId, float opacity, GLint program, GLint projectionMatrixHandle, GLint texSampler, GLenum textureTarget, - GLint position, GLint alpha, GLint contrast = -1); + GLint position, GLint alpha, + GLint texFilter, GLint contrast = -1); void drawLayerQuadInternal(const GLfloat* projectionMatrix, int textureId, float opacity, GLenum textureTarget, GLint program, diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/TransferQueue.cpp index 02427e4..a8451a6 100644 --- a/Source/WebCore/platform/graphics/android/TransferQueue.cpp +++ b/Source/WebCore/platform/graphics/android/TransferQueue.cpp @@ -135,9 +135,6 @@ void TransferQueue::blitTileFromQueue(GLuint fboID, BaseTileTexture* destTex, GLuint srcTexId, GLenum srcTexTarget, int index) { - // guarantee that we have a texture to blit into - destTex->requireTexture(); - // Then set up the FBO and copy the SurfTex content in. glBindFramebuffer(GL_FRAMEBUFFER, fboID); glFramebufferTexture2D(GL_FRAMEBUFFER, @@ -157,7 +154,7 @@ void TransferQueue::blitTileFromQueue(GLuint fboID, BaseTileTexture* destTex, // Use empty rect to set up the special matrix to draw. SkRect rect = SkRect::MakeEmpty(); TilesManager::instance()->shader()->drawQuad(rect, srcTexId, 1.0, - srcTexTarget); + srcTexTarget, GL_NEAREST); // To workaround a sync issue on some platforms, we should insert the sync // here while in the current FBO. @@ -260,7 +257,9 @@ void TransferQueue::discardQueue() // Call on UI thread to copy from the shared Surface Texture to the BaseTile's texture. void TransferQueue::updateDirtyBaseTiles() { +#if !DEBUG_TRANSFER_USING_CPU_UPLOAD saveGLState(); +#endif android::Mutex::Autolock lock(m_transferQueueItemLocks); cleanupTransportQueue(); @@ -279,9 +278,9 @@ void TransferQueue::updateDirtyBaseTiles() BaseTileTexture* destTexture = 0; if (!obsoleteBaseTile) destTexture = m_transferQueue[index].savedBaseTilePtr->backTexture(); - +#if !DEBUG_TRANSFER_USING_CPU_UPLOAD m_sharedSurfaceTexture->updateTexImage(); - +#endif m_transferQueue[index].savedBaseTilePtr = 0; m_transferQueue[index].status = emptyItem; if (obsoleteBaseTile) { @@ -290,6 +289,9 @@ void TransferQueue::updateDirtyBaseTiles() continue; } + // guarantee that we have a texture to blit into + destTexture->requireTexture(); + #if DEBUG_TRANSFER_USING_CPU_UPLOAD // Here we just need to upload the bitmap content to the GL Texture GLUtils::updateTextureWithBitmap(destTexture->m_ownTextureId, 0, 0, @@ -317,7 +319,9 @@ void TransferQueue::updateDirtyBaseTiles() index = (index + 1) % ST_BUFFER_NUMBER; } +#if !DEBUG_TRANSFER_USING_CPU_UPLOAD restoreGLState(); +#endif m_emptyItemCount = ST_BUFFER_NUMBER; m_transferQueueItemCond.signal(); @@ -334,7 +338,7 @@ void TransferQueue::updateQueueWithBitmap(const TileRenderInfo* renderInfo, renderInfo->x, renderInfo->y); return; } - +#if !DEBUG_TRANSFER_USING_CPU_UPLOAD // a) Dequeue the Surface Texture and write into the buffer if (!m_ANW.get()) { XLOG("ERROR: ANW is null"); @@ -370,6 +374,7 @@ void TransferQueue::updateQueueWithBitmap(const TileRenderInfo* renderInfo, } ANativeWindow_unlockAndPost(m_ANW.get()); +#endif m_transferQueueItemLocks.lock(); // b) After update the Surface Texture, now udpate the transfer queue info. addItemInTransferQueue(renderInfo); @@ -417,8 +422,9 @@ void TransferQueue::cleanupTransportQueue() for (int i = 0 ; i < ST_BUFFER_NUMBER; i++) { if (m_transferQueue[index].status == pendingDiscard) { +#if !DEBUG_TRANSFER_USING_CPU_UPLOAD m_sharedSurfaceTexture->updateTexImage(); - +#endif m_transferQueue[index].savedBaseTilePtr = 0; m_transferQueue[index].status = emptyItem; } diff --git a/Source/WebKit/android/WebCoreSupport/ChromiumInit.cpp b/Source/WebKit/android/WebCoreSupport/ChromiumInit.cpp index 500975c..f5029d5 100644 --- a/Source/WebKit/android/WebCoreSupport/ChromiumInit.cpp +++ b/Source/WebKit/android/WebCoreSupport/ChromiumInit.cpp @@ -68,7 +68,8 @@ void initChromium() if (!initCalled) { logging::SetLogMessageHandler(logMessageHandler); networkChangeNotifier.reset(net::NetworkChangeNotifier::Create()); - net::HttpNetworkLayer::EnableSpdy("npn"); + // Disable SPDY for bug 5226268 [Browser] http keep-alive packets are sent too frequently to network + // net::HttpNetworkLayer::EnableSpdy("npn"); initCalled = true; jni::SetJavaVM(JSC::Bindings::getJavaVM()); } |