summaryrefslogtreecommitdiffstats
path: root/Source/WebKit
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-09-28 15:11:12 -0700
committerChris Craik <ccraik@google.com>2012-10-01 11:03:13 -0700
commit42326004062d6b846c3050ad03a1e80fa9db425c (patch)
tree5be919630a5838cdef4adcc03975edda49fa1832 /Source/WebKit
parent224e946b3cabeaa9c360bdd6865485b5acb34cdc (diff)
downloadexternal_webkit-42326004062d6b846c3050ad03a1e80fa9db425c.zip
external_webkit-42326004062d6b846c3050ad03a1e80fa9db425c.tar.gz
external_webkit-42326004062d6b846c3050ad03a1e80fa9db425c.tar.bz2
Determine maxZoomScale from bitmap/text drawing
bug:7247750 Change-Id: I8238acc2c20942ab2f42936d16a03226909aebcd
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/android/jni/PicturePile.cpp12
-rw-r--r--Source/WebKit/android/jni/PicturePile.h6
2 files changed, 9 insertions, 9 deletions
diff --git a/Source/WebKit/android/jni/PicturePile.cpp b/Source/WebKit/android/jni/PicturePile.cpp
index f995e92..174980a 100644
--- a/Source/WebKit/android/jni/PicturePile.cpp
+++ b/Source/WebKit/android/jni/PicturePile.cpp
@@ -280,13 +280,13 @@ PrerenderedInval* PicturePile::prerenderedInvalForArea(const IntRect& area)
return 0;
}
-bool PicturePile::hasText() const
+float PicturePile::maxZoomScale() const
{
+ float maxZoomScale = 1;
for (size_t i = 0; i < m_pile.size(); i++) {
- if (m_pile[i].hasText)
- return true;
+ maxZoomScale = std::max(maxZoomScale, m_pile[i].maxZoomScale);
}
- return false;
+ return maxZoomScale;
}
bool PicturePile::isEmpty() const
@@ -313,7 +313,7 @@ Picture* PicturePile::recordPicture(PicturePainter* painter, PictureContainer& p
WebCore::PlatformGraphicsContextRecording pgc(picture);
WebCore::GraphicsContext gc(&pgc);
painter->paintContents(&gc, pc.area);
- pc.hasText = pgc.hasText();
+ pc.maxZoomScale = pgc.maxZoomScale();
if (pgc.isEmpty()) {
SkSafeUnref(picture);
picture = 0;
@@ -365,7 +365,7 @@ Picture* PicturePile::recordPicture(PicturePainter* painter, PictureContainer& p
painter->paintContents(&gc, drawArea);
// TODO: consider paint-time checking for these with SkPicture painting?
- pc.hasText = true;
+ pc.maxZoomScale = FLOAT_MAX;
SkSafeUnref(canvas);
picture->endRecording();
diff --git a/Source/WebKit/android/jni/PicturePile.h b/Source/WebKit/android/jni/PicturePile.h
index 1f99054..51bf384 100644
--- a/Source/WebKit/android/jni/PicturePile.h
+++ b/Source/WebKit/android/jni/PicturePile.h
@@ -71,13 +71,13 @@ public:
IntRect area;
bool dirty;
RefPtr<PrerenderedInval> prerendered;
- bool hasText;
+ float maxZoomScale;
PictureContainer(const IntRect& area)
: picture(0)
, area(area)
, dirty(true)
- , hasText(false)
+ , maxZoomScale(1)
{}
PictureContainer(const PictureContainer& other);
@@ -105,7 +105,7 @@ public:
PrerenderedInval* prerenderedInvalForArea(const IntRect& area);
// UI-side methods used to check content, after construction/updates are complete
- bool hasText() const;
+ float maxZoomScale() const;
bool isEmpty() const;
private: