summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp5
-rw-r--r--Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp11
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp6
-rw-r--r--Source/WebKit/android/jni/WebViewCore.h3
4 files changed, 18 insertions, 7 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
index 15214ad..3237a80 100644
--- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
+++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
@@ -47,6 +47,7 @@
#define NEW_OP(X) new (heap()) GraphicsOperation::X
#define USE_CLIPPING_PAINTER true
+#define MIN_TRACKED_OPAQUE_AREA 750
namespace WebCore {
@@ -1044,7 +1045,9 @@ void PlatformGraphicsContextRecording::appendDrawingOperation(
return;
}
#if USE_CLIPPING_PAINTER
- if (operation->isOpaque() && !untranslatedBounds.isEmpty()) {
+ if (operation->isOpaque()
+ && !untranslatedBounds.isEmpty()
+ && (untranslatedBounds.width() * untranslatedBounds.height() > MIN_TRACKED_OPAQUE_AREA)) {
// if the operation maps to an opaque rect, record the area it will cover
operation->setOpaqueRect(calculateCoveredBounds(untranslatedBounds));
}
diff --git a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
index 864b27d..6e39c33 100644
--- a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
+++ b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp
@@ -43,6 +43,7 @@
#include "WebViewCore.h"
#include "npruntime.h"
+#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
#include <ui/DisplayInfo.h>
#include <ui/PixelFormat.h>
@@ -124,15 +125,21 @@ String PlatformBridge::resolveFilePathForContentUri(const String& contentUri)
int PlatformBridge::PlatformBridge::screenDepth()
{
+ android::sp<android::IBinder> display(
+ android::SurfaceComposerClient::getBuiltInDisplay(
+ android::ISurfaceComposer::eDisplayIdMain));
android::DisplayInfo info;
- android::SurfaceComposerClient::getDisplayInfo(android::DisplayID(0), &info);
+ android::SurfaceComposerClient::getDisplayInfo(display, &info);
return info.pixelFormatInfo.bitsPerPixel;
}
FloatRect PlatformBridge::screenRect()
{
+ android::sp<android::IBinder> display(
+ android::SurfaceComposerClient::getBuiltInDisplay(
+ android::ISurfaceComposer::eDisplayIdMain));
android::DisplayInfo info;
- android::SurfaceComposerClient::getDisplayInfo(android::DisplayID(0), &info);
+ android::SurfaceComposerClient::getDisplayInfo(display, &info);
return FloatRect(0.0, 0.0, info.w, info.h);
}
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 920119b..aa38222 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -1576,7 +1576,7 @@ void WebViewCore::setSelectionCaretInfo(SelectText* selectTextContainer,
selectTextContainer->setCaretRect(handleId, caretRect);
selectTextContainer->setHandleType(handleId, handleType);
selectTextContainer->setTextRect(handleId,
- positionToTextRect(pos, affinity, offset));
+ positionToTextRect(pos, affinity, offset, caretRect));
}
bool WebViewCore::isLtr(const Position& position)
@@ -1684,9 +1684,9 @@ SelectText* WebViewCore::createSelectText(const VisibleSelection& selection)
}
IntRect WebViewCore::positionToTextRect(const Position& position,
- EAffinity affinity, const WebCore::IntPoint& offset)
+ EAffinity affinity, const WebCore::IntPoint& offset, const IntRect& caretRect)
{
- IntRect textRect;
+ IntRect textRect = caretRect;
InlineBox* inlineBox;
int offsetIndex;
position.getInlineBoxAndOffset(affinity, inlineBox, offsetIndex);
diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h
index 6e3604d..4e223b3 100644
--- a/Source/WebKit/android/jni/WebViewCore.h
+++ b/Source/WebKit/android/jni/WebViewCore.h
@@ -728,7 +728,8 @@ namespace android {
WebCore::IntRect absoluteClientRect(WebCore::Node* node,
WebCore::LayerAndroid* layer);
static WebCore::IntRect positionToTextRect(const WebCore::Position& position,
- WebCore::EAffinity affinity, const WebCore::IntPoint& offset);
+ WebCore::EAffinity affinity, const WebCore::IntPoint& offset,
+ const WebCore::IntRect& caretRect);
static bool isLtr(const WebCore::Position& position);
static WebCore::VisiblePosition trimSelectionPosition(
const WebCore::VisiblePosition& start,