diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-03-24 09:52:26 -0700 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2011-04-12 17:38:55 -0700 |
commit | 8755df31f6fd87d890d58d86eb8a4ec0088285cb (patch) | |
tree | 195aa1343ae4602da4aad3a9825909d22b7bcc0a /WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | |
parent | a3bad5bfd2087f48ef5a7320bde1585b9ec83a49 (diff) | |
download | external_webkit-8755df31f6fd87d890d58d86eb8a4ec0088285cb.zip external_webkit-8755df31f6fd87d890d58d86eb8a4ec0088285cb.tar.gz external_webkit-8755df31f6fd87d890d58d86eb8a4ec0088285cb.tar.bz2 |
Fix for maps
- Fix a repaint scheduling bug preventing layers containing only
and image to update
- Use an SkBitmap instead of SkBitmapRef and do a deep copy
instead to prevent synchronization issues with the webkit thread.
bug:4173057
Change-Id: I221fd0062e03ab4633b83d558956db48a408a194
Diffstat (limited to 'WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 96cfd3d..59f8408 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -120,6 +120,8 @@ GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) : m_needsNotifyClient(false), m_haveContents(false), m_haveImage(false), + m_newImage(false), + m_imageRef(0), m_foregroundLayer(0), m_foregroundClipLayer(0) { @@ -623,6 +625,14 @@ bool GraphicsLayerAndroid::repaint() return true; } + if (m_needsRepaint && m_haveImage && m_newImage) { + // We need to tell the GL thread that we will need to repaint the + // texture. Only do so if we effectively have a new image! + m_contentLayer->needsRepaint(); + m_newImage = false; + m_needsRepaint = false; + return true; + } return false; } @@ -834,9 +844,15 @@ void GraphicsLayerAndroid::setContentsToImage(Image* image) if (image) { m_haveContents = true; m_haveImage = true; - m_contentLayer->setContentsImage(image->nativeImageForCurrentFrame()); - setNeedsDisplay(); - askForSync(); + // Only pass the new image if it's a different one + if (image->nativeImageForCurrentFrame() != m_imageRef) { + m_newImage = true; + m_contentLayer->setContentsImage(image->nativeImageForCurrentFrame()); + // remember the passed image. + m_imageRef = image->nativeImageForCurrentFrame(); + setNeedsDisplay(); + askForSync(); + } } } |