Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Unified Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 12614013: Plumb cc::LatencyInfo through command buffer and output surface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | content/renderer/gpu/mailbox_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_output_surface.cc
diff --git a/content/renderer/gpu/compositor_output_surface.cc b/content/renderer/gpu/compositor_output_surface.cc
index a1b8fff5c2c06523d6051563467208eeadac66c2..8c981435535a4f699d5e730df65c7b56bef4b67d 100644
--- a/content/renderer/gpu/compositor_output_surface.cc
+++ b/content/renderer/gpu/compositor_output_surface.cc
@@ -9,6 +9,8 @@
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_ack.h"
#include "cc/output/output_surface_client.h"
+#include "content/common/gpu/client/command_buffer_proxy_impl.h"
+#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
#include "content/common/view_messages.h"
#include "content/public/common/content_switches.h"
#include "content/renderer/render_thread_impl.h"
@@ -50,9 +52,9 @@ IPC::ForwardingMessageFilter* CompositorOutputSurface::CreateFilter(
CompositorOutputSurface::CompositorOutputSurface(
int32 routing_id,
- WebGraphicsContext3D* context3D,
+ WebGraphicsContext3DCommandBufferImpl* context3D,
cc::SoftwareOutputDevice* software_device)
- : OutputSurface(make_scoped_ptr(context3D),
+ : OutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D>(context3D),
make_scoped_ptr(software_device)),
output_surface_filter_(
RenderThreadImpl::current()->compositor_output_surface_filter()),
@@ -98,6 +100,30 @@ void CompositorOutputSurface::SendFrameToParentCompositor(
Send(new ViewHostMsg_SwapCompositorFrame(routing_id_, *frame));
}
+void CompositorOutputSurface::SwapBuffers(
+ const cc::LatencyInfo& latency_info) {
+ WebGraphicsContext3DCommandBufferImpl* command_buffer =
+ static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d());
+ CommandBufferProxyImpl* command_buffer_proxy =
+ command_buffer->GetCommandBufferProxy();
+ DCHECK(command_buffer_proxy);
+ context3d()->shallowFlushCHROMIUM();
+ command_buffer_proxy->SetLatencyInfo(latency_info);
+ OutputSurface::SwapBuffers(latency_info);
+}
+
+void CompositorOutputSurface::PostSubBuffer(
+ gfx::Rect rect, const cc::LatencyInfo& latency_info) {
+ WebGraphicsContext3DCommandBufferImpl* command_buffer =
+ static_cast<WebGraphicsContext3DCommandBufferImpl*>(context3d());
+ CommandBufferProxyImpl* command_buffer_proxy =
+ command_buffer->GetCommandBufferProxy();
+ DCHECK(command_buffer_proxy);
+ context3d()->shallowFlushCHROMIUM();
+ command_buffer_proxy->SetLatencyInfo(latency_info);
+ OutputSurface::PostSubBuffer(rect, latency_info);
+}
+
void CompositorOutputSurface::OnMessageReceived(const IPC::Message& message) {
DCHECK(CalledOnValidThread());
if (!client_)
« no previous file with comments | « content/renderer/gpu/compositor_output_surface.h ('k') | content/renderer/gpu/mailbox_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698