diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-14 16:29:47 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-14 16:29:47 +0200 |
commit | d0424a769059c84ae20beb3c217812792ea6726b (patch) | |
tree | 6f94a5c3db8c52c6694ee56498542a6c35417350 /Source/WebKit/chromium/src/WebViewImpl.cpp | |
parent | 88a04ac016f57c2d78e714682445dff2e7db4ade (diff) | |
download | qtwebkit-d0424a769059c84ae20beb3c217812792ea6726b.tar.gz |
Imported WebKit commit 37c5e5041d39a14ea0d429a77ebd352e4bd26516 (http://svn.webkit.org/repository/webkit/trunk@128608)
New snapshot that enables WebKit2 build on Windows (still some bugs) and allows for WebKit to be built with qmake && make
Diffstat (limited to 'Source/WebKit/chromium/src/WebViewImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebViewImpl.cpp | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 238b2f920..d18cd236c 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -120,7 +120,6 @@ #include "TextIterator.h" #include "Timer.h" #include "TraceEvent.h" -#include "UserGestureIndicator.h" #include "WebAccessibilityObject.h" #include "WebActiveWheelFlingParameters.h" #include "WebAutofillClient.h" @@ -639,7 +638,7 @@ void WebViewImpl::handleMouseUp(Frame& mainFrame, const WebMouseEvent& event) FrameView* view = m_page->mainFrame()->view(); IntPoint clickPoint(m_lastMouseDownPoint.x, m_lastMouseDownPoint.y); IntPoint contentPoint = view->windowToContents(clickPoint); - HitTestResult hitTestResult = focused->eventHandler()->hitTestResultAtPoint(contentPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::TestChildFrameScrollBars); + HitTestResult hitTestResult = focused->eventHandler()->hitTestResultAtPoint(contentPoint, false, false, ShouldHitTestScrollbars); // We don't want to send a paste when middle clicking a scroll bar or a // link (which will navigate later in the code). The main scrollbars // have to be handled separately. @@ -1008,8 +1007,9 @@ WebRect WebViewImpl::computeBlockBounds(const WebRect& rect, AutoZoomType zoomTy // Use the rect-based hit test to find the node. IntPoint point = mainFrameImpl()->frameView()->windowToContents(IntPoint(rect.x, rect.y)); - HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | ((zoomType == FindInPage) ? HitTestRequest::IgnoreClipping : 0); - HitTestResult result = mainFrameImpl()->frame()->eventHandler()->hitTestResultAtPoint(point, hitType, IntSize(rect.width, rect.height)); + HitTestResult result = mainFrameImpl()->frame()->eventHandler()->hitTestResultAtPoint(point, + false, zoomType == FindInPage, DontHitTestScrollbars, HitTestRequest::Active | HitTestRequest::ReadOnly, + IntSize(rect.width, rect.height)); Node* node = result.innerNonSharedNode(); if (!node) @@ -1741,28 +1741,11 @@ void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect { ASSERT(m_layerTreeView); - PlatformContextSkia context(canvas); - - // PlatformGraphicsContext is actually a pointer to PlatformContextSkia - GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); - int bitmapHeight = canvas->getDevice()->accessBitmap(false).height(); - - // Compute rect to sample from inverted GPU buffer. - IntRect invertRect(rect.x(), bitmapHeight - rect.maxY(), rect.width(), rect.height()); - - OwnPtr<ImageBuffer> imageBuffer(ImageBuffer::create(rect.size())); - RefPtr<Uint8ClampedArray> pixelArray(Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4)); - if (imageBuffer && pixelArray) { - m_layerTreeView->compositeAndReadback(pixelArray->data(), invertRect); - imageBuffer->putByteArray(Premultiplied, pixelArray.get(), rect.size(), IntRect(IntPoint(), rect.size()), IntPoint()); - gc.save(); - gc.translate(IntSize(0, bitmapHeight)); - gc.scale(FloatSize(1.0f, -1.0f)); - // Use invertRect in next line, so that transform above inverts it back to - // desired destination rect. - gc.drawImageBuffer(imageBuffer.get(), ColorSpaceDeviceRGB, invertRect.location()); - gc.restore(); - } + SkBitmap target; + target.setConfig(SkBitmap::kARGB_8888_Config, rect.width(), rect.height(), rect.width() * 4); + target.allocPixels(); + m_layerTreeView->compositeAndReadback(target.getPixels(), rect); + canvas->writePixels(target, rect.x(), rect.y()); } #endif @@ -1923,8 +1906,6 @@ const WebInputEvent* WebViewImpl::m_currentInputEvent = 0; bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) { - UserGestureIndicator gestureIndicator(WebInputEvent::isUserGestureEventType(inputEvent.type) ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture); - // If we've started a drag and drop operation, ignore input events until // we're done. if (m_doingDragAndDrop) |