summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/CacheBuilder.cpp
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-05-14 15:31:44 -0400
committerCary Clark <cary@android.com>2010-05-14 15:52:58 -0400
commit0d4eb282a9331db55cb204c779cd172dba8ccf50 (patch)
tree4d481c9cb202616734ac57387fc5c54ff1682858 /WebKit/android/nav/CacheBuilder.cpp
parent32c3075b9493cae498f938edbb48250b26c4c64c (diff)
downloadexternal_webkit-0d4eb282a9331db55cb204c779cd172dba8ccf50.zip
external_webkit-0d4eb282a9331db55cb204c779cd172dba8ccf50.tar.gz
external_webkit-0d4eb282a9331db55cb204c779cd172dba8ccf50.tar.bz2
suppress partial screen updates if a canvas element is visible
A PictureSet contains a list of pictures. Each picture draws part of the screen. If the picture contains a Canvas element, the corresponding bitmap is not shared. Small partial invalidates can create a dozen or so pictures, each of which may be quite small, a few hundred bytes. But the bitmap referenced by the picture may be large, several meg. The backing bitmap is unique to the Canvas element. Since a canvas rarely benefits from small updates, disable the partial invalidates if CacheBuilder detects a canvas. Change-Id: I5761667db3d037d7363dcb01f8a26f7f62e2eabc http://b/2678787
Diffstat (limited to 'WebKit/android/nav/CacheBuilder.cpp')
-rw-r--r--WebKit/android/nav/CacheBuilder.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp
index 09e5e59..c343fa0 100644
--- a/WebKit/android/nav/CacheBuilder.cpp
+++ b/WebKit/android/nav/CacheBuilder.cpp
@@ -867,6 +867,7 @@ bool CacheBuilder::AnyIsClick(Node* node)
void CacheBuilder::buildCache(CachedRoot* root)
{
Frame* frame = FrameAnd(this);
+ mPictureSetDisabled = false;
BuildFrame(frame, frame, root, (CachedFrame*) root);
root->finishInit(); // set up frame parent pointers, child pointers
setData((CachedFrame*) root);
@@ -1131,6 +1132,8 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
if (node->hasTagName(HTMLNames::bodyTag))
bodyPos = originalAbsBounds.location();
+ else if (node->hasTagName(HTMLNames::canvasTag))
+ mPictureSetDisabled = true;
if (checkForPluginViewThatWantsFocus(nodeRenderer)) {
bounds = absBounds;
isUnclipped = true;