summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-03-23 12:55:41 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-23 12:55:41 -0700
commita83257eb9d324048471edcf2974b54c20894a940 (patch)
treedb7db6ce78964bc9b70f7fe8f50ed8e2230291e7 /Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp
parent666bc03d3d901a137fa40473104c9258ff77801d (diff)
parent885e650b12d781be054b31ae6221925a0184dc33 (diff)
downloadexternal_webkit-a83257eb9d324048471edcf2974b54c20894a940.zip
external_webkit-a83257eb9d324048471edcf2974b54c20894a940.tar.gz
external_webkit-a83257eb9d324048471edcf2974b54c20894a940.tar.bz2
Merge "reimplement BaseLayerAndroid as a LayerAndroid subclass"
Diffstat (limited to 'Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp50
1 files changed, 9 insertions, 41 deletions
diff --git a/Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp
index 633651d..8f2b7bd 100644
--- a/Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp
+++ b/Source/WebCore/platform/graphics/android/SurfaceCollectionManager.cpp
@@ -30,7 +30,6 @@
#include "SurfaceCollectionManager.h"
#include "AndroidLog.h"
-#include "BaseLayerAndroid.h"
#include "LayerGroup.h"
#include "TilesManager.h"
#include "SurfaceCollection.h"
@@ -179,7 +178,7 @@ bool SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
m_paintingCollection->evaluateAnimations(currentTime);
- m_paintingCollection->prepareGL(visibleRect, scale, currentTime);
+ m_paintingCollection->prepareGL(visibleRect);
m_paintingCollection->computeTexturesAmount(texturesResultPtr);
if (!TilesManager::instance()->useDoubleBuffering() || m_paintingCollection->isReady()) {
@@ -194,7 +193,7 @@ bool SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
}
} else if (m_drawingCollection) {
ALOGV("preparing drawing collection %p", m_drawingCollection);
- m_drawingCollection->prepareGL(visibleRect, scale, currentTime);
+ m_drawingCollection->prepareGL(visibleRect);
m_drawingCollection->computeTexturesAmount(texturesResultPtr);
}
@@ -217,12 +216,17 @@ bool SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
}
m_drawingCollection->evaluateAnimations(currentTime);
+
ALOGV("drawing collection %p", m_drawingCollection);
- ret |= m_drawingCollection->drawGL(visibleRect, scale);
+ m_drawingCollection->drawBackground();
+ ret |= m_drawingCollection->drawGL(visibleRect);
+ } else if (m_paintingCollection) {
+ // Draw background color while tiles are being painted.
+ m_paintingCollection->drawBackground();
} else {
// Dont have a drawing collection, draw white background
Color defaultBackground = Color::white;
- m_state->drawBackground(defaultBackground);
+ GLUtils::drawBackground(defaultBackground);
}
if (m_paintingCollection) {
@@ -233,40 +237,4 @@ bool SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
return ret;
}
-// draw for base tile - called on TextureGeneration thread
-void SurfaceCollectionManager::drawCanvas(SkCanvas* canvas, bool drawLayers)
-{
- SurfaceCollection* paintingCollection = 0;
- m_paintSwapLock.lock();
- paintingCollection = m_paintingCollection ? m_paintingCollection : m_drawingCollection;
- SkSafeRef(paintingCollection);
- m_paintSwapLock.unlock();
-
- if (!paintingCollection)
- return;
-
- paintingCollection->drawCanvas(canvas, drawLayers);
-
- SkSafeUnref(paintingCollection);
-}
-
-// TODO: refactor this functionality elsewhere
-int SurfaceCollectionManager::baseContentWidth()
-{
- if (m_paintingCollection)
- return m_paintingCollection->baseContentWidth();
- else if (m_drawingCollection)
- return m_drawingCollection->baseContentWidth();
- return 0;
-}
-
-int SurfaceCollectionManager::baseContentHeight()
-{
- if (m_paintingCollection)
- return m_paintingCollection->baseContentHeight();
- else if (m_drawingCollection)
- return m_drawingCollection->baseContentHeight();
- return 0;
-}
-
} // namespace WebCore