summaryrefslogtreecommitdiffstats
path: root/lib/render_widget_host_view_qt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of the intermediate "shared" static library.Jocelyn Turcotte2013-11-211-2/+1
| | | | | | | | It is not necessary anymore since QtWebEngineProcess dynamically links to the core library which will now contain those symbols. Change-Id: I3475347bab41a00b943f934a5e341326c66dc726 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Add some QQuickWebView graphics stack tests.Jocelyn Turcotte2013-11-151-0/+9
| | | | | | | | | | | This does basic sanity testing of the graphics stack for both the hardware accelerated and software codepaths. This also adds a required signal to report the CompositingSurface later on if the QWindow wasn't available yet when Chromium asked for it. Change-Id: I402ec5ade9114c78bea7960c5f0de989f54110e3 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Delegated renderer: Fix remaining synchronization issues.Jocelyn Turcotte2013-11-151-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two issues: - The onFrameSwapped slot was connected with a QueuedConnection, this means that any previous frame triggered by Qt could be queued right before updatePaintNode is called, and be handled right after, thus picking our m_pendingAckFrameData and sending the Ack before this frame was actually swapped. - For cases where Qt triggers a new frame (e.g. typing text in a QtQuick text area) it would be possible that it starts rendering before m_pendingUpdateFrameData had been set, which would render the old frame while Chromium might be in the middle of rendering the new one on the same resources, or destroying them. The solution is grossly to do proper used resource reporting to the child compositors via cc::CompositorFrameAck::resources. We previously released all resources on every frame, and Chromium would resend back to us the ones that could be reused without change. We now instead only return unused resources, but this also means that we have to keep track of used resources ourselves. cc::DelegatedFrameData::resource_list only contain new resources to be added to the scene and we keep a deep copy of the cc::TransferableResource into our MailboxTextures. A few other changes that come with this: - A few null-checks can now be removed since we can better rely on the integrity of the information passed through DelegatedFrameData. - Since we can now prevent used resources from being destroyed while we use them, trigger a frame Ack immediately after updatePaintNode instead of waiting until the buffer is swapped, like ui::Compositor does. - MailboxTexture is now more autonomous, but still require some information from quads. Mark them as not containing alpha by default and fetch this information from quads when encountered. Change-Id: Ice235f3a98a179c87eec7fbcb9880e34b0ed1e73 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Delegated renderer: Put textures on those quads.Jocelyn Turcotte2013-11-111-26/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few changes are necessary to allow fetching textures provided by the render processes through IPC and bound to their respective GL context in the GPU process and use them in the QtQuick scene graph. - Remove the plain color test textures. - Allow setting the QtQuick QOpenGLContext's handle as the share context for all context set as shared in the Chromium GPU process. We do this by letting the GpuChannelManager ask us for a ShareGroup instance responsible for returning a sharing GL context handle. - Fetch texture IDs from the MailboxManager used by the GPU process using the Mailbox given to us in the DelegatedFrameData. This is the same mechanism used by Chromium to share textures between "client" GL contexts. - Keep the QtQuick scene graph threads and Chromium in-process GPU thread separate. The complicated part of merging those two rendering pipelines on the same thread is that it would force Qt to also use only one thread for rendering. For the moment we will try to synchronize those threads together instead. - Lock the Qt SG thread while waiting for resource sync points. Do so by posting a callback to the Chromium GPU thread and wait until the sync point of every resource has been retired by the producing contexts. - Acknowledge the delegated from once QtQuick swapped the GL buffers instead of right after we added the frame to the scene graph. This fixes some issues where the textures for the previous frame would already be released as Chromium was producing the new frame. There are still a few issues regarding synchronization that have to be fixed, especially when Qt triggers the rendering of a new frame while Chromium is starting to produce the next frame. Note: To enable it we still need to pass the following command switches: --enable-delegated-renderer --enable-threaded-compositing --in-process-gpu Change-Id: I2d4f7fac603b1808ed1495a8d689cb48e9ed41b9 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Make RenderWidgetHostViewQtDelegate a pure interface.Jocelyn Turcotte2013-11-061-65/+104
| | | | | | | | | | | | | | | | | | | | | | | RenderWidgetHostViewQtDelegate acts as a bidirectional interface to avoid exporting Chromium symbols outside of the core dynamic library. The problem is that, other than this, from the top layer point of view, its responsibilities are the same as RenderWidgetHostViewQt, and it would be better not to split its logic without properly defined responsibilities. Using it as a base class and interfacing through its protected methods is also cumbersome and make the destination of calls on the upper layer difficult to discern. Use instead a dual pure interface mechanism like WebContentsAdapter and pass the callback client interface directly in WebContentsAdapterClient::CreateRenderWidgetHostViewQtDelegate. This allows RenderWidgetHostViewQtDelegate to be solely what it should be, an interface. Change-Id: I4e55439ae7f9539cc9e360f0756fbf391405f3b7 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Implement popup dialogMary Wu2013-10-291-1/+3
| | | | | | | | | This is used to show like date time picker whose document content was generated in webkit engine. Change-Id: I900a6ae5f61646d2ef8497dccc114f7cb5882349 Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement inputMethodQueryAndras Becsi2013-10-251-4/+87
| | | | | | | | | | | | This makes it possible on touch devices to use a simple virtual keyboard input method that synthesizes key events. This is the minimal requirement to make the the boot2Qt Keyboard component functional. For more advanced input methods and the widget tests we will need to override inputMethodEvent as well. Change-Id: If9228ee6b1730d72e7424bdb33a9a9c46654507f Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Render delegated renderer frames using the Qt scene graph.Jocelyn Turcotte2013-10-141-0/+31
| | | | | | | | | | | | | | This provides a stub implementation that renders quads and RenderPasses using QSGNodes in QQuickWebEngineView. The BackingStore code path is still supported when the delegated renderer switch is not enabled. To use the new rendering, pass the following switches: --enable-delegated-renderer --enable-threaded-compositing This uses debug, plain color textures until we can fetch tiles and textures from the ResourceProvider across OpenGL context boundaries. Change-Id: I33ea0738dc5a326ef79c1435f75c044c42e8551f Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Implement multiple mouse click detection.Michael Brüning2013-09-161-2/+21
| | | | | | | | | | Fixes the ASSERT we were seeing on double clicks and implements detection for triple, quadruple etc. clicks. Double mouse clicks forwarded from QMouseEvent are swallowed. Change-Id: I9be83f809805ab3dea7a508b648046238ce36a90 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix rendering on Retina displaysAndras Becsi2013-09-021-2/+3
| | | | | | | | | | Since the QWindow returned by the RWHV delegates was always 0 we never actually propagated a valid WebScreenInfo to chromium. Additionally the painting and scrolling in the backing store had to be fixed so that the device pixel ratio is taken into account. Change-Id: I22dc135e8e090362201292863ed911464b9fc133 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Implement window creation through QWebEnginePage::createWindow.Jocelyn Turcotte2013-09-021-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | This makes the necessary changes to handle WebContentsDelegateQt::AddNewContents and funnel the callback through createWindow in QWebEnginePage and QWebEngineView. - Expose the AddNewContents callback through WebContentsAdapterClient - Allow creating a WebContentsAdapter attached only on the Chromium side, leaving the choice to QWebEnginePage to either adopt it and call WebContentsAdapter::initialize to attach itself as the client, or destroy it if the application isn't handling the call. - Delay the InitAsChild handling in RenderWidgetHostViewQt when it is called before an adapter client has been attached. - Since WebContentsAdapterClient::CreateRenderWidgetHostViewQtDelegate is only a factory method, not creating any link with the callee client, allow using the creating window's adapter client to create the RWHVQtDelegate. This allows an unparented delegate to be created instead of needing to add numerous null-checks in RWHVQt. Use content::WebContents::CreateParams::context for this purpose, which can be used both when creating a WebContents ourselves and when a new window's WebContents is created for us. Change-Id: I032262e867931dc40a7c2eca0c993027a555f56e Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Make less noise with QT_WEBENGINE_LOGGINGAndras Becsi2013-08-301-5/+5
| | | | | | | | | Comment out QT_NOT_YET_IMPLEMENTED in MovePluginWindows and SetTooltipText since they make too much noise and hide every other message. Add missing macro where it might be useful. Change-Id: I6a5b7bb677cfa5e74521a06955338552a6b011f0 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Delay the RWHVDelegate parenting until it's been attached to its RWHV.Jocelyn Turcotte2013-08-121-0/+1
| | | | | | | | This avoids the RWHV being accessed before being attached to the delegate when attaching the later to the view's layout. Change-Id: I5fffef60fdd7203cfb4ced807b5475aac676ea09 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Simplify the ownership between RWHVQt and RWHVQtDelegate.Jocelyn Turcotte2013-08-121-1/+2
| | | | | | | | | | Let the RWHVQt explicitly own its delegate. Keep the same behavior by letting RWHVQt::Destroy delete itself directly like done in RWHVGtk instead of deleting the RWHVDelegate which would then delete its RWHV. Change-Id: I051c95d608964ebcd66d3ccbe728f63c0ca397ae Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Don't pass the RWHV to the AdapterClientPierre Rossi2013-08-021-10/+1
| | | | | | | | | | | | | As this looks like a layering violation. Instead, rely on WebContentsViewImpl::CreateRenderViewForRenderManager querying the WebContentsView's size before setting it on the RenderWidgetHostView. The WebContentsView now gets the size of the actual view through the Adapter interface. Then, in RenderWidgetHostViewQt, we now forward the resize request to the delegate. Change-Id: Ide679f6d114508cc7c9ffac83daad19d16764a4d Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Handle basic cursor changes.Jocelyn Turcotte2013-08-011-2/+96
| | | | | Change-Id: Ic08f83db03454542554fac9e590d79a4440a4b28 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Forward mouse hover events to the page.Jocelyn Turcotte2013-08-011-0/+10
| | | | | Change-Id: I5ce13af04de8520bb0ab93c48a2493822aa42294 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Use ui::GestureRecognizer to enable viewport gestures.Jocelyn Turcotte2013-08-011-1/+77
| | | | | | | | | | | | This enables panning and zooming using touch events. Also map touch IDs given by Qt to 0-based IDs since the gesture recognizer expects it. It currently needs the following command line switches to be enabled: --force-compositing-mode --enable-threaded-compositing --enable-pinch Change-Id: I34db3203529470aef5426ddfaa65af7d67e4b017 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Transform QTouchEvent into ui::TouchEvent first.Jocelyn Turcotte2013-08-011-2/+62
| | | | | | | | | | | | | | | WebTouchEvents have a slightly different behavior than QTouchEvent in that the type of the event is TouchStart for each new point press, while Qt sends a TouchBegin only for the first point press. Since we already need to use ui::TouchEvent to be able to use ui::GestureRecognizer, always do this conversion first to also let UpdateWebTouchEventAfterDispatch chose the proper event type. Some of the code from render_widget_host_view_aura.cc was copied into render_widget_host_view_qt.cpp to fill the needed functionality. Change-Id: Iab1ca0c449b5256a39b5479ce89b662d4e133935 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Enable accelerated composition with QtWidgets view for testing.Jocelyn Turcotte2013-08-011-6/+3
| | | | | | | | | | Only enable it when the --force-compositing-mode switch is used. The purpose of this is only to allow testing pinch-zooming until we are able to use the delegated renderer in the QtQuick view. Change-Id: I2ca265c84c8fe6a74299f1b2757ad525f33fae17 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Split out the Widgets and QtQuick integrationPierre Rossi2013-07-311-3/+6
| | | | | | | | | | | | | | | This is the first step to making proper Qt Modules out of QtWebEngine. The Widgets integration becomes a proper C++ Qt Module while we make the QtQuick side a QML plugin for now (could probably be promoted if the need arises). Code-wise, this means the introduction of a WebContentsAdapterClient interface that is subclassed by the private implementation of our API classes for delegation of things that are UI specific. Functionality from WebContents and the like is exposed via the WebContentsAdapter. Change-Id: I4ca3395b9fe8502a24e36002cfd5af44067bb6e8 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Forward touch events.Jocelyn Turcotte2013-07-291-0/+11
| | | | | | | This lets the page receive touch events sent to the QWidget/QQuickItem. Change-Id: Ic358d4963d6af3df57d37a02b471cd442e8947ce Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Silence compiler warningsAndras Becsi2013-07-261-0/+1
| | | | | | | | Remove unused variables, add missing return and avoid comparing unsigned integers with signed ones. Change-Id: I9b295a5dc10927ec89471a424c93cf3b168cf078 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Cleanup after chromium update.Zeno Albisser2013-07-241-3/+3
| | | | | | | | | | | | | | | | | | | - Implement recently added pure virtual members: BrowserContextQt::GetPath() const BrowserContextQt::RequestMIDISysExPermission(...) - Remove obsolete function GetSpeechRecognitionPreferences. - Rename usage of GetActiveURL() to GetVisibleURL(). - Update namespace for usage of type WebPluginGeometry. - Adjust parameters of RenderWidgetHostViewQt::TextInputChanged. - Rename RenderWidgetHostViewQt::RenderViewGone to RenderProcessGone - set_http_server_properties now takes a scoped_ptr. - Rename WebDropData to content::DropData. - Rename WebMenuItem to content::MenuItem. - webkit/support/webkit_support.gyp has been moved to webkit/webkit_resources.gyp. Change-Id: I6d5d281b797a8f6197ecb53a08798bd1f6845754 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Get rid of some more QT_NOT_YET_IMPLEMENTEDAndras Becsi2013-07-031-12/+5
| | | | | Change-Id: I4fb120592eccfd1e75db32c76ddcbdad77762106 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement focus handling functionsAndras Becsi2013-07-021-3/+2
| | | | | | | | | Add setKeyboardFocus and hasKeyboardFocus members to the render widget host view delegates and use them for focus handling. Change-Id: Id117298bccc5fdbbb940869e64d925f3708e808c Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix potential null pointer dereference crashAndras Becsi2013-06-281-1/+1
| | | | | | Change-Id: I88588a34cb857cecd8dbe95ca87510443a4524fd Reviewed-by: Matt Broadstone <mbroadst@gmail.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Avoild calls to RenderWidgetHostViewQt::GetNativeView()Andras Becsi2013-06-281-5/+24
| | | | | | | | | | | | | Override RenderWidgetHostView::GetPhysicalBackingSize() since the implementation in RenderWidgetHostViewBase calls GetNativeView only to get the device scale factor of the screen. This way we can avoid calls to GetNativeView for now. Add a new macro QT_NOT_USED to mark evaluated and currently unused and possibly unneded functions and mark gfx::NativeView related functions in our render widget host view implementation as unused. Change-Id: I32011334fe06618cb47ea649d2f6e4393310dc13 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Fix the regression introduced by the previous build fix.Michael Brüning2013-06-211-11/+2
| | | | Methods signatures were changed, not new methods added.
* Fix build due to new pure virtuals in RenderWidgetHostView.Michael Brüning2013-06-211-0/+9
|
* Move RenderWidgetHostViewQt out of the content namespace.Jocelyn Turcotte2013-06-191-5/+0
|
* Move API layer-only classes back from the shared static lib.Jocelyn Turcotte2013-06-191-0/+469
| | | | | | | Since ContentBrowserClientQt::OverrideCreateWebContentsView now takes care of using our Qt layer at runtime without relying on the static RenderWidgetHostView::CreateViewForWidget, we can now avoid linking this layer into the render process.
* Fix undefined symbols in debug builds.Jocelyn Turcotte2013-06-101-518/+0
| | | | | | | process uses the same code as lib and decides at runtime which code to run. Fix the debug build by making sure that all infrastructure code is available in both process and lib by building common code not shared directly through chromium sources in a separate static lib.
* Implement support for QtQuick2.Zeno Albisser2013-06-051-27/+25
| | | | | | | | | | | | | | | | | The current preliminary implementation uses the QQuickPaintedItem. The RasterWindow is being replaced by an abstract NativeViewQt class, which can be instantiated as QWidgetNativeView or QQuickNativeView. The NativeViewContainerQt builds a wrapper around an instance of these classes and serves as a common api towards chromium. Due to the current design where the view is being created by the shell, we introduce a browser_window.qml which provides a very basic browser UI. The content is then being injected into an item within that browser window. Just executing the example the "regular" way will launch the Widgets example. To launch the QtQuick2 example, the environment variable QQUICKWEBENGINE must be defined.
* Add standard license boilerplateSimon Hausmann2013-05-311-0/+41
|
* Remove Qt specific m_window member from Shell.Zeno Albisser2013-05-311-1/+0
| | | | Unfortunately this requires some minor reinterpret_casts.
* remove Gtk left overs.Zeno Albisser2013-05-311-1/+0
|
* Remove WebContentsViewGtk dependency.Zeno Albisser2013-05-311-2/+0
|
* Get a blinking cursor in input elementsPierre Rossi2013-05-311-1/+21
| | | | | Handle focus events and do some slighly evil stuff in shell_qt.cpp to set the cursor_blink_interval
* make the backingstore use a QPixmap instead of QBackingStoreZeno Albisser2013-05-311-6/+13
|
* Introduce RasterWindowContainer to allow reusing the container with ↵Zeno Albisser2013-05-221-67/+91
| | | | | | | | | different child views. Pass the view to BackingStoreQt::displayBuffer instead of creating it implicitly. Rename RenderWidgetHostView to RenderWidgetHostViewQt and move it into namespace content. Copy in web_contents_view from gtk to allow for modifications outside of the chromium tree. Remove the ViewHostFactory, as it is meant to be used for testing only.
* Wheel eventsPierre Rossi2013-05-161-11/+8
|
* Basic event translationPierre Rossi2013-05-151-15/+15
|
* Cleaning up and splitting things up into separate h/cpp files.Zeno Albisser2013-05-151-0/+435