diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/delegated_frame_node.cpp | 26 | ||||
-rw-r--r-- | src/core/delegated_frame_node.h | 8 | ||||
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 12 | ||||
-rw-r--r-- | src/core/render_widget_host_view_qt.h | 2 |
4 files changed, 24 insertions, 24 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp index b086cd4f3..ee2b1b5d7 100644 --- a/src/core/delegated_frame_node.cpp +++ b/src/core/delegated_frame_node.cpp @@ -430,7 +430,7 @@ void DelegatedFrameNode::preprocess() // We can now wait for the Chromium GPU thread to produce textures that will be // rendered on our quads and fetch the IDs from the mailboxes we were given. QList<MailboxTexture *> mailboxesToFetch; - Q_FOREACH (const QSharedPointer<MailboxTexture> &mailboxTexture, m_data->mailboxTextures.values()) + Q_FOREACH (const QSharedPointer<MailboxTexture> &mailboxTexture, m_chromiumCompositorData->mailboxTextures.values()) if (mailboxTexture->needsToFetch()) mailboxesToFetch.append(mailboxTexture.data()); @@ -469,10 +469,10 @@ void DelegatedFrameNode::preprocess() renderPass->grab(); } -void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResourceArray *resourcesToRelease) +void DelegatedFrameNode::commit(ChromiumCompositorData *chromiumCompositorData, cc::ReturnedResourceArray *resourcesToRelease) { - m_data = data; - cc::DelegatedFrameData* frameData = m_data->frameData.get(); + m_chromiumCompositorData = chromiumCompositorData; + cc::DelegatedFrameData* frameData = m_chromiumCompositorData->frameData.get(); if (!frameData) return; @@ -480,14 +480,14 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour // countering the scale of devicePixel-scaled tiles when rendering them // to the final surface. QMatrix4x4 matrix; - matrix.scale(1 / m_data->frameDevicePixelRatio, 1 / m_data->frameDevicePixelRatio); + matrix.scale(1 / m_chromiumCompositorData->frameDevicePixelRatio, 1 / m_chromiumCompositorData->frameDevicePixelRatio); setMatrix(matrix); // Keep the old texture lists around to find the ones we can re-use. QList<QSharedPointer<RenderPassTexture> > oldRenderPassTextures; m_renderPassTextures.swap(oldRenderPassTextures); QHash<unsigned, QSharedPointer<MailboxTexture> > mailboxTextureCandidates; - m_data->mailboxTextures.swap(mailboxTextureCandidates); + m_chromiumCompositorData->mailboxTextures.swap(mailboxTextureCandidates); // A frame's resource_list only contains the new resources to be added to the scene. Quads can // still reference resources that were added in previous frames. Add them to the list of @@ -568,7 +568,7 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour break; } case cc::DrawQuad::TEXTURE_CONTENT: { const cc::TextureDrawQuad *tquad = cc::TextureDrawQuad::MaterialCast(quad); - QSharedPointer<MailboxTexture> &texture = findMailboxTexture(tquad->resource_id, m_data->mailboxTextures, mailboxTextureCandidates); + QSharedPointer<MailboxTexture> &texture = findMailboxTexture(tquad->resource_id, m_chromiumCompositorData->mailboxTextures, mailboxTextureCandidates); // FIXME: TransferableResource::size isn't always set properly for TextureDrawQuads, use the size of its DrawQuad::rect instead. texture->setTextureSize(toQt(quad->rect.size())); @@ -628,7 +628,7 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour break; } case cc::DrawQuad::TILED_CONTENT: { const cc::TileDrawQuad *tquad = cc::TileDrawQuad::MaterialCast(quad); - QSharedPointer<MailboxTexture> &texture = findMailboxTexture(tquad->resource_id, m_data->mailboxTextures, mailboxTextureCandidates); + QSharedPointer<MailboxTexture> &texture = findMailboxTexture(tquad->resource_id, m_chromiumCompositorData->mailboxTextures, mailboxTextureCandidates); if (!quad->visible_rect.IsEmpty() && !quad->opaque_rect.Contains(quad->visible_rect)) texture->setHasAlphaChannel(true); @@ -645,15 +645,15 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour break; } case cc::DrawQuad::YUV_VIDEO_CONTENT: { const cc::YUVVideoDrawQuad *vquad = cc::YUVVideoDrawQuad::MaterialCast(quad); - QSharedPointer<MailboxTexture> &yTexture = findMailboxTexture(vquad->y_plane_resource_id, m_data->mailboxTextures, mailboxTextureCandidates); - QSharedPointer<MailboxTexture> &uTexture = findMailboxTexture(vquad->u_plane_resource_id, m_data->mailboxTextures, mailboxTextureCandidates); - QSharedPointer<MailboxTexture> &vTexture = findMailboxTexture(vquad->v_plane_resource_id, m_data->mailboxTextures, mailboxTextureCandidates); + QSharedPointer<MailboxTexture> &yTexture = findMailboxTexture(vquad->y_plane_resource_id, m_chromiumCompositorData->mailboxTextures, mailboxTextureCandidates); + QSharedPointer<MailboxTexture> &uTexture = findMailboxTexture(vquad->u_plane_resource_id, m_chromiumCompositorData->mailboxTextures, mailboxTextureCandidates); + QSharedPointer<MailboxTexture> &vTexture = findMailboxTexture(vquad->v_plane_resource_id, m_chromiumCompositorData->mailboxTextures, mailboxTextureCandidates); // Do not use a reference for this one, it might be null. QSharedPointer<MailboxTexture> aTexture; // This currently requires --enable-vp8-alpha-playback and needs a video with alpha data to be triggered. if (vquad->a_plane_resource_id) - aTexture = findMailboxTexture(vquad->a_plane_resource_id, m_data->mailboxTextures, mailboxTextureCandidates); + aTexture = findMailboxTexture(vquad->a_plane_resource_id, m_chromiumCompositorData->mailboxTextures, mailboxTextureCandidates); YUVVideoNode *videoNode = new YUVVideoNode(yTexture.data(), uTexture.data(), vTexture.data(), aTexture.data(), toQt(vquad->tex_coord_rect)); videoNode->setRect(toQt(quad->rect)); @@ -662,7 +662,7 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour #ifdef GL_OES_EGL_image_external } case cc::DrawQuad::STREAM_VIDEO_CONTENT: { const cc::StreamVideoDrawQuad *squad = cc::StreamVideoDrawQuad::MaterialCast(quad); - QSharedPointer<MailboxTexture> &texture = findMailboxTexture(squad->resource_id, m_data->mailboxTextures, mailboxTextureCandidates); + QSharedPointer<MailboxTexture> &texture = findMailboxTexture(squad->resource_id, m_chromiumCompositorData->mailboxTextures, mailboxTextureCandidates); texture->setTarget(GL_TEXTURE_EXTERNAL_OES); // since this is not default TEXTURE_2D type StreamVideoNode *svideoNode = new StreamVideoNode(texture.data()); diff --git a/src/core/delegated_frame_node.h b/src/core/delegated_frame_node.h index a031a464f..0a042ba32 100644 --- a/src/core/delegated_frame_node.h +++ b/src/core/delegated_frame_node.h @@ -56,9 +56,9 @@ class RenderPassTexture; // Separating this data allows another DelegatedFrameNode to reconstruct the QSGNode tree from the mailbox textures // and render pass information. -class DelegatedFrameNodeData : public QSharedData { +class ChromiumCompositorData : public QSharedData { public: - DelegatedFrameNodeData() : frameDevicePixelRatio(1) { } + ChromiumCompositorData() : frameDevicePixelRatio(1) { } QHash<unsigned, QSharedPointer<MailboxTexture> > mailboxTextures; scoped_ptr<cc::DelegatedFrameData> frameData; qreal frameDevicePixelRatio; @@ -69,10 +69,10 @@ public: DelegatedFrameNode(); ~DelegatedFrameNode(); void preprocess(); - void commit(DelegatedFrameNodeData* data, cc::ReturnedResourceArray *resourcesToRelease); + void commit(ChromiumCompositorData *chromiumCompositorData, cc::ReturnedResourceArray *resourcesToRelease); private: - QExplicitlySharedDataPointer<DelegatedFrameNodeData> m_data; + QExplicitlySharedDataPointer<ChromiumCompositorData> m_chromiumCompositorData; QList<QSharedPointer<RenderPassTexture> > m_renderPassTextures; int m_numPendingSyncPoints; QMap<uint32, gfx::TransferableFence> m_mailboxGLFences; diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 2cc5510ae..3e2ef71cc 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -183,7 +183,7 @@ RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget : m_host(content::RenderWidgetHostImpl::From(widget)) , m_gestureProvider(QtGestureProviderConfig(), this) , m_sendMotionActionDown(false) - , m_frameNodeData(new DelegatedFrameNodeData) + , m_chromiumCompositorData(new ChromiumCompositorData) , m_needsDelegatedFrameAck(false) , m_didFirstVisuallyNonEmptyLayout(false) , m_adapterClient(0) @@ -588,14 +588,14 @@ void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32 output_surface_id, sco m_needsDelegatedFrameAck = true; m_pendingOutputSurfaceId = output_surface_id; Q_ASSERT(frame->delegated_frame_data); - Q_ASSERT(!m_frameNodeData->frameData || m_frameNodeData->frameData->resource_list.empty()); - m_frameNodeData->frameData = frame->delegated_frame_data.Pass(); - m_frameNodeData->frameDevicePixelRatio = frame->metadata.device_scale_factor; + Q_ASSERT(!m_chromiumCompositorData->frameData || m_chromiumCompositorData->frameData->resource_list.empty()); + m_chromiumCompositorData->frameData = frame->delegated_frame_data.Pass(); + m_chromiumCompositorData->frameDevicePixelRatio = frame->metadata.device_scale_factor; // Support experimental.viewport.devicePixelRatio, see GetScreenInfo implementation below. float dpiScale = this->dpiScale(); if (dpiScale != 0 && dpiScale != 1) - m_frameNodeData->frameDevicePixelRatio /= dpiScale; + m_chromiumCompositorData->frameDevicePixelRatio /= dpiScale; m_delegate->update(); @@ -655,7 +655,7 @@ QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode) if (!frameNode) frameNode = new DelegatedFrameNode; - frameNode->commit(m_frameNodeData.data(), &m_resourcesToRelease); + frameNode->commit(m_chromiumCompositorData.data(), &m_resourcesToRelease); // This is possibly called from the Qt render thread, post the ack back to the UI // to tell the child compositors to release resources and trigger a new frame. diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h index d4a3ff248..fdb43dcae 100644 --- a/src/core/render_widget_host_view_qt.h +++ b/src/core/render_widget_host_view_qt.h @@ -235,7 +235,7 @@ private: QMap<int, int> m_touchIdMapping; scoped_ptr<RenderWidgetHostViewQtDelegate> m_delegate; - QExplicitlySharedDataPointer<DelegatedFrameNodeData> m_frameNodeData; + QExplicitlySharedDataPointer<ChromiumCompositorData> m_chromiumCompositorData; cc::ReturnedResourceArray m_resourcesToRelease; bool m_needsDelegatedFrameAck; bool m_didFirstVisuallyNonEmptyLayout; |