diff options
author | Cary Clark <cary@android.com> | 2010-11-19 14:23:02 -0500 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2010-11-23 15:58:09 -0500 |
commit | eabb311cd2b57ff80b4cf632078cf078d789b563 (patch) | |
tree | b16e6af4e3b973aa223e113e6d063dd6c0dea08c /WebCore/platform/graphics/android/GLWebViewState.cpp | |
parent | 9a193fae103e41510ec598934ec912e0575c8e19 (diff) | |
download | external_webkit-eabb311cd2b57ff80b4cf632078cf078d789b563.zip external_webkit-eabb311cd2b57ff80b4cf632078cf078d789b563.tar.gz external_webkit-eabb311cd2b57ff80b4cf632078cf078d789b563.tar.bz2 |
reenable draw extras when GL is turned on
This captures the drawing in the UI thread, then passes
the drawing to the tile imaging thread.
The draw extras interface now takes an additional rectangle,
and each draw extra fills in the inval area formed as that
part is drawn.
The old extra implementation in GLWebViewState has been
removed. The inval portion of the setBaseLayer call has been split
out so it can be called directly.
bug:3161294
Change-Id: I28d3e6879059770b973e7c0f7c0796909f7359aa
Diffstat (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/GLWebViewState.cpp | 48 |
1 files changed, 18 insertions, 30 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp index d0d054f..145bd89 100644 --- a/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -72,8 +72,6 @@ GLWebViewState::GLWebViewState() , m_baseLayer(0) , m_currentPictureCounter(0) , m_usePageA(true) - , m_extra(0) - , m_navLayer(0) { m_viewport.setEmpty(); m_viewportTileBounds.setEmpty(); @@ -90,58 +88,48 @@ GLWebViewState::~GLWebViewState() { delete m_tiledPageA; delete m_tiledPageB; - delete m_navLayer; #ifdef DEBUG_COUNT gGLWebViewStateCount--; #endif } -void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, IntRect& rect) +void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const IntRect& rect) { android::Mutex::Autolock lock(m_baseLayerLock); m_baseLayer = layer; - m_extra = 0; - delete m_navLayer; - m_navLayer = 0; if (m_baseLayer) { m_baseLayer->setGLWebViewState(this); - m_currentPictureCounter++; - - if (!rect.isEmpty()) { - // find which tiles fall within the invalRect and mark them as dirty - m_tiledPageA->invalidateRect(rect, m_currentPictureCounter); - m_tiledPageB->invalidateRect(rect, m_currentPictureCounter); - } + inval(rect); } } -void GLWebViewState::setExtra(android::DrawExtra* extra, LayerAndroid* navLayer) +void GLWebViewState::setExtra(BaseLayerAndroid* layer, SkPicture& picture, + const IntRect& rect) { android::Mutex::Autolock lock(m_baseLayerLock); - m_extra = extra; - delete m_navLayer; - m_navLayer = navLayer; - m_currentPictureCounter++; + layer->setExtra(picture); + if (!rect.isEmpty()) + inval(rect); + else if (!m_lastInval.isEmpty()) + inval(m_lastInval); + m_lastInval = rect; } -void GLWebViewState::resetExtra(bool repaint) +void GLWebViewState::inval(const IntRect& rect) { - android::Mutex::Autolock lock(m_baseLayerLock); - if (m_extra && repaint) - m_currentPictureCounter++; - m_extra = 0; - delete m_navLayer; - m_navLayer = 0; + m_currentPictureCounter++; + if (!rect.isEmpty()) { + // find which tiles fall within the invalRect and mark them as dirty + m_tiledPageA->invalidateRect(rect, m_currentPictureCounter); + m_tiledPageB->invalidateRect(rect, m_currentPictureCounter); + } } unsigned int GLWebViewState::paintBaseLayerContent(SkCanvas* canvas) { android::Mutex::Autolock lock(m_baseLayerLock); - if (m_baseLayer) { + if (m_baseLayer) m_baseLayer->drawCanvas(canvas); - if (m_extra && m_navLayer) - m_extra->draw(canvas, m_navLayer); - } return m_currentPictureCounter; } |