diff options
-rw-r--r-- | WebCore/platform/graphics/android/BaseLayerAndroid.cpp | 6 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/GLWebViewState.cpp | 5 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/GLWebViewState.h | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp index 8d84827..f5ec9cd 100644 --- a/WebCore/platform/graphics/android/BaseLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/BaseLayerAndroid.cpp @@ -210,6 +210,12 @@ bool BaseLayerAndroid::drawGL(IntRect& viewRect, SkRect& visibleRect, glEnable(GL_SCISSOR_TEST); glScissor(left, top, width, height); + if (!m_glWebViewState || !m_glWebViewState->hasContent()) { + glClearColor(1, 1, 1, 1); + glClear(GL_COLOR_BUFFER_BIT); + glBindBuffer(GL_ARRAY_BUFFER, 0); + return true; + } glClearColor((float)m_color.red() / 255.0, (float)m_color.green() / 255.0, (float)m_color.blue() / 255.0, 1); diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp index 4080a8a..58c7ab5 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -239,6 +239,11 @@ void GLWebViewState::setViewport(SkRect& viewport, float scale) static_cast<int>(ceilf(viewport.fBottom * invTileContentHeight))); } +bool GLWebViewState::hasContent() { + android::Mutex::Autolock lock(m_baseLayerLock); + return m_baseLayer; +} + } // namespace WebCore #endif // USE(ACCELERATED_COMPOSITING) diff --git a/WebCore/platform/graphics/android/GLWebViewState.h b/WebCore/platform/graphics/android/GLWebViewState.h index 526061e..cc1834d 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.h +++ b/WebCore/platform/graphics/android/GLWebViewState.h @@ -191,6 +191,8 @@ public: unsigned int currentPictureCounter() const { return m_currentPictureCounter; } + bool hasContent(); + private: // Delay between scheduling a new page when the scale |