summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
authorVictoria Lease <violets@google.com>2012-02-13 15:46:16 -0800
committerVictoria Lease <violets@google.com>2012-02-21 11:08:13 -0800
commit66c40fc863939bd103a5256eb48e944508725c53 (patch)
treec6e64c85ff11af2c1a45533fb8fc562c78d08314 /Source/WebCore
parenta54eb7fa1e850d7096f97065f35ed00bcb5384d3 (diff)
downloadexternal_webkit-66c40fc863939bd103a5256eb48e944508725c53.zip
external_webkit-66c40fc863939bd103a5256eb48e944508725c53.tar.gz
external_webkit-66c40fc863939bd103a5256eb48e944508725c53.tar.bz2
async find-on-page implementation via WebKit
Change-Id: I5804c865f4bce6452213dc89337ff6a5e6100c9e
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/android/RenderThemeAndroid.cpp10
-rw-r--r--Source/WebCore/platform/android/RenderThemeAndroid.h3
-rw-r--r--Source/WebCore/platform/graphics/android/GLExtras.cpp51
-rw-r--r--Source/WebCore/platform/graphics/android/GLExtras.h6
4 files changed, 14 insertions, 56 deletions
diff --git a/Source/WebCore/platform/android/RenderThemeAndroid.cpp b/Source/WebCore/platform/android/RenderThemeAndroid.cpp
index b570d0e..97110ee 100644
--- a/Source/WebCore/platform/android/RenderThemeAndroid.cpp
+++ b/Source/WebCore/platform/android/RenderThemeAndroid.cpp
@@ -181,6 +181,16 @@ Color RenderThemeAndroid::platformInactiveListBoxSelectionForegroundColor() cons
return Color(Color::transparent);
}
+Color RenderThemeAndroid::platformActiveTextSearchHighlightColor() const
+{
+ return Color(0x00, 0x99, 0xcc, 0x99); // HOLO_DARK
+}
+
+Color RenderThemeAndroid::platformInactiveTextSearchHighlightColor() const
+{
+ return Color(0x33, 0xb5, 0xe5, 0x66); // HOLO_LIGHT
+}
+
int RenderThemeAndroid::baselinePosition(const RenderObject* obj) const
{
// From the description of this function in RenderTheme.h:
diff --git a/Source/WebCore/platform/android/RenderThemeAndroid.h b/Source/WebCore/platform/android/RenderThemeAndroid.h
index 802d3c3..165abf8 100644
--- a/Source/WebCore/platform/android/RenderThemeAndroid.h
+++ b/Source/WebCore/platform/android/RenderThemeAndroid.h
@@ -67,6 +67,9 @@ public:
virtual Color platformActiveListBoxSelectionForegroundColor() const;
virtual Color platformInactiveListBoxSelectionForegroundColor() const;
+ virtual Color platformActiveTextSearchHighlightColor() const;
+ virtual Color platformInactiveTextSearchHighlightColor() const;
+
virtual void systemFont(int, WebCore::FontDescription&) const {}
virtual int minimumMenuListSize(RenderStyle*) const { return 0; }
diff --git a/Source/WebCore/platform/graphics/android/GLExtras.cpp b/Source/WebCore/platform/graphics/android/GLExtras.cpp
index b872951..8a1d2fa 100644
--- a/Source/WebCore/platform/graphics/android/GLExtras.cpp
+++ b/Source/WebCore/platform/graphics/android/GLExtras.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "DrawExtra.h"
-#include "FindCanvas.h"
#include "GLExtras.h"
#include "IntRect.h"
#include "TilesManager.h"
@@ -58,8 +57,7 @@
#define MAX_NUMBER_OF_MATCHES_TO_DRAW 101
GLExtras::GLExtras()
- : m_findOnPage(0)
- , m_ring(0)
+ : m_ring(0)
, m_drawExtra(0)
, m_viewport()
{
@@ -170,58 +168,11 @@ void GLExtras::drawCursorRings(const LayerAndroid* layer)
layer ? layer->drawTransform() : 0);
}
-void GLExtras::drawFindOnPage(const LayerAndroid* layer)
-{
- WTF::Vector<MatchInfo>* matches = m_findOnPage->matches();
- XLOG("drawFindOnPage, matches: %p", matches);
- if (!matches || !m_findOnPage->isCurrentLocationValid())
- return;
- std::pair<unsigned, unsigned> matchRange =
- m_findOnPage->getLayerMatchRange(layer ? layer->uniqueId() : -1);
- if (matchRange.first >= matchRange.second)
- return;
-
- int count = matches->size();
- unsigned current = m_findOnPage->currentMatchIndex();
- XLOG("match count: %d", count);
- const TransformationMatrix* drawTransform =
- layer ? layer->drawTransform() : 0;
- if (count < MAX_NUMBER_OF_MATCHES_TO_DRAW)
- for (unsigned i = matchRange.first; i < matchRange.second; i++) {
- MatchInfo& info = matches->at(i);
- const SkRegion& region = info.getLocation();
- SkIRect rect = region.getBounds();
- if (drawTransform) {
- IntRect intRect(rect.fLeft, rect.fTop, rect.width(),
- rect.height());
- IntRect transformedRect = drawTransform->mapRect(intRect);
- rect.setXYWH(transformedRect.x(), transformedRect.y(),
- transformedRect.width(), transformedRect.height());
- }
- if (rect.intersect(m_viewport.fLeft, m_viewport.fTop,
- m_viewport.fRight, m_viewport.fBottom))
- drawRegion(region, i == current, false, drawTransform, COLOR_HOLO_DARK);
-#ifdef DEBUG
- else
- XLOG("Quick rejecting [%dx%d, %d, %d", rect.fLeft, rect.fTop,
- rect.width(), rect.height());
-#endif // DEBUG
- }
- else {
- if (matchRange.first <= current && current < matchRange.second) {
- MatchInfo& info = matches->at(current);
- drawRegion(info.getLocation(), true, false, drawTransform, COLOR_HOLO_DARK);
- }
- }
-}
-
void GLExtras::drawGL(const LayerAndroid* layer)
{
if (m_drawExtra) {
if (m_drawExtra == m_ring)
drawCursorRings(layer);
- else if (m_drawExtra == m_findOnPage)
- drawFindOnPage(layer);
else
m_drawExtra->drawGL(this, layer);
}
diff --git a/Source/WebCore/platform/graphics/android/GLExtras.h b/Source/WebCore/platform/graphics/android/GLExtras.h
index 51ad8d8..72ee41c 100644
--- a/Source/WebCore/platform/graphics/android/GLExtras.h
+++ b/Source/WebCore/platform/graphics/android/GLExtras.h
@@ -32,7 +32,6 @@
#include "SkRegion.h"
namespace android {
- class FindOnPage;
class CursorRing;
}
@@ -47,9 +46,6 @@ public:
virtual ~GLExtras();
void drawGL(const LayerAndroid* layer);
- void setFindOnPageExtra(android::FindOnPage* findOnPage) {
- m_findOnPage = findOnPage;
- }
void setCursorRingExtra(android::CursorRing* ring) { m_ring = ring; }
void setDrawExtra(android::DrawExtra* extra) { m_drawExtra = extra; }
void setViewport(const SkRect & viewport) { m_viewport = viewport; }
@@ -60,9 +56,7 @@ public:
private:
void drawRing(SkRect& srcRect, Color color, const TransformationMatrix* drawMat);
void drawCursorRings(const LayerAndroid* layer);
- void drawFindOnPage(const LayerAndroid* layer);
- android::FindOnPage* m_findOnPage;
android::CursorRing* m_ring;
android::DrawExtra* m_drawExtra;
SkRect m_viewport;