summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2011-03-02 15:44:58 -0500
committerDerek Sollenberger <djsollen@google.com>2011-03-02 15:50:45 -0500
commit06a6a5b3278850bdae8370474da78c119801b4e2 (patch)
treea96b502f7c1109409ef80562b0a79ea391c59859 /WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
parent46319ccd782989cc691ea412e44cb4283d183ccb (diff)
downloadexternal_webkit-06a6a5b3278850bdae8370474da78c119801b4e2.zip
external_webkit-06a6a5b3278850bdae8370474da78c119801b4e2.tar.gz
external_webkit-06a6a5b3278850bdae8370474da78c119801b4e2.tar.bz2
Ensure plugin content does not shift when gaining focus.
bug: 3477581 Change-Id: Ia7bbaaca405db33dbefaa8f6f00e9250580e5f7b
Diffstat (limited to 'WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r--WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 48badf8..7963ae0 100644
--- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -25,6 +25,7 @@
#include "GraphicsContext.h"
#include "Image.h"
#include "Length.h"
+#include "MediaLayer.h"
#include "PlatformBridge.h"
#include "PlatformGraphicsContext.h"
#include "RenderLayerBacking.h"
@@ -321,6 +322,19 @@ void GraphicsLayerAndroid::setSize(const FloatSize& size)
return;
MLOG("(%x) setSize (%.2f,%.2f)", this, size.width(), size.height());
GraphicsLayer::setSize(size);
+
+ // If it is a media layer the size may have changed as a result of the media
+ // element (e.g. plugin) gaining focus. Therefore, we must sync the size of
+ // the focus' outline so that our UI thread can draw accordingly.
+ if (m_contentLayer->isMedia() && m_client) {
+ RenderLayer* layer = renderLayerFromClient(m_client);
+ RenderBox* box = layer->renderBox();
+ int outline = box->view()->maximalOutlineSize();
+ static_cast<MediaLayer*>(m_contentLayer)->setOutlineSize(outline);
+ LOG("Media Outline: %d %p %p %p", outline, m_client, layer, box);
+ LOG("Media Size: %g,%g", size.width(), size.height());
+ }
+
m_contentLayer->setSize(size.width(), size.height());
askForSync();
}