diff options
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 01f46bdfc..eaf8485d3 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -92,7 +92,7 @@ static inline ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& even ui::LatencyInfo latency_info; // The latency number should only be added if the timestamp is valid. if (event.timeStampSeconds) { - const int64 time_micros = static_cast<int64>( + const int64_t time_micros = static_cast<int64_t>( event.timeStampSeconds * base::Time::kMicrosecondsPerSecond); latency_info.AddLatencyNumberWithTimestamp( ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, @@ -163,7 +163,7 @@ static inline bool compareTouchPoints(const QTouchEvent::TouchPoint &lhs, const return lhs.state() < rhs.state(); } -static uint32 s_eventId = 0; +static uint32_t s_eventId = 0; class MotionEventQt : public ui::MotionEvent { public: MotionEventQt(const QList<QTouchEvent::TouchPoint> &touchPoints, const base::TimeTicks &eventTime, Action action, const Qt::KeyboardModifiers modifiers, float dpiScale, int index = -1) @@ -179,7 +179,7 @@ public: Q_ASSERT((action != ACTION_DOWN && action != ACTION_UP) || index == 0); } - virtual uint32 GetUniqueEventId() const Q_DECL_OVERRIDE { return eventId; } + virtual uint32_t GetUniqueEventId() const Q_DECL_OVERRIDE { return eventId; } virtual Action GetAction() const Q_DECL_OVERRIDE { return action; } virtual int GetActionIndex() const Q_DECL_OVERRIDE { return index; } virtual size_t GetPointerCount() const Q_DECL_OVERRIDE { return touchPoints.size(); } @@ -204,6 +204,7 @@ public: } virtual int GetFlags() const Q_DECL_OVERRIDE { return flags; } virtual float GetPressure(size_t pointer_index) const Q_DECL_OVERRIDE { return touchPoints.at(pointer_index).pressure(); } + virtual float GetTilt(size_t pointer_index) const Q_DECL_OVERRIDE { return 0; } virtual base::TimeTicks GetEventTime() const Q_DECL_OVERRIDE { return eventTime; } virtual size_t GetHistorySize() const Q_DECL_OVERRIDE { return 0; } @@ -218,7 +219,7 @@ private: QList<QTouchEvent::TouchPoint> touchPoints; base::TimeTicks eventTime; Action action; - const uint32 eventId; + const uint32_t eventId; int flags; int index; float dpiScale; @@ -595,10 +596,10 @@ void RenderWidgetHostViewQt::CopyFromCompositingSurface(const gfx::Rect& src_sub callback.Run(SkBitmap(), content::READBACK_FAILED); } -void RenderWidgetHostViewQt::CopyFromCompositingSurfaceToVideoFrame(const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) +void RenderWidgetHostViewQt::CopyFromCompositingSurfaceToVideoFrame(const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(const gfx::Rect&, bool)>& callback) { NOTIMPLEMENTED(); - callback.Run(false); + callback.Run(gfx::Rect(), false); } bool RenderWidgetHostViewQt::CanCopyToVideoFrame() const @@ -611,7 +612,15 @@ bool RenderWidgetHostViewQt::HasAcceleratedSurface(const gfx::Size&) return false; } -void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32 output_surface_id, scoped_ptr<cc::CompositorFrame> frame) +void RenderWidgetHostViewQt::LockCompositingSurface() +{ +} + +void RenderWidgetHostViewQt::UnlockCompositingSurface() +{ +} + +void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32_t output_surface_id, scoped_ptr<cc::CompositorFrame> frame) { bool scrollOffsetChanged = (m_lastScrollOffset != frame->metadata.root_scroll_offset); bool contentsSizeChanged = (m_lastContentsSize != frame->metadata.root_layer_size); @@ -622,7 +631,7 @@ void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32 output_surface_id, sco m_pendingOutputSurfaceId = output_surface_id; Q_ASSERT(frame->delegated_frame_data); Q_ASSERT(!m_chromiumCompositorData->frameData || m_chromiumCompositorData->frameData->resource_list.empty()); - m_chromiumCompositorData->frameData = frame->delegated_frame_data.Pass(); + m_chromiumCompositorData->frameData = std::move(frame->delegated_frame_data); m_chromiumCompositorData->frameDevicePixelRatio = frame->metadata.device_scale_factor; // Support experimental.viewport.devicePixelRatio, see GetScreenInfo implementation below. @@ -1059,11 +1068,12 @@ void RenderWidgetHostViewQt::handleFocusEvent(QFocusEvent *ev) if (ev->gotFocus()) { m_host->GotFocus(); m_host->SetActive(true); - Q_ASSERT(m_host->IsRenderView()); + content::RenderViewHostImpl *viewHost = content::RenderViewHostImpl::From(m_host); + Q_ASSERT(viewHost); if (ev->reason() == Qt::TabFocusReason) - static_cast<content::RenderViewHostImpl*>(m_host)->SetInitialFocus(false); + viewHost->SetInitialFocus(false); else if (ev->reason() == Qt::BacktabFocusReason) - static_cast<content::RenderViewHostImpl*>(m_host)->SetInitialFocus(true); + viewHost->SetInitialFocus(true); ev->accept(); } else if (ev->lostFocus()) { m_host->SetActive(false); |