summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-10-25 19:13:24 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-25 19:13:24 -0700
commitf6024a989d5eabfede72f4d156ffc128ed35f5a5 (patch)
treea68082e5d7c5262bef3ace6f6fc656c1bdb99eae /Source
parentc43f9396708d95ecbce1f4ef65530999fab96c0d (diff)
parent42051e3a21322f4843268b4bc09c85b7e9250d6d (diff)
downloadexternal_webkit-f6024a989d5eabfede72f4d156ffc128ed35f5a5.zip
external_webkit-f6024a989d5eabfede72f4d156ffc128ed35f5a5.tar.gz
external_webkit-f6024a989d5eabfede72f4d156ffc128ed35f5a5.tar.bz2
Merge "DO NOT MERGE Fix SW extras for layers" into ics-mr1
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp11
-rw-r--r--Source/WebCore/platform/graphics/android/BaseLayerAndroid.h3
-rw-r--r--Source/WebCore/platform/graphics/android/BaseRenderer.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/LayerAndroid.cpp38
-rw-r--r--Source/WebCore/platform/graphics/android/LayerAndroid.h3
-rw-r--r--Source/WebCore/platform/graphics/android/PaintedSurface.cpp13
-rw-r--r--Source/WebCore/platform/graphics/android/PaintedSurface.h1
-rw-r--r--Source/WebCore/platform/graphics/android/TilePainter.h1
-rw-r--r--Source/WebCore/platform/graphics/android/TiledPage.cpp4
-rw-r--r--Source/WebCore/platform/graphics/android/TiledPage.h1
-rw-r--r--Source/WebCore/platform/graphics/android/TiledTexture.cpp5
-rw-r--r--Source/WebCore/platform/graphics/android/TiledTexture.h1
-rw-r--r--Source/WebKit/android/nav/WebView.cpp39
14 files changed, 17 insertions, 107 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
index 2902b5c..2a1b1de 100644
--- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.cpp
@@ -101,14 +101,6 @@ void BaseLayerAndroid::setContent(const PictureSet& src)
// setSize(src.width(), src.height());
}
-void BaseLayerAndroid::setExtra(SkPicture& src)
-{
-#if USE(ACCELERATED_COMPOSITING)
- android::Mutex::Autolock lock(m_drawLock);
-#endif
- m_extra.swap(src);
-}
-
void BaseLayerAndroid::drawCanvas(SkCanvas* canvas)
{
#if USE(ACCELERATED_COMPOSITING)
@@ -116,9 +108,6 @@ void BaseLayerAndroid::drawCanvas(SkCanvas* canvas)
#endif
if (!m_content.isEmpty())
m_content.draw(canvas);
- // TODO : replace with !m_extra.isEmpty() once such a call exists
- if (m_extra.width() > 0)
- m_extra.draw(canvas);
}
#if USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h
index 40afac8..ad77013 100644
--- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h
@@ -53,7 +53,6 @@ public:
Color getBackgroundColor() { return m_color; }
#endif
void setContent(const android::PictureSet& src);
- void setExtra(SkPicture& extra);
android::PictureSet* content() { return &m_content; }
// This method will paint using the current PictureSet onto
// the passed canvas. We used it to paint the GL tiles as well as
@@ -63,7 +62,6 @@ public:
bool drawGL(double currentTime, LayerAndroid* compositedRoot, IntRect& rect,
SkRect& viewport, float scale, bool* buffersSwappedPtr);
- void swapExtra(BaseLayerAndroid* base) { m_extra.swap(base->m_extra); }
private:
#if USE(ACCELERATED_COMPOSITING)
void prefetchBasePicture(SkRect& viewport, float currentScale,
@@ -76,7 +74,6 @@ private:
Color m_color;
#endif
android::PictureSet m_content;
- SkPicture m_extra;
SkRect m_previousVisible;
ScrollState m_scrollState;
diff --git a/Source/WebCore/platform/graphics/android/BaseRenderer.cpp b/Source/WebCore/platform/graphics/android/BaseRenderer.cpp
index 96599af..57baee8 100644
--- a/Source/WebCore/platform/graphics/android/BaseRenderer.cpp
+++ b/Source/WebCore/platform/graphics/android/BaseRenderer.cpp
@@ -133,8 +133,6 @@ int BaseRenderer::renderTiledContent(const TileRenderInfo& renderInfo)
canvas.scale(renderInfo.scale, renderInfo.scale);
unsigned int pictureCount = 0;
renderInfo.tilePainter->paint(renderInfo.baseTile, &canvas, &pictureCount);
- if (renderInfo.baseTile->isLayerTile())
- renderInfo.tilePainter->paintExtra(&canvas);
if (visualIndicator) {
canvas.restore();
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index aa1c05b..e53a1e1 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -147,8 +147,6 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const SkRegion& inval
m_baseLayerUpdate = true;
m_invalidateRegion.setEmpty();
}
- if (m_currentBaseLayer && layer)
- m_currentBaseLayer->swapExtra(layer);
SkSafeRef(layer);
SkSafeUnref(m_currentBaseLayer);
diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
index d4a1225..e0898e6 100644
--- a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp
@@ -66,7 +66,6 @@ LayerAndroid::LayerAndroid(RenderLayer* owner) : Layer(),
m_preserves3D(false),
m_anchorPointZ(0),
m_recordingPicture(0),
- m_extra(0),
m_uniqueId(++gUniqueId),
m_texture(0),
m_imageRef(0),
@@ -93,7 +92,6 @@ LayerAndroid::LayerAndroid(RenderLayer* owner) : Layer(),
LayerAndroid::LayerAndroid(const LayerAndroid& layer) : Layer(layer),
m_haveClip(layer.m_haveClip),
m_isIframe(layer.m_isIframe),
- m_extra(0), // deliberately not copied
m_uniqueId(layer.m_uniqueId),
m_texture(0),
m_imageTexture(0),
@@ -154,7 +152,6 @@ LayerAndroid::LayerAndroid(SkPicture* picture) : Layer(),
m_isFixed(false),
m_isIframe(false),
m_recordingPicture(picture),
- m_extra(0),
m_uniqueId(-1),
m_texture(0),
m_imageRef(0),
@@ -180,7 +177,6 @@ LayerAndroid::~LayerAndroid()
{
if (m_imageTexture)
ImagesManager::instance()->removeImage(m_imageTexture->imageRef());
- delete m_extra;
SkSafeUnref(m_recordingPicture);
m_animations.clear();
#ifdef DEBUG_COUNT
@@ -929,14 +925,6 @@ bool LayerAndroid::drawChildrenGL(GLWebViewState* glWebViewState, SkMatrix& matr
return askScreenUpdate;
}
-void LayerAndroid::extraDraw(SkCanvas* canvas)
-{
- m_atomicSync.lock();
- if (m_extra)
- canvas->drawPicture(*m_extra);
- m_atomicSync.unlock();
-}
-
void LayerAndroid::contentDraw(SkCanvas* canvas)
{
if (m_recordingPicture)
@@ -1230,32 +1218,6 @@ LayerAndroid* LayerAndroid::findById(int match)
return 0;
}
-void LayerAndroid::setExtra(DrawExtra* extra)
-{
- for (int i = 0; i < countChildren(); i++)
- getChild(i)->setExtra(extra);
-
- android::AutoMutex lock(m_atomicSync);
- if (extra || (m_extra && !extra))
- m_dirty = true;
-
- delete m_extra;
- m_extra = 0;
-
- if (!extra)
- return;
-
- if (m_recordingPicture) {
- IntRect dummy; // inval area, unused for now
- m_extra = new SkPicture();
- SkCanvas* canvas = m_extra->beginRecording(m_recordingPicture->width(),
- m_recordingPicture->height());
- extra->draw(canvas, this, &dummy);
- m_extra->endRecording();
- needsRepaint();
- }
-}
-
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.h b/Source/WebCore/platform/graphics/android/LayerAndroid.h
index 4458a2c..15a581e 100644
--- a/Source/WebCore/platform/graphics/android/LayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/LayerAndroid.h
@@ -233,7 +233,6 @@ public:
{
return static_cast<LayerAndroid*>(this->INHERITED::getChild(index));
}
- void setExtra(DrawExtra* extra); // does not assign ownership
int uniqueId() const { return m_uniqueId; }
bool isFixed() { return m_isFixed; }
@@ -257,7 +256,6 @@ public:
const SkRegion& dirtyRegion() { return m_dirtyRegion; }
void contentDraw(SkCanvas*);
- void extraDraw(SkCanvas*);
virtual bool isMedia() const { return false; }
virtual bool isVideo() const { return false; }
@@ -357,7 +355,6 @@ private:
FloatRect m_clippingRect;
- SkPicture* m_extra;
int m_uniqueId;
PaintedSurface* m_texture;
diff --git a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
index 8f78638..c0597a9 100644
--- a/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
+++ b/Source/WebCore/platform/graphics/android/PaintedSurface.cpp
@@ -179,19 +179,6 @@ void PaintedSurface::markAsDirty(const SkRegion& dirtyArea)
m_updateManager.updateInval(dirtyArea);
}
-void PaintedSurface::paintExtra(SkCanvas* canvas)
-{
- m_layerLock.lock();
- LayerAndroid* layer = m_layer;
- SkSafeRef(layer);
- m_layerLock.unlock();
-
- if (layer)
- layer->extraDraw(canvas);
-
- SkSafeUnref(layer);
-}
-
float PaintedSurface::opacity() {
if (m_layer)
return m_layer->drawOpacity();
diff --git a/Source/WebCore/platform/graphics/android/PaintedSurface.h b/Source/WebCore/platform/graphics/android/PaintedSurface.h
index 761be74..2e01b80 100644
--- a/Source/WebCore/platform/graphics/android/PaintedSurface.h
+++ b/Source/WebCore/platform/graphics/android/PaintedSurface.h
@@ -66,7 +66,6 @@ public:
void computeVisibleArea();
// TilePainter methods for TiledTexture
- virtual void paintExtra(SkCanvas*);
virtual const TransformationMatrix* transform();
// used by TiledTexture
diff --git a/Source/WebCore/platform/graphics/android/TilePainter.h b/Source/WebCore/platform/graphics/android/TilePainter.h
index 191edf3..91030cb 100644
--- a/Source/WebCore/platform/graphics/android/TilePainter.h
+++ b/Source/WebCore/platform/graphics/android/TilePainter.h
@@ -38,7 +38,6 @@ class TilePainter {
public:
virtual ~TilePainter() { }
virtual bool paint(BaseTile* tile, SkCanvas*, unsigned int*) = 0;
- virtual void paintExtra(SkCanvas*) = 0;
virtual const TransformationMatrix* transform() { return 0; }
};
diff --git a/Source/WebCore/platform/graphics/android/TiledPage.cpp b/Source/WebCore/platform/graphics/android/TiledPage.cpp
index b28133f..c097c58 100644
--- a/Source/WebCore/platform/graphics/android/TiledPage.cpp
+++ b/Source/WebCore/platform/graphics/android/TiledPage.cpp
@@ -387,10 +387,6 @@ bool TiledPage::paint(BaseTile* tile, SkCanvas* canvas, unsigned int* pictureUse
return true;
}
-void TiledPage::paintExtra(SkCanvas* canvas)
-{
-}
-
TiledPage* TiledPage::sibling()
{
if (!m_glWebViewState)
diff --git a/Source/WebCore/platform/graphics/android/TiledPage.h b/Source/WebCore/platform/graphics/android/TiledPage.h
index 2d11a5a..960f3d5 100644
--- a/Source/WebCore/platform/graphics/android/TiledPage.h
+++ b/Source/WebCore/platform/graphics/android/TiledPage.h
@@ -84,7 +84,6 @@ public:
// TilePainter implementation
// used by individual tiles to generate the bitmap for their tile
bool paint(BaseTile*, SkCanvas*, unsigned int*);
- void paintExtra(SkCanvas*);
// used by individual tiles to get the information about the current picture
GLWebViewState* glWebViewState() { return m_glWebViewState; }
diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.cpp b/Source/WebCore/platform/graphics/android/TiledTexture.cpp
index 3182eef..b252303 100644
--- a/Source/WebCore/platform/graphics/android/TiledTexture.cpp
+++ b/Source/WebCore/platform/graphics/android/TiledTexture.cpp
@@ -257,11 +257,6 @@ bool TiledTexture::paint(BaseTile* tile, SkCanvas* canvas, unsigned int* picture
return m_updateManager.paint(tile, canvas, pictureUsed);
}
-void TiledTexture::paintExtra(SkCanvas* canvas)
-{
- m_surface->paintExtra(canvas);
-}
-
const TransformationMatrix* TiledTexture::transform()
{
return m_surface->transform();
diff --git a/Source/WebCore/platform/graphics/android/TiledTexture.h b/Source/WebCore/platform/graphics/android/TiledTexture.h
index 206961b..c6e9e09 100644
--- a/Source/WebCore/platform/graphics/android/TiledTexture.h
+++ b/Source/WebCore/platform/graphics/android/TiledTexture.h
@@ -80,7 +80,6 @@ public:
// TilePainter methods
bool paint(BaseTile* tile, SkCanvas*, unsigned int*);
- virtual void paintExtra(SkCanvas*);
virtual const TransformationMatrix* transform();
float scale() { return m_scale; }
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 493d4b3..4c75b58 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -572,10 +572,6 @@ bool drawGL(WebCore::IntRect& viewRect, WebCore::IntRect* invalRect, WebCore::In
unsigned int pic = m_glWebViewState->currentPictureCounter();
m_glWebViewState->glExtras()->setDrawExtra(extra);
- LayerAndroid* compositeLayer = compositeRoot();
- if (compositeLayer)
- compositeLayer->setExtra(0);
-
SkRect visibleRect;
calcOurContentVisibleRect(&visibleRect);
// Make sure we have valid coordinates. We might not have valid coords
@@ -650,28 +646,27 @@ PictureSet* draw(SkCanvas* canvas, SkColor bgColor, int extras, bool split)
default:
;
}
+#if USE(ACCELERATED_COMPOSITING)
+ LayerAndroid* compositeLayer = compositeRoot();
+ if (compositeLayer) {
+ SkRect visible;
+ calcOurContentVisibleRect(&visible);
+ // call this to be sure we've adjusted for any scrolling or animations
+ // before we actually draw
+ compositeLayer->updateFixedLayersPositions(visible);
+ compositeLayer->updatePositions();
+ // We have to set the canvas' matrix on the base layer
+ // (to have fixed layers work as intended)
+ SkAutoCanvasRestore restore(canvas, true);
+ m_baseLayer->setMatrix(canvas->getTotalMatrix());
+ canvas->resetMatrix();
+ m_baseLayer->draw(canvas);
+ }
+#endif
if (extra) {
IntRect dummy; // inval area, unused for now
extra->draw(canvas, &mainPicture, &dummy);
}
-#if USE(ACCELERATED_COMPOSITING)
- LayerAndroid* compositeLayer = compositeRoot();
- if (!compositeLayer)
- return ret;
- compositeLayer->setExtra(extra);
- SkRect visible;
- calcOurContentVisibleRect(&visible);
- // call this to be sure we've adjusted for any scrolling or animations
- // before we actually draw
- compositeLayer->updateFixedLayersPositions(visible);
- compositeLayer->updatePositions();
- // We have to set the canvas' matrix on the base layer
- // (to have fixed layers work as intended)
- SkAutoCanvasRestore restore(canvas, true);
- m_baseLayer->setMatrix(canvas->getTotalMatrix());
- canvas->resetMatrix();
- m_baseLayer->draw(canvas);
-#endif
return ret;
}